as working on a TD at the moment, I got several problems with the trigger editor. There are special waves like immune, air and so on, for which I want to play a special sound at the beginning of each wave. Now I got let's say 5 waves of air mobs: wave 5, 10, 15, 20 and 25. I would put these numbers in an array by setting variables. But I found no way to either put all 5 numbers in the array at once or with a loop or something, or found out how to make an event for ALL numbers in the array. I don't want to write 5 times the same thing... any suggestions? Something like "For each wave number[air waves] play sound x" . Is this possible?
Similar issue would be an ability (let's call it 'immunity') wo each wave of immune mobs (should also be via array?!)
Theres other ways to do this but it sounds like this would work the best for you
You need a level variable to track which level you are on and then you use that variable to figure out from the "LevelType" string array what type of level you have
Hi,
as working on a TD at the moment, I got several problems with the trigger editor. There are special waves like immune, air and so on, for which I want to play a special sound at the beginning of each wave. Now I got let's say 5 waves of air mobs: wave 5, 10, 15, 20 and 25. I would put these numbers in an array by setting variables. But I found no way to either put all 5 numbers in the array at once or with a loop or something, or found out how to make an event for ALL numbers in the array. I don't want to write 5 times the same thing... any suggestions? Something like "For each wave number[air waves] play sound x" . Is this possible?
Similar issue would be an ability (let's call it 'immunity') wo each wave of immune mobs (should also be via array?!)
What you are searching for is "for each integer ...".
Well, how would a If, then, else would look like? I need something like
If current wave number == one of the numbers of air wave array
then play sound x
else if current wave number == one of the number of immune wave array
then play sound y
else play sound z
I can't put a "for each integer" in a condition
@Lorthas: Go
i think you dont have to do an if then else action in that case...
hmmm who dont you make an array of strings or integers, and input all values there? like:
special[5] = air, special[8] = immune, special [10] = armor
indexing them as wave numbers go, and when spawning waves just go with
switch actions depending on special[current wave number] case air, do [play incomingairorwhatever]
case immune, do [etc etc]
You could use a modulo, if the number of waves between two air/immune waves is constant. If not, you could do something like:
for each i from 0 to n do
if airwaves[i] == currentwave
play airsound
...
Umm You need to rethink how your using your arrays
LevelType[0] = "normal"
LevelType[1] = "normal"
LevelType[2] = "normal"
LevelType[3] = "fast"
LevelType[4] = "normal"
LevelType[5] = "air"
LevelType[6] = "fast"
LevelType[7] = "normal"
LevelType[8] = "normal"
LevelType[9] = "normal"
LevelType[10] = "air"
Theres other ways to do this but it sounds like this would work the best for you
You need a level variable to track which level you are on and then you use that variable to figure out from the "LevelType" string array what type of level you have
@SouLCarveRR: Go
Thanks all, SouLCarveRR's solution works perfect from what I see so far!