In my map, buildings apart from training units can also be upgraded. To upgrade buildings I use the morph ability. However morph abilities won't allow you to use them until the building stops training units. I want to make this morph ability queueable, so you can order the building to upgrade after training all the units.
Don't use a morph ability, and instead use a normal unit creation ability with an attached trigger? This way you could even be really smart and save the building's construction queue into the newly morphed building.
Not sure if this fits your map but there isn't much information to go on!
I've ended up doing something similar. If someone else is interested on it:
- I created the unit train ability. This ability trains a dummy unit which cost the same as the upgrade.
- I created a trigger that executes when the the dummy unit is trained. This trigger removes the dummy unit and orders the struture to morph. Note that when you use the train ability, you will spend your resources so you will have to return back the resources to the player before morphing the structure.
In my map, buildings apart from training units can also be upgraded. To upgrade buildings I use the morph ability. However morph abilities won't allow you to use them until the building stops training units. I want to make this morph ability queueable, so you can order the building to upgrade after training all the units.
How can I do this?
Don't use a morph ability, and instead use a normal unit creation ability with an attached trigger? This way you could even be really smart and save the building's construction queue into the newly morphed building.
Not sure if this fits your map but there isn't much information to go on!
I've ended up doing something similar. If someone else is interested on it:
- I created the unit train ability. This ability trains a dummy unit which cost the same as the upgrade.
- I created a trigger that executes when the the dummy unit is trained. This trigger removes the dummy unit and orders the struture to morph. Note that when you use the train ability, you will spend your resources so you will have to return back the resources to the player before morphing the structure.