I thought the map that you made was bad. The blockade of snipers was useless. If you gave each building 50 resources each, I could've beaten the game faster. It wasn't that fun when it took you an hour to beat it. I think if you made it a little more realistic, you could have something. Maybe that's just my style, but I like it to be easy.
Also, does this mean you can spawn waves at a certain moment? I was thinking for my Venice map, I add a bridge and zombies only come out at the 5th wave. There would be 5 more waves of that making it an even ten waves to complete the game.
The scripting engine is a state machine (an Nondeterministic Finite Automaton actually). It starts at the start state and each state has edges which are events in the game which trigger the state change.
When a state is entered, it executes any actions in that state which changes the world in some way. There is no in-built win condition. The game wins if and only if a state with the win action is reached.
Mostly it works like a Deterministic Finite Automaton, except that there is a special 'add-state' option which creates another state which can react in parallel. This is how the script in level 4 works to track win conditions. It adds the 'none' state which works to track win conditions completely parallel from tracking the tutorial text and then horde countdowns.
One of the actions is 'countdown' which takes a number and counts down that much on the clock before triggering the 'countdown-complete' edge. At that point, it moves to a state which uses the 'horde' action to generate monsters.
By default, the horde action just generates a horde from a random bridge or the island buildings of increasing size. But you can pass in x, y, and # arguments to spawn a particular number of zombies in a particular place like in the level 1 map.
If you want to generate a particular number of waves, you will want a couple of states for every wave. And they will be in a simple line:
These states will then contain actions to generate either a countdown or the zombie horde you want. If your win condition is to survive all the hordes, then you can have the win action in a state got to from the final horde state. If you want standard win conditions, you will need to copy and paste that none/bridge/zombie/bridge-zombie states from level 4 and use the add-state action to run that in parallel with your own code.
So den, does this mean you can spawn waves at a certain moment? I was thinking for my Venice map, I add a bridge and zombies only come out at the 5th wave. There would be 5 more waves of that making it an even ten waves to complete the game.