Here is what I have for doing just that.
It turned out pretty well, and if you have anything that you can add to it Im sure everyone would be happy to use it!
For some reason the south and east winds dont really do so well, im not really sure why...
Rem Positive Z is North, Negative Z is south
Rem Positive X is West, Negative X is East
Rem Postive Y is Up, Negative Y is down
phy start
sync on
sync rate 60
color backdrop 0
make object box 1, 1, 10, 1
position object 1, 0, 5, 0
load image "flagpoletexture1.jpg",2
phy make rigid body static box 1
phy make cloth 2
phy set cloth dimensions 2, 4, 4, 0.2
phy set cloth position 2, 0, 10, 0
phy set cloth rotation 2, 90, 0, 0
phy build cloth 2
phy attach cloth to shape 2, 1, 1
load image "AvianFlagTexture.jpg", 1
texture object 1,2
texture object 2, 1
position camera 1.8, 10.8, 7.8
phy set cloth bending 2,1
rotate camera 32, 190, 0
REM Wind Control System
Rem Positive Z is North, Negative Z is south
Rem Positive X is West, Negative X is East
Rem Postive Y is Up, Negative Y is down
REm North Wind (1)
Rem X=RND (10)
Rem Y=(RND (50))-(RND (50))
Rem Z=Rnd (100)
Rem North-East Wind (2)
Rem X=RND(-50)
Rem Y=(RND (50))-(RND (50))
Rem Z=RND (50)
Rem East Wind (3)
Rem X=RND(-100)
Rem Y=(RND (50))-(RND (50))
Rem Z=RND(-10)
Rem South-East Wind (4)
Rem X=RND(-70)
Rem Y=(RND (50))-(RND (50))
Rem Z=RND(-70)
Rem South-Wind (5)
Rem X=(RND (15))-(RND (15))
Rem Y=(RND (50))-(RND (50))
Rem Z=RND(-100)
Rem South-West Wind (6)
Rem X=RND(50)
Rem Y=(RND (50))-(RND (50))
Rem Z=RND(-50)
Rem West Wind (7)
Rem X=RND(100)
Rem Y=(RND (50))-(RND (50))
Rem Z=(RND (15))-(RND (15))
Rem North-West Wind (8)
Rem X=RND (50)
Rem Y=(RND (50))-(RND (50))
Rem Z=RND (50)
Rem Idle Wind (9 and 0)
rem REM X=0
Rem Y=0
Rem Z=0
REm ~~~~~~~~~~~~~~~~~~~~~~~~~
do
Print (Screen FPS() )
phy set cloth external acceleration 2, x,y,z
If waitingvariable=190 then WindSpeedandDirection=RND (9)
If waitingvariable > 210 then waitingvariable=-220
If waitingvariable<220 then waitingvariable=waitingvariable +1
Rem (1)
If WindSpeedandDirection = 1 then X=RND (10)
If WindSpeedandDirection = 1 then Y=(RND (50))-(RND (50))
If WindSpeedandDirection = 1 then Z=Rnd (100)
Rem (2)
If WindSpeedandDirection = 2 then X=RND(-50)
If WindSpeedandDirection = 2 then Y=(RND (50))-(RND (50))
If WindSpeedandDirection = 2 then Z=RND (50)
Rem (3)
If WindSpeedandDirection = 3 then X=RND(-100)
If WindSpeedandDirection = 3 then Y=(RND (50))-(RND (50))
If WindSpeedandDirection = 3 then Z=RND(-10)
Rem (4)
If WindSpeedandDirection = 4 then X=RND(-70)
If WindSpeedandDirection = 4 then Y=(RND (50))-(RND (50))
If WindSpeedandDirection = 4 then Z=RND(-70)
Rem (5)
If WindSpeedandDirection = 5 then X=(RND (15))-(RND (15))
If WindSpeedandDirection = 5 then Y=(RND (50))-(RND (50))
If WindSpeedandDirection = 5 then Z=RND(-100)
Rem (6)
If WindSpeedandDirection = 6 then X=RND(50)
If WindSpeedandDirection = 6 then Y=(RND (50))-(RND (50))
If WindSpeedandDirection = 6 then Z=RND(-50)
Rem (7)
If WindSpeedandDirection = 7 then X=RND(100)
If WindSpeedandDirection = 7 then Y=(RND (50))-(RND (50))
If WindSpeedandDirection = 7 then Z=(RND (15))-(RND (15))
Rem (8)
If WindSpeedandDirection = 8 then X=RND (50)
If WindSpeedandDirection = 8 then Y=(RND (50))-(RND (50))
If WindSpeedandDirection = 8 then Z=RND (50)
Rem (PRinting out the wind direction)
If WindSpeedandDirection = 0 then PRint "Idle Wind"
If WindSpeedandDirection = 1 then Print "North Wind"
If WindSpeedandDirection = 2 then Print "North-East Wind"
If WindSpeedandDirection = 3 then Print "East Wind"
If WindSpeedandDirection = 4 then Print "South-East Wind"
If WindSpeedandDirection = 5 then Print "South-Wind"
If WindSpeedandDirection = 6 then Print "South-West Wind"
If WindSpeedandDirection = 7 then Print "West Wind"
If WindSpeedandDirection = 8 then Print "North-West Wind"
If WindSpeedandDirection = 9 then Print "Idle Wind"
Control camera using arrowkeys 0,.1,1
phy update
sync
loop
