Jump to content
Sign in to follow this  
TheRedBaron

Random bombing

Recommended Posts

I finally understand how to use setpos & getpos(ty for all that helped). Now im trying to drop bombs in a general area. Ive searched and tryed several combos but have had no success. these are some that Ive tryed...

"laserguidedbomb" setpos [getpos object 20913 random 0,dido on y with1 being last#, (getpos object 20913 random 2) +100]

-

"laserguidedbomb" setpos [getpos object 20913 (random (50+50)) -50, getpos object 20913 (random (50+50)) -50, +100]

as you can see I have no idea how to do it please help.

Share this post


Link to post
Share on other sites

Say you were wanting to add a number between 0 and 50 to each of the co-ords, do this:

"LaserGuidedBomb" setpos [(getpos object 20913) + random 50, (getpos object 20913) + random 50, +100]

Is that it? confused.gif

tounge.gif PEACE

Share this post


Link to post
Share on other sites

Hello ,

Here a little example of a random bombing based on an unit position

-Create a soldier, name it bob , it will be you (by default , oriented North)

-Create a trigger (bob must be in the array)

-At Activation, select Radio Alpha

-Select Repeatedly

-At the line on Activation , put that

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">Bomb="LaserGuidedBomb" camcreate [(getpos bob select 0)+60+random 100, (getpos bob select 1)+70+random 100, (getpos bob select 2)+80+random 50]<span id='postcolor'>

In game, type 0 - 0 - 1 to start Radio Alpha

It will create a LGB named Bomb 60m East of bob (+a random distance up to 100m) , 70m North of Bob (+a random distance up to 100m) , and upsky 80m (+a random distance of 50m)

Because of the repeatedly selected in the trigger , you can type all the time you want 0-0-1 to have a random bomb with the security distance 60m 70m.

-You can have negative value instead of positive one for the randomness , or for the direction South and West (opposite of North and East)

I hope this little example can help you

Share this post


Link to post
Share on other sites

Just some small advice, make the random bombing area much larger, otherwise "bob" would be blown up allot. Nothing wrong with that, but if its mostly for scenery you should give it more space or smaller bombs (laserguidedbombs are nasty as hell lol)

Greetings

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  

×