I have many building upgrades and I need to detect when any one finishes its upgrade into a more powerful building. I have searched the forum and have found that I can use this command to detect when a certain building completes an upgrade or morph:
Instead of making a trigger for each and every single upgrade command (I will have over a 150 building upgrades and thus 150 triggers) is there a way to detect when any building finishes uses any morph / upgrade command?
This is because the cost of the buildings plays a role in determining that players income. When they morph a building they get a percentage of its cost in their income. For example an income starts at 10 minerals / sec. A player builds a 100 mineral building and now their income is 20 gold / sec (10 initial + 10%*100). I know how to do this part with triggers and script because I can get it using "TriggerAddEventUnitConstructProgress(null, c_unitProgressStageComplete)" which also allows me to obtain the player number and building that was build and thus their unit properties.
Then the player upgrades the building with a 400 mineral upgrade cost. Now their income is 60 gold / sec (20 + 10%*400). Since there is no TriggerAddEventUnitMorphProgress type command I would have to detect each individual upgrade ability thus resulting in all of the 100+ triggers instead of being able to use just one.
Is there a better way to do this with he trigger editor or using scripting or will I have to make the 100+ triggers to detect each individual building morph? Thanks for any help.
I did my upgrades based on the larva - Morph ability, with that I can use the Trigger "Unit - Any Unit training progress is Completed", which works just fine.
This is working out better than I had hoped because the build animations are actually working and paying attention to the ability.start and .end events of the morph abilities. Thanks once again.
I have many building upgrades and I need to detect when any one finishes its upgrade into a more powerful building. I have searched the forum and have found that I can use this command to detect when a certain building completes an upgrade or morph:
TriggerAddEventUnitAbility(null, "UpgradeToTower1ToTower2", 0, c_unitAbilStageComplete, false)
Instead of making a trigger for each and every single upgrade command (I will have over a 150 building upgrades and thus 150 triggers) is there a way to detect when any building finishes uses any morph / upgrade command?
This is because the cost of the buildings plays a role in determining that players income. When they morph a building they get a percentage of its cost in their income. For example an income starts at 10 minerals / sec. A player builds a 100 mineral building and now their income is 20 gold / sec (10 initial + 10%*100). I know how to do this part with triggers and script because I can get it using "TriggerAddEventUnitConstructProgress(null, c_unitProgressStageComplete)" which also allows me to obtain the player number and building that was build and thus their unit properties.
Then the player upgrades the building with a 400 mineral upgrade cost. Now their income is 60 gold / sec (20 + 10%*400). Since there is no TriggerAddEventUnitMorphProgress type command I would have to detect each individual upgrade ability thus resulting in all of the 100+ triggers instead of being able to use just one.
Is there a better way to do this with he trigger editor or using scripting or will I have to make the 100+ triggers to detect each individual building morph? Thanks for any help.
@CDW: Go
I did my upgrades based on the larva - Morph ability, with that I can use the Trigger "Unit - Any Unit training progress is Completed", which works just fine.
Thank you I will try that.
Edit: update
This is working out better than I had hoped because the build animations are actually working and paying attention to the ability.start and .end events of the morph abilities. Thanks once again.
found this thread again. got the same Problem.
Any suggestion?
thx