so i just recently started using upgrades and i can get most of it to work; linked it to a research ability, can have the unit research the upgrade, the upgrades dissapears from the command card afterwards. the problem im having is that the upgrade doesn't seem to be, well, upgrading. i have the upgrade affecting two units which i set in the "affected units array" and i put in the effect of a buff that i want to change and set the "add" and "subtract for the particular part of the buff. but when the unit researches the upgrade nothing happens.
what im trying to do is this; i have a unit with a behavior that modifies a player's custom resource value by +1 when its initially built and modifies the custom resource by -1 when the unit dies. what i want when i upgrade the unit is to increase the modification on the custom resource by +/-1 so that the unit modifies the resource by +2 when alive and -2 when it dies. then have another upgrade that makes it modify by +/-3. i set up the upgrade to "add" 1 to the "modify player" effect so theoretically it should modify the custom resource by +2 from then on, but it doesnt. any ideas?
Seems like your Modify Player effect is only triggering once, which it should be. When you upgrade, you are only changing the NEXT time that the effect happens.
Basically, it is not retroactive because it modifies an effect.
I ran a test.
Gave a buff to marines, the initial effect was a modify player, +1 mineral. The final effect was a modify player, -1 mineral.
Gave the barracks an upgrade, ADD +1 to initial effect, ADD -1 to final effect, affected unit is Marine.
Tested in game, I build a marine, he gives 1 mineral, I build a second marine, he gives 1 mineral, for a total of 2. I kill one marine, I lose a mineral for 1 total.
I upgrade, no extra mineral applied from my current marine. Build a new marine, +2 = 3 total. Kill the old marine, -2 = 1 total mineral.
Problem arises if you have, lets say 4 marines =4 minerals, then you upgrade. 4 minerals, Kill 3 marines for -6 = 0 minerals(mineral don't go into negatives).
Attached the map since it seems you are applying the upgrade incorrectly if it is not working properly when you kill marines after the upgrade. You can upgrade in my map up to 4 times for a +/- 5 mineral modification effect.
your upgrade and mine are nearly the exact same except mine changes custom resource, but still after upgrading, all buildings built after the upgrade, that should have the upgraded effect, still only change the custom resource by +/-1. there are requirements for the upgrades but that only affects whether the upgrade button shows on the command card or not. :(
To solve the issue BorgDragon pointed out I suggest 2 different buffs, the standard one and the upgraded one, and then with the upgrade you change the buff your Barracks give to your Marines. This way "old" Marines still give -1 when they die while "new" Marines give/take 2.
yes that would fix his problem but my buildings are still uneffected by my upgrade, whether they were built before or after the upgrade despite my upgrade looking pretty much like his. so i cant even get to that problem! X(
@KingRadical: Go So let me redo your steps. How do you apply the buff to your units/buildings? Is this method working properly? Can you replace the buff by a new buff using this method?
My personal experience with upgraded buffs is that most of the time you will have to replace the buff instead. Most fields within a buff wont get upgraded properly.
so what your saying is that after the upgrade i have to remove my buff, then reapply the same buff for the changes to occur? or to remove the original buff after the upgrade and apply a new buff that will have the same Modify - Player effects, but now the effects will have the upgraded effects?
@KingRadical: Go If you want "old" marines to be upgraded then yes, you can create a validator to switch buffs. If you dont care about your old marines then you just need to change the buff that will be applied to the units being produced.
I had this issue with Detector buffs. They can't be upgraded to detect a larger area, so I had to create 2 buffs, one without the upgrade and one with upgraded range, then I created validators for them so one would be removed when the upgrade is completed and the other would be enabled when the same upgrade is completed. In your case you have to check if your buff will give the player more resources once the upgrade removes the standard buff.
huh. ok, never worked with switch effects before, but ill give it a try :)
edit: on second thought, does the Behaviors: Validators (Disable) area of a buff constantly check to see if the validator requirement is met and then when it is, enables the behavior? if so then i could simply apply all three behaviors (the normal modify and then the next tier modifiers) at the start with a validator in the Behaviors: Validators (Disable) section and have the validator wait until the upgrade has researched to enable that buff.
would the Behaviors: Validators (Disable) work that way or should i use a switch effect to do this?
@KingRadical: Go You can use the disable and remove fields, they check constantly so they will work to detect your upgrade. The thing is you will have to test if they will give resources when enabled or removed by the upgrade and so on.
can you give me and example of how to do this. i tried putting the validator in the (disable) part, but it adds the resource first then disables the buff. so i put the validator in the (remove) section and set up a sort of loop so the buff would be added when it was removed and it would keep doing so (ultimately doing nothing) until the upgrade was researched, but the validator doesnt seem to see that the upgrade is researched and just continues to remove and reapply (so i assume). clearly im doing something wrong somewhere.
@KingRadical: Go
Yo do not need to create a loop to re-add the buff, first of all. The validator in the Disable field only disables it, not removes it. It's still technically on the unit, it just shouldn't come into effect. Also, it shouldn't be used to check on an upgrade. That is best left in a requirement.
You give your unit(s) each of the behaviors that coincide with an upgrade level.
Setup a Requirement and put that in the Behavior: Requirements+ field.
Your requirement(s) should look something like this when you are editing it in "tree" mode.
Requirement For the Default Behavior(+1/-1)(if it's always on at the start of the game) (If it's not on right away, refer to the lvl2 requirement, adjust each CountUpgrade by -1 for the first level)
Show
Equals
CountUpgrade MineralsLevel2 Completed
Constant 0
(This will disable the default/initial +1/-1 behavior when you upgrade to +2/-2)
Requirement for the 2nd Level(+2/-2)
Show
And
CountUpgrade MineralsLevel2 Completed
Equals
CountUpgrade MineralsLevel3 Completed
Constant 0
(This will enable once you get +2/-2, and disable when you upgrade to +3/-3)
Any levels after this until the very last one should look like the above requirement, of course updating the Upgrade Count by +1 in each CountUpgrade
Requirement for the last Level(+5/-5)(or however high it goes)
Show
CountUpgrade MineralsLevel5 Completed
Validators should be mostly used for things like "IsNotMoving" or "CasterHasEnergy"
no good. made the requirements just like in your example, put them in the Behavior: Requirements+ field, and had my buildings start with the behaviors by putting them in the Behaviors: Behaviors+ and it didnt work. then i tried having a starting behavior that would apply the behaviors after a set time, still didnt work. the behaviors immediately increased the custom resource by 3 (there are 3 behaviors each with the "increase" and "decrease" effects of +/- 1).
Hmm, maybe instead of Show, try USE? And if you just use 3 separate behaviors with +/-1 Resource, you will also need to change the requirements. I thought you were going with Behavior 1 is set to +/-1 and Behavior 2 set to +/-2, hence the disabling of lower requirements once the next behavior is active.
No requirement on the first behavior, since it is likely standard/default to the unit(always +/-1 regardless of upgrades)
well what i originally wanted was ONE behavior with a +/-1 modify effect that had the EFFECT upgraded to then be a +/-2 by using the "Add" function of the upgrade, but it sounded like to upgrade the effects of a behavior i would need to create a new behavior (with the same +/-1 effect of the first behavior) and have it swap with the original behavior so the the upgrade function would take effect on previous and future buildings and change the original +/-1 modify effect of the behavior into a +/-2 modify.
but maybe i should stick with the 3 behaviors, each with the +/-1 modify effect, and sort them out like you just described above...
Edit: so i came up with a workaround...
what i did was this.... my building takes 30 seconds to build, so i have a buff that lasts for 30 seconds and applies the first "tech level" modification when it expires (that way the resource isn't modified while the building is being constructed). this is where the work around comes in. my building also has 2 initial behaviors with a 0.5 duration and will apply the other 2 "tech level" modifications when removed. these 2 initial behaviors have the upgrade requirements and wont start their countdown until the upgrade is researched. (the original problem before with the 2 modify "tech level" behavior was even though they had the requirements to be disabled until the upgrade was researched, they would still apply the "tech level" modification without the upgrade).
now my future buildings AND my previous building will be affected and they will be affected properly. phew. Thank you both for your suggestions and help. I'm glad to say, this problem is solved :D
so i just recently started using upgrades and i can get most of it to work; linked it to a research ability, can have the unit research the upgrade, the upgrades dissapears from the command card afterwards. the problem im having is that the upgrade doesn't seem to be, well, upgrading. i have the upgrade affecting two units which i set in the "affected units array" and i put in the effect of a buff that i want to change and set the "add" and "subtract for the particular part of the buff. but when the unit researches the upgrade nothing happens.
what im trying to do is this; i have a unit with a behavior that modifies a player's custom resource value by +1 when its initially built and modifies the custom resource by -1 when the unit dies. what i want when i upgrade the unit is to increase the modification on the custom resource by +/-1 so that the unit modifies the resource by +2 when alive and -2 when it dies. then have another upgrade that makes it modify by +/-3. i set up the upgrade to "add" 1 to the "modify player" effect so theoretically it should modify the custom resource by +2 from then on, but it doesnt. any ideas?
@KingRadical: Go
Seems like your Modify Player effect is only triggering once, which it should be. When you upgrade, you are only changing the NEXT time that the effect happens.
Basically, it is not retroactive because it modifies an effect.
I ran a test.
Gave a buff to marines, the initial effect was a modify player, +1 mineral. The final effect was a modify player, -1 mineral.
Gave the barracks an upgrade, ADD +1 to initial effect, ADD -1 to final effect, affected unit is Marine.
Tested in game, I build a marine, he gives 1 mineral, I build a second marine, he gives 1 mineral, for a total of 2. I kill one marine, I lose a mineral for 1 total.
I upgrade, no extra mineral applied from my current marine. Build a new marine, +2 = 3 total. Kill the old marine, -2 = 1 total mineral.
Problem arises if you have, lets say 4 marines =4 minerals, then you upgrade. 4 minerals, Kill 3 marines for -6 = 0 minerals(mineral don't go into negatives).
Attached the map since it seems you are applying the upgrade incorrectly if it is not working properly when you kill marines after the upgrade. You can upgrade in my map up to 4 times for a +/- 5 mineral modification effect.
your upgrade and mine are nearly the exact same except mine changes custom resource, but still after upgrading, all buildings built after the upgrade, that should have the upgraded effect, still only change the custom resource by +/-1. there are requirements for the upgrades but that only affects whether the upgrade button shows on the command card or not. :(
it shouldnt matter if the unit being upgraded is the one that researches the upgrade right?
To solve the issue BorgDragon pointed out I suggest 2 different buffs, the standard one and the upgraded one, and then with the upgrade you change the buff your Barracks give to your Marines. This way "old" Marines still give -1 when they die while "new" Marines give/take 2.
@SoulFilcher: Go
yes that would fix his problem but my buildings are still uneffected by my upgrade, whether they were built before or after the upgrade despite my upgrade looking pretty much like his. so i cant even get to that problem! X(
@KingRadical: Go So let me redo your steps. How do you apply the buff to your units/buildings? Is this method working properly? Can you replace the buff by a new buff using this method?
My personal experience with upgraded buffs is that most of the time you will have to replace the buff instead. Most fields within a buff wont get upgraded properly.
@SoulFilcher: Go
so what your saying is that after the upgrade i have to remove my buff, then reapply the same buff for the changes to occur? or to remove the original buff after the upgrade and apply a new buff that will have the same Modify - Player effects, but now the effects will have the upgraded effects?
@KingRadical: Go If you want "old" marines to be upgraded then yes, you can create a validator to switch buffs. If you dont care about your old marines then you just need to change the buff that will be applied to the units being produced.
I had this issue with Detector buffs. They can't be upgraded to detect a larger area, so I had to create 2 buffs, one without the upgrade and one with upgraded range, then I created validators for them so one would be removed when the upgrade is completed and the other would be enabled when the same upgrade is completed. In your case you have to check if your buff will give the player more resources once the upgrade removes the standard buff.
@SoulFilcher: Go
huh. ok, never worked with switch effects before, but ill give it a try :)
edit: on second thought, does the Behaviors: Validators (Disable) area of a buff constantly check to see if the validator requirement is met and then when it is, enables the behavior? if so then i could simply apply all three behaviors (the normal modify and then the next tier modifiers) at the start with a validator in the Behaviors: Validators (Disable) section and have the validator wait until the upgrade has researched to enable that buff.
would the Behaviors: Validators (Disable) work that way or should i use a switch effect to do this?
@KingRadical: Go You can use the disable and remove fields, they check constantly so they will work to detect your upgrade. The thing is you will have to test if they will give resources when enabled or removed by the upgrade and so on.
@SoulFilcher: Go
can you give me and example of how to do this. i tried putting the validator in the (disable) part, but it adds the resource first then disables the buff. so i put the validator in the (remove) section and set up a sort of loop so the buff would be added when it was removed and it would keep doing so (ultimately doing nothing) until the upgrade was researched, but the validator doesnt seem to see that the upgrade is researched and just continues to remove and reapply (so i assume). clearly im doing something wrong somewhere.
@KingRadical: Go Yo do not need to create a loop to re-add the buff, first of all. The validator in the Disable field only disables it, not removes it. It's still technically on the unit, it just shouldn't come into effect. Also, it shouldn't be used to check on an upgrade. That is best left in a requirement.
You give your unit(s) each of the behaviors that coincide with an upgrade level.
Setup a Requirement and put that in the Behavior: Requirements+ field.
Your requirement(s) should look something like this when you are editing it in "tree" mode.
Requirement For the Default Behavior(+1/-1)(if it's always on at the start of the game)
(If it's not on right away, refer to the lvl2 requirement, adjust each CountUpgrade by -1 for the first level)
(This will disable the default/initial +1/-1 behavior when you upgrade to +2/-2)
Requirement for the 2nd Level(+2/-2)
(This will enable once you get +2/-2, and disable when you upgrade to +3/-3)
Any levels after this until the very last one should look like the above requirement, of course updating the Upgrade Count by +1 in each CountUpgrade
Requirement for the last Level(+5/-5)(or however high it goes)
Validators should be mostly used for things like "IsNotMoving" or "CasterHasEnergy"
@BorgDragon: Go
no good. made the requirements just like in your example, put them in the Behavior: Requirements+ field, and had my buildings start with the behaviors by putting them in the Behaviors: Behaviors+ and it didnt work. then i tried having a starting behavior that would apply the behaviors after a set time, still didnt work. the behaviors immediately increased the custom resource by 3 (there are 3 behaviors each with the "increase" and "decrease" effects of +/- 1).
@KingRadical: Go
Hmm, maybe instead of Show, try USE? And if you just use 3 separate behaviors with +/-1 Resource, you will also need to change the requirements. I thought you were going with Behavior 1 is set to +/-1 and Behavior 2 set to +/-2, hence the disabling of lower requirements once the next behavior is active.
No requirement on the first behavior, since it is likely standard/default to the unit(always +/-1 regardless of upgrades)
Requirements for #2 and #3.
@BorgDragon: Go
well what i originally wanted was ONE behavior with a +/-1 modify effect that had the EFFECT upgraded to then be a +/-2 by using the "Add" function of the upgrade, but it sounded like to upgrade the effects of a behavior i would need to create a new behavior (with the same +/-1 effect of the first behavior) and have it swap with the original behavior so the the upgrade function would take effect on previous and future buildings and change the original +/-1 modify effect of the behavior into a +/-2 modify.
but maybe i should stick with the 3 behaviors, each with the +/-1 modify effect, and sort them out like you just described above...
Edit: so i came up with a workaround... what i did was this.... my building takes 30 seconds to build, so i have a buff that lasts for 30 seconds and applies the first "tech level" modification when it expires (that way the resource isn't modified while the building is being constructed). this is where the work around comes in. my building also has 2 initial behaviors with a 0.5 duration and will apply the other 2 "tech level" modifications when removed. these 2 initial behaviors have the upgrade requirements and wont start their countdown until the upgrade is researched. (the original problem before with the 2 modify "tech level" behavior was even though they had the requirements to be disabled until the upgrade was researched, they would still apply the "tech level" modification without the upgrade).
now my future buildings AND my previous building will be affected and they will be affected properly. phew. Thank you both for your suggestions and help. I'm glad to say, this problem is solved :D