Jump to content
Sign in to follow this  
Redskin53

random  script

Recommended Posts

Is there a script that allows the placement of grenades,satchels,ap mines ect and have them randomly placed each time they go off and repeatldy so its never in the same place twice(random) can this be done or not?

Share this post


Link to post
Share on other sites

explosive object appearing and exploding randomly ?

I agree, it sounds like the result of an artillery script.

As there are plenty of those artillery script, i guess one of them should do what you are searching for.

Share this post


Link to post
Share on other sites

No this is not an atrillary script that im looking for,il try to explain better:i want to place a mine or grenade or ap mine in the map and have it invisiable to the player,next after a player has set it off i want it to respawn in a diff location so a player cant remember where it was (random) and it must be located in the playing field-doesnt do any good to have it out of play 100's of miles away.

Hope this clears up what im trying to do

Share this post


Link to post
Share on other sites

you have some options in mission editor (when using mines/objects...)->placement radious and probability of presents.

select a mine, set a placement radious (maybe 50) and than 60% for pop. its always on different place but i font know if its opn different place when u save/load the position.

Share this post


Link to post
Share on other sites

You can add a line like this into you script to add a random element to the placement of your mines:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_targ setpos [(getpos _ldr select 0) + (random (_acc*2)) - _acc,(getpos _ldr select 1) + (random (_acc*2)) - _acc,0]

Of course you have to change the variables to suit your script needs. The variable _acc is used to change the accuracy of the random feature; the bigger the number, the wider the area that the _targ would be placed.

If they were only to be placed in the editor and you are not concerned about respawning, you could just make multiple markers and group them (F2) to the object (or is it sync F5?) and then the object will be randomly placed at the marker location.

Hope this helps some.

                                             Wadmann

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×