| 07-13-2003, 04:01 AM | #1 |
Hello, I have for example 4 regions. Is it possible to spawn a unit in a random one? edit: I found a solution, used search function too late ![]() |
| 07-13-2003, 05:07 AM | #2 |
Yes there is. but i wont tell u jk this is probably not the best way to do it but its the easiest to do make an integer variable; ill call it x make 4 extra triggers each one following this formula random spawn 1 Events <none> Conditions if <x> is 1 Actions <do watever> at region 1 now do 3 more with x=2,3,4 (basically a trigger for each random action; what the trigger actually does is randomly select one of the triggers to execute) then add this to the trigger that fires when a unit needs respawning Actions set x to random number between 1 and 4 run the triggers above (seperate actions) yes it does seem excesive but i know of no better way |
| 07-13-2003, 05:12 AM | #3 |
Not a bad idea, I will try this thx |
| 07-13-2003, 05:25 AM | #4 |
Or.. --------- Variables: RandomNumber (integer) RegionArray (a region array) Events: Whatever.. Conditions: Meh? Actions: Set RandomNumber = Random Number between 1 and 4 Set RegionArray[1] = first region Set RegionArray[2] = second region Set RegionArray[3] = third region Set RegionArray[4] = fourth region Create 1 (Whateverunit) at random point in (Regionarray[RandomNumber]) -------- Real quick, real easy, real effective. |
