- Joined
- Apr 11, 2015
- Messages
- 664
So how to make rounds,like the game restarts when the game is over.
Not bad idea,thanks.If you set up a trigger to spawn the starting units, it will be much easier. You can just remove all the units and then run that trigger to create new ones.
If you write some bad JASS code (make a new trigger, edit -> convert to custom script, write some stuff that is obviously not code: saklfdasdf) and then try to save your map, it will pop up with an debug window that shows you all of the JASS code that is generated for your map.
Units placed in the map editor actually generate some JASS code. If you are comfortable with JASS, you can go through the code and copy out the part that spawns all your starting units.
Then you delete the units on your map and use the copied JASS code in the new trigger that you can use to spawn all of the starting units.
I haven't tested if this works, but I did notice this while working on something else that involved purposely writing an error (it was to get the exact camera bounds normally given to my map).
Only if linked to triggers. Otherwise they are thrown into the .doo files.Units placed in the map editor actually generate some JASS code.
Only if linked to triggers. Otherwise they are thrown into the .doo files.
Anyway the idea is...
End -> Destroy -> Initialize -> Start
End is when your round ends. Depends on map type and then triggers the destroy phase.
Destroy is when you get rid of the current map state. this includes removing all progress players have made, all out of place units, all created objects (eg active abilities etc).
Create is when you set up the map. You re-create all units, destructibles, items etc. You also re-initialize all systems of the map so they have default state. The only system that should not be reset is the round counter itself which should persist the round state.
Start is when players get control again. Each start phase should have the same player state as each other start phase.
That's exactly what i will do on some maps.Only if linked to triggers. Otherwise they are thrown into the .doo files.
Anyway the idea is...
End -> Destroy -> Initialize -> Start
End is when your round ends. Depends on map type and then triggers the destroy phase.
Destroy is when you get rid of the current map state. this includes removing all progress players have made, all out of place units, all created objects (eg active abilities etc).
Create is when you set up the map. You re-create all units, destructibles, items etc. You also re-initialize all systems of the map so they have default state. The only system that should not be reset is the round counter itself which should persist the round state.
Start is when players get control again. Each start phase should have the same player state as each other start phase.