I have a Behavior that I set to a certain duration, and i was wondering if there is anyway I can create another ability that ADDS more duration to my other ability. Say its set to 30 seconds.. after casting the other ability it will be set to +35.
I don't think it's possible to do it directly, but you can do a workaround.
Ability A: The first ability
Ability B: The ability that adds duration
When the behaviour of A runs out you have it apply another behaviour that does the same thing and lasts as long as you specified in B. But you validate the effect with a behaviour stack validator. What are you going to validate? When the unit casts Ability B you add a dummy behaviour to it, with the duration of your choice. When validating you check if the number of behaviours of the dummy type is 1.
Ok, I think I could have said that better, but hopefully you get the idea.
I kinda understand What you are saying I will try to mess around with it , and come back if i still have questions :)
But a the problem with this is the effect is to kill the unit at 0... If i stack it will it add more time too ?
I didnt say to stack the behaviour. In this case, you add a set effect to the final effect of the behaviour. The set should do the following: Add a new behaviour to the unit if the validator returns true (1) and then kill the unit if there is no such behaviour on the unit.
If you do everything right you can add more time to the behaviour as often as you want.
Elaborating on Obatztrara's solution:
make sure you use a switch effect as the final effect on the behavior. The switch case should be validated by the dummy behavior and "fallthrough" should be unchecked. Then set the default effect in the switch to kill the unit.
When the first behavior duration ends it will run the switch effect. The switch will run the cases in order checking the validators on each case. The first validated case without fallthrough checked will end the switch. If none of the cases are validated, the default effect will process for the end of the switch.
I got it and all i did was create a duration behavior that checked to see if it was stacked and if it was stack not to go.... and i can just add as many to the unit. Thank you
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
I have a Behavior that I set to a certain duration, and i was wondering if there is anyway I can create another ability that ADDS more duration to my other ability. Say its set to 30 seconds.. after casting the other ability it will be set to +35.
Thank you :)
I don't think it's possible to do it directly, but you can do a workaround.
Ability A: The first ability Ability B: The ability that adds duration
When the behaviour of A runs out you have it apply another behaviour that does the same thing and lasts as long as you specified in B. But you validate the effect with a behaviour stack validator. What are you going to validate? When the unit casts Ability B you add a dummy behaviour to it, with the duration of your choice. When validating you check if the number of behaviours of the dummy type is 1.
Ok, I think I could have said that better, but hopefully you get the idea.
I kinda understand What you are saying I will try to mess around with it , and come back if i still have questions :) But a the problem with this is the effect is to kill the unit at 0... If i stack it will it add more time too ?
I didnt say to stack the behaviour. In this case, you add a set effect to the final effect of the behaviour. The set should do the following: Add a new behaviour to the unit if the validator returns true (1) and then kill the unit if there is no such behaviour on the unit.
If you do everything right you can add more time to the behaviour as often as you want.
Elaborating on Obatztrara's solution: make sure you use a switch effect as the final effect on the behavior. The switch case should be validated by the dummy behavior and "fallthrough" should be unchecked. Then set the default effect in the switch to kill the unit.
When the first behavior duration ends it will run the switch effect. The switch will run the cases in order checking the validators on each case. The first validated case without fallthrough checked will end the switch. If none of the cases are validated, the default effect will process for the end of the switch.
I got it and all i did was create a duration behavior that checked to see if it was stacked and if it was stack not to go.... and i can just add as many to the unit. Thank you