Zwiebelchen
Hosted Project GR
- Joined
- Sep 17, 2009
- Messages
- 7,234
Kind of a tricky question, but I could imagine this having a pretty simple solution:
What I want is to create a unit via Jass before preplaced units are generated on the map script.
Since the order of abilities displayed in the spellbook is determined by the order in which these abilities get first loaded into the game, I can manually arrange these abilities by just preloading them in a certain order on map init.
However, as I have lots of preplaced units on the map with certain abilities assigned to them in the object editor, things get messed up if I try to establish this order after these units get initialized.
So my solution is to just create a dummy unit before all preplaced units are generated and cycle through the list of abilities, adding/removing them one by one.
Is there a quick and easy way to do that? Do I need to actually inject code or can I abuse struct/module/library initializers for that?
EDIT: I tested it with a library initializer and it seems that library initializers run after preplaced units. So I need to inject into main() to do this?
What I want is to create a unit via Jass before preplaced units are generated on the map script.
Since the order of abilities displayed in the spellbook is determined by the order in which these abilities get first loaded into the game, I can manually arrange these abilities by just preloading them in a certain order on map init.
However, as I have lots of preplaced units on the map with certain abilities assigned to them in the object editor, things get messed up if I try to establish this order after these units get initialized.
So my solution is to just create a dummy unit before all preplaced units are generated and cycle through the list of abilities, adding/removing them one by one.
Is there a quick and easy way to do that? Do I need to actually inject code or can I abuse struct/module/library initializers for that?
EDIT: I tested it with a library initializer and it seems that library initializers run after preplaced units. So I need to inject into main() to do this?
Last edited: