I have a unit that has 7 buff spells to choose from. I need to know how i can set a cap on the unit allowing only 3 at one time. At this stage the unit can buff all 7 spells on himself at one time.
Only way I can think of is a rather large Use or Show requirement with Not followed by a load of Or nodes that lead to Ands that list any possible comination of Count Behavior for the 3 buffs.
You then put this requirement into all the abilities that add the buffs. This would disable them if the unit has three on at once.
I'd actually probably have a seperate hidden behavior that would be applied every time you applied a regular buff. This hidden behavior would act as a counter. All you would have to do then is have a validator and/or a requirement for each buff depending on what you are wanting it to do. The validator would obviously check to make sure your counter was less than 3, if its not then that buff you are trying to apply won't be applied (or your buttons wont show up depending on what you are wanting
You would of course need to figure out some way to remove the counter. Easiest thing would be a duration. Don't know if that works for you
Now if your wanting 3 buffs Max and the 4th buff applied knocks off the oldest buff thus keeping it at 3. Well that's a ton more complex. I wouldn't recommend that unless you were extremely comfortable with the data editor
I've been working on something like this but it just seems to be so tedious adding extra requirements (more than the buff has even) was looking for something a bit more compact.
@DeepStrike716
Thats a really good starting idea, will work on it further. In terms of adding a duration, how would i go about adding a timer onto the ability?
And thankgod i'm not looking for something that knocks off previous buffs ;P i'm creating a system where you need 3 buffs in order to cast particular spells. I do however need a plan to figure out how to remove the buffs after the spell has been cast.
If you want to set the duration of anybehavior, just go to the Stats - Duration field for that behavior.
As far as knocking off the "counter" behavior, that's easy. For every particular spell you want to cast just add an additional Remove Behavior effect to the end of the ability/effects. Obviously have it target the caster and remove 3 stacks.
Just to double check. Make sure you set the max count field on the counter behavior to 3.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
I have a unit that has 7 buff spells to choose from. I need to know how i can set a cap on the unit allowing only 3 at one time. At this stage the unit can buff all 7 spells on himself at one time.
Only way I can think of is a rather large Use or Show requirement with Not followed by a load of Or nodes that lead to Ands that list any possible comination of Count Behavior for the 3 buffs.
You then put this requirement into all the abilities that add the buffs. This would disable them if the unit has three on at once.
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
https://www.sc2mapster.com/forums/resources/tutorials/179654-data-actor-events-message-texture-select-by-id
https://media.forgecdn.net/attachments/187/40/Screenshot2011-04-17_09_16_21.jpg
@Playmo: Go
I'd actually probably have a seperate hidden behavior that would be applied every time you applied a regular buff. This hidden behavior would act as a counter. All you would have to do then is have a validator and/or a requirement for each buff depending on what you are wanting it to do. The validator would obviously check to make sure your counter was less than 3, if its not then that buff you are trying to apply won't be applied (or your buttons wont show up depending on what you are wanting
You would of course need to figure out some way to remove the counter. Easiest thing would be a duration. Don't know if that works for you
Now if your wanting 3 buffs Max and the 4th buff applied knocks off the oldest buff thus keeping it at 3. Well that's a ton more complex. I wouldn't recommend that unless you were extremely comfortable with the data editor
@DeepStrike716: Go
@ DrSuperEvil
I've been working on something like this but it just seems to be so tedious adding extra requirements (more than the buff has even) was looking for something a bit more compact.
@DeepStrike716
Thats a really good starting idea, will work on it further. In terms of adding a duration, how would i go about adding a timer onto the ability?
And thankgod i'm not looking for something that knocks off previous buffs ;P i'm creating a system where you need 3 buffs in order to cast particular spells. I do however need a plan to figure out how to remove the buffs after the spell has been cast.
@Playmo: Go
If you want to set the duration of anybehavior, just go to the Stats - Duration field for that behavior.
As far as knocking off the "counter" behavior, that's easy. For every particular spell you want to cast just add an additional Remove Behavior effect to the end of the ability/effects. Obviously have it target the caster and remove 3 stacks.
Just to double check. Make sure you set the max count field on the counter behavior to 3.