Hello everyone. I'm at my wits end here because I cannot for the life of me figure this out. I'll try to explain my problem the best that I can. I have an attribute system that you can put points into. The menu is created through triggers, there's little buttons to add the point into the attribute you wish to increase. I have a variable for each stat that counts how many "bonus points" have gone into that attribute. Visualize something like Diablo 2 had. Thus far it works perfect.
The attributes are a stackable "buff" behavior that links to an "attribute" behavior. Again so far, great!
The issue is, after the hero dies, the behavior stacks are lost on death which is an issue I was well aware of, hence the reason I stored how many points were put in. But for some reason, I cannot get the behaviors to reapply to the hero. Whichever buff was applied to the hero before it dies, never works again. I am using Revive Insantly as soon as he dies so he is never lost. The action I use is:
Unit - Add Bonus-Endurance[i] Endurance-Add to HeroUnit[i] from player i
i = Trigger player ,
Bonus-Endurance = number of points put in ,
Endrance-Add = buff that links to attribute
After the hero dies, adding the behavior just seems to stop working on it completely if he had the behavior when dying. I even tried removing all of the behaviors he had on death. Even trying to add further points from the menu stops to work. If one of the attributes was not applied before dying, it works from the menu. I just don't understand... I think I found some kind of bug.
I checked to see if the number of Bonus Points somehow became 0, nope its all there. I checked to see if HeroUnit is somehow null, nope its pointing to the right place. Everything is being tracked correctly, the action is just not working for some reason. The fault either lies in the add behavior action, or theres a problem with my buff behaviors that I am missing.
Any help would be greatly appreciated before i lose my mind over this!
I could never get the internal revive system to work, so bear with me.
But it seems to me if, after the unit is "killed", move it instantly, restore all it's health, and then "revive" wherever, that could solve this problem.
Rollback Post to RevisionRollBack
I am largely inactive, but I am still around. Feel free to poke me if you need some help, just be warned that I only really come back if I need help and/or if I'm posting a new map/library.
I just ended up giving heroes the Valerian02a - Incapacitated behavior and setting its duration to 1. Then set up a trigger to detect the behavior happening, then did my normal resurrection trigger. This has the disadvantage of the unit not showing his death effect, but I'll work around that later on.
But yeah, I'm confident by now that adding behaviors through triggers bugs out if the unit died with the behavior you are trying to re-add.
Hmm I've had trouble with the same issue before of these add-attribute behaviors not being preserved after a unit has died and been revived.
So far my method has been to know the exact impact of each attribute and then use that to calculate how many add-attributes to add on when the unit is revived. With an attribute like "CNST" which confers 1 point of health per 1 point of CNST, I tally up the max health of the unit before it dies and then whatever the difference is after I add on via the add-attribute behavior. But I haven't run into any issues with the behaviors themselves not being re-added by the trigger. I'll look into it more if indeed there is a possibility for this error.
Hello everyone. I'm at my wits end here because I cannot for the life of me figure this out. I'll try to explain my problem the best that I can. I have an attribute system that you can put points into. The menu is created through triggers, there's little buttons to add the point into the attribute you wish to increase. I have a variable for each stat that counts how many "bonus points" have gone into that attribute. Visualize something like Diablo 2 had. Thus far it works perfect.
The attributes are a stackable "buff" behavior that links to an "attribute" behavior. Again so far, great!
The issue is, after the hero dies, the behavior stacks are lost on death which is an issue I was well aware of, hence the reason I stored how many points were put in. But for some reason, I cannot get the behaviors to reapply to the hero. Whichever buff was applied to the hero before it dies, never works again. I am using Revive Insantly as soon as he dies so he is never lost. The action I use is:
Unit - Add Bonus-Endurance[i] Endurance-Add to HeroUnit[i] from player i
i = Trigger player , Bonus-Endurance = number of points put in , Endrance-Add = buff that links to attribute
After the hero dies, adding the behavior just seems to stop working on it completely if he had the behavior when dying. I even tried removing all of the behaviors he had on death. Even trying to add further points from the menu stops to work. If one of the attributes was not applied before dying, it works from the menu. I just don't understand... I think I found some kind of bug.
I checked to see if the number of Bonus Points somehow became 0, nope its all there. I checked to see if HeroUnit is somehow null, nope its pointing to the right place. Everything is being tracked correctly, the action is just not working for some reason. The fault either lies in the add behavior action, or theres a problem with my buff behaviors that I am missing.
Any help would be greatly appreciated before i lose my mind over this!
When the Hero revives you can set the Behaviors by adding the Behavior the same amount of times as equal to the Attribute Variable.
Example:
Events
Unit - Any Unit is revived
Conditions
((Triggering unit) is Required: Heroic; Excluded: Missile, Dead, Hidden for player (Owner of (Triggering unit))) == True
Actions
Unit - Add Attribute1 Behavior to (Triggering unit) from Caster
I haven't tried this but it should work since its adding a Behavior to the unit that was revived as many times as the Attribute1 Variable is equal to.
As always you can modify this to your liking and if you have any questions then please message me so we can go over it more accurately.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Hello everyone. I'm at my wits end here because I cannot for the life of me figure this out. I'll try to explain my problem the best that I can. I have an attribute system that you can put points into. The menu is created through triggers, there's little buttons to add the point into the attribute you wish to increase. I have a variable for each stat that counts how many "bonus points" have gone into that attribute. Visualize something like Diablo 2 had. Thus far it works perfect.
The attributes are a stackable "buff" behavior that links to an "attribute" behavior. Again so far, great!
The issue is, after the hero dies, the behavior stacks are lost on death which is an issue I was well aware of, hence the reason I stored how many points were put in. But for some reason, I cannot get the behaviors to reapply to the hero. Whichever buff was applied to the hero before it dies, never works again. I am using Revive Insantly as soon as he dies so he is never lost. The action I use is:
Unit - Add Bonus-Endurance[i] Endurance-Add to HeroUnit[i] from player i
i = Trigger player , Bonus-Endurance = number of points put in , Endrance-Add = buff that links to attribute
After the hero dies, adding the behavior just seems to stop working on it completely if he had the behavior when dying. I even tried removing all of the behaviors he had on death. Even trying to add further points from the menu stops to work. If one of the attributes was not applied before dying, it works from the menu. I just don't understand... I think I found some kind of bug.
I checked to see if the number of Bonus Points somehow became 0, nope its all there. I checked to see if HeroUnit is somehow null, nope its pointing to the right place. Everything is being tracked correctly, the action is just not working for some reason. The fault either lies in the add behavior action, or theres a problem with my buff behaviors that I am missing.
Any help would be greatly appreciated before i lose my mind over this!
@strongfoe: Go
I could never get the internal revive system to work, so bear with me.
But it seems to me if, after the unit is "killed", move it instantly, restore all it's health, and then "revive" wherever, that could solve this problem.
I just ended up giving heroes the Valerian02a - Incapacitated behavior and setting its duration to 1. Then set up a trigger to detect the behavior happening, then did my normal resurrection trigger. This has the disadvantage of the unit not showing his death effect, but I'll work around that later on.
But yeah, I'm confident by now that adding behaviors through triggers bugs out if the unit died with the behavior you are trying to re-add.
@strongfoe: Go
Hmm I've had trouble with the same issue before of these add-attribute behaviors not being preserved after a unit has died and been revived.
So far my method has been to know the exact impact of each attribute and then use that to calculate how many add-attributes to add on when the unit is revived. With an attribute like "CNST" which confers 1 point of health per 1 point of CNST, I tally up the max health of the unit before it dies and then whatever the difference is after I add on via the add-attribute behavior. But I haven't run into any issues with the behaviors themselves not being re-added by the trigger. I'll look into it more if indeed there is a possibility for this error.
When the Hero revives you can set the Behaviors by adding the Behavior the same amount of times as equal to the Attribute Variable.
Example:
Events
Unit - Any Unit is revived
Conditions
((Triggering unit) is Required: Heroic; Excluded: Missile, Dead, Hidden for player (Owner of (Triggering unit))) == True
Actions
Unit - Add Attribute1 Behavior to (Triggering unit) from Caster
I haven't tried this but it should work since its adding a Behavior to the unit that was revived as many times as the Attribute1 Variable is equal to. As always you can modify this to your liking and if you have any questions then please message me so we can go over it more accurately.