So I've been fiddling around with the editor for a few days now and I've done my research but for the life of me I can't figure out how to simply remove an upgrade. It's as simple as this: A player gains an upgrade via trigger 'set upgrade level x for player x' then I just need another trigger that sets the upgrade back to its 'unchanged state', meaning when it wasn't affecting anything. Setting the upgrade back to level 0 doesn't seem to affect anything. Basically what I'm trying to make is a trigger that gives an upgrade to a unit (done) but if they decide to "reset" their hero with a command, then the upgrade returns to its unchanged state. Any ideas on how this could be done would be appreciated.
If it's true you can't remove an upgrade's Effects by changing the upgrade level, then what you want to do is make a behavior and add it to the unit. The behavior adds the changes you want with its Modification field and has a Validator(Disable) that checks for the upgrade (a Player Requirement validator, linked to a requirement that is like ability upgrade requirements)
from what i understand once an upgrade is applied you cant remove it.
what you can do is apply a second upgrade that nullifies the first.
That depends on the upgrade's configuration. If an upgrade sets a specific field to another value, it won't be reverted by removing it. If it adds something to that field instead, it will be reversed.
For example, if you have an upgrade, that sets the marine weapon damage to 7 and you remove that upgrade via trigger, marines still cause 7 damage. If you have an upgrade that adds 1 damage to the marine weapon, removing the upgrade will revert the damage of the marine to 6.
If you are using triggers anyways, you may also just use Catalog triggers to change the fields directly to whatever you need instead of using upgrades to do so. Catalog triggers can modify exactly the same fields Upgrades can, and they are a lot more flexible to use.
That depends on the upgrade's configuration. If an upgrade sets a specific field to another value, it won't be reverted by removing it. If it adds something to that field instead, it will be reversed.
For example, if you have an upgrade, that sets the marine weapon damage to 7 and you remove that upgrade via trigger, marines still cause 7 damage. If you have an upgrade that adds 1 damage to the marine weapon, removing the upgrade will revert the damage of the marine to 6.
If you are using triggers anyways, you may also just use Catalog triggers to change the fields directly to whatever you need instead of using upgrades to do so. Catalog triggers can modify exactly the same fields Upgrades can, and they are a lot more flexible to use.
That's very interesting that only Set Value doesn't get reverted, Blizzard's idiosyncrasy has no bounds. I guess Catalog triggers are better than my solution, except maybe for upgrades that edit arrays or flags (like for switching unit weapons), that's not so great to do with Catalog triggers but easy enough with a behavior.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
So I've been fiddling around with the editor for a few days now and I've done my research but for the life of me I can't figure out how to simply remove an upgrade. It's as simple as this: A player gains an upgrade via trigger 'set upgrade level x for player x' then I just need another trigger that sets the upgrade back to its 'unchanged state', meaning when it wasn't affecting anything. Setting the upgrade back to level 0 doesn't seem to affect anything. Basically what I'm trying to make is a trigger that gives an upgrade to a unit (done) but if they decide to "reset" their hero with a command, then the upgrade returns to its unchanged state. Any ideas on how this could be done would be appreciated.
from what i understand once an upgrade is applied you cant remove it.
what you can do is apply a second upgrade that nullifies the first.
If it's true you can't remove an upgrade's Effects by changing the upgrade level, then what you want to do is make a behavior and add it to the unit. The behavior adds the changes you want with its Modification field and has a Validator(Disable) that checks for the upgrade (a Player Requirement validator, linked to a requirement that is like ability upgrade requirements)
That depends on the upgrade's configuration. If an upgrade sets a specific field to another value, it won't be reverted by removing it. If it adds something to that field instead, it will be reversed.
For example, if you have an upgrade, that sets the marine weapon damage to 7 and you remove that upgrade via trigger, marines still cause 7 damage. If you have an upgrade that adds 1 damage to the marine weapon, removing the upgrade will revert the damage of the marine to 6.
If you are using triggers anyways, you may also just use Catalog triggers to change the fields directly to whatever you need instead of using upgrades to do so. Catalog triggers can modify exactly the same fields Upgrades can, and they are a lot more flexible to use.
That's very interesting that only Set Value doesn't get reverted, Blizzard's idiosyncrasy has no bounds. I guess Catalog triggers are better than my solution, except maybe for upgrades that edit arrays or flags (like for switching unit weapons), that's not so great to do with Catalog triggers but easy enough with a behavior.