Okay, so I got a little problem again with my drop-pod trigger. I'm using a loop to drop drop-pods every 30 seconds 10 times at 11 different random locations on the map. Works all well and fine, but the problem is that the drop pods can drop at the same location on top of eachother, and I don't want that to happen. Making them drop to points in a specific order would be very bad and make the game predictable very fast.
To summarize, I want the drop pods to drop at random locations, but I don't want them to drop on the same location more then once. I'm not really sure about how I could do this, so any kind of help is appriciated.
TestEventsTimer-Every30.0secondsofGameTimeLocalVariablesi=0<Integer>ConditionsActionsVariable-Seti=(Randomintegerbetween1and11)General-If(Conditions)thendo(Actions)elsedo(Actions)IfPoint_On[i] == true
Points_Done <= 10
Then
Unit - Create 1 Unit for player 1 at Point[i] facing 270.0 degrees (No Options)
Variable - Set Point_On[i] = false
Variable - Modify Points_Done: + 1
Else
General - If (Conditions) then do (Actions) else do (Actions)
If
Points_Done <= 10
Then
Trigger - Run Test (Check Conditions, Don't Wait until it finishes)
Else
Trigger - Turn (Current trigger) Off
This should work. It will generate a random number, and then check if it's already been dropped on and if not, create a drop-pod. If it has, it re-runs itself. If the drops have happened too much, it will turn itself off.
Aaah, I didn't think about re-running the trigger! Very clever, I will have to try this out tomorrow though, since it's getting kinda late. Thanks for the help though. ;)
In that trigger above looks like you need to make "pointsdone" a local variable
nope. Needs to be referenced outside to stop it triggering every 30 seconds then looping itself infinite times x every 30 seconds since it ended.
Global vars you need:
Points_Done (int, default 0, no array, to check the amount of times run) Points_On (Boolean, default true, array 11, to check if the point is available) Point (Point, needs to be set outside the trigger, array 11, to reference the point)
Okay, so I got a little problem again with my drop-pod trigger. I'm using a loop to drop drop-pods every 30 seconds 10 times at 11 different random locations on the map. Works all well and fine, but the problem is that the drop pods can drop at the same location on top of eachother, and I don't want that to happen. Making them drop to points in a specific order would be very bad and make the game predictable very fast.
To summarize, I want the drop pods to drop at random locations, but I don't want them to drop on the same location more then once. I'm not really sure about how I could do this, so any kind of help is appriciated.
@Devrak: Go
This should work. It will generate a random number, and then check if it's already been dropped on and if not, create a drop-pod. If it has, it re-runs itself. If the drops have happened too much, it will turn itself off.
Aaah, I didn't think about re-running the trigger! Very clever, I will have to try this out tomorrow though, since it's getting kinda late. Thanks for the help though. ;)
In that trigger above looks like you need to make "pointsdone" a local variable
nope. Needs to be referenced outside to stop it triggering every 30 seconds then looping itself infinite times x every 30 seconds since it ended.
Global vars you need:
Points_Done (int, default 0, no array, to check the amount of times run)
Points_On (Boolean, default true, array 11, to check if the point is available)
Point (Point, needs to be set outside the trigger, array 11, to reference the point)
Although you can name them whatever you like.