THIS TRIGGER IS SOLVED AND AWESOME!
Heyhey. So I recently got my spell ressurection working properly as I wanted it.
It works as follows: Hero dies, A gravestone gets created at his dying point.
Then a healer class comes along and casts his aoe heal on the gravestone
and he revies fine and dandy where he should.
All good so far
But now I was planning on having a Dialog system aswell for the dying units.
So, A hero Dies, he gets a dialog box with 3 buttons - each button representing different locations where he might revive his hero.
So this is what I've got, this first trigger I borrowed from the spell "system". Cause it should apply to my dialog system aswell.
It's just so you will understand what the hell comes next
Then I have the init for dialog box:
Then I have a trigger: "hero dies, hero = hero and controlled by user, show dialog".
And then the actuall button click:
I will do the rest for the other locations later. But the problem is, That it works perectly ONE time. My hero dies, i click the "mountaint refuge" button, He gets revived where he should, I go and die with him again, click the same button. Now the really wierd part: He doesn't get revived, but the gravestone he left when dying gets removed as it should.
It sort of half-works haha.....
Any idéa why this is happening?
And also, if this will work with multiplayer?
Heyhey. So I recently got my spell ressurection working properly as I wanted it.
It works as follows: Hero dies, A gravestone gets created at his dying point.
Then a healer class comes along and casts his aoe heal on the gravestone
and he revies fine and dandy where he should.
All good so far
But now I was planning on having a Dialog system aswell for the dying units.
So, A hero Dies, he gets a dialog box with 3 buttons - each button representing different locations where he might revive his hero.
So this is what I've got, this first trigger I borrowed from the spell "system". Cause it should apply to my dialog system aswell.
It's just so you will understand what the hell comes next
Trigger:
- Events
- Unit - A unit Dies
- Conditions
- ((Dying unit) is A Hero) Equal to (==) True
- Actions
- Unit - Create 1 gravesten for (Owner of (Dying unit)) at (Position of (Dying unit)) facing Default building facing (270.0) degrees
- Set Gravestenarray[(Player number of (Owner of (Dying unit)))] = (Last created unit)
- Unit - Make (Last created unit) Invulnerable
- Unit - Turn collision for (Last created unit) Off
- Unit Group - Add (Dying unit) to unit_groupress[(Player number of (Owner of (Dying unit)))]
Then I have the init for dialog box:
Trigger:
- Events
- Time - Elapsed game time is 1.00 seconds
- Conditions
- Actions
- Dialog - Clear Ressurection_Dialog
- Dialog - Change the title of Ressurection_Dialog to Revive your Hero at:
- Dialog - Create a dialog button for Ressurection_Dialog labelled Mountain Refuge (St...
- Set MountainRess_Dialogbutton = (Last created dialog Button)
- Wait 0.30 seconds
- Dialog - Create a dialog button for Ressurection_Dialog labelled The Fallen Forest (...
- Set FallenForest_dialogbutton = (Last created dialog Button)
- Wait 0.30 seconds
- Dialog - Create a dialog button for Ressurection_Dialog labelled City of Edengard (H...
- Set City_of_Eden_Dialogbutton = (Last created dialog Button)
Then I have a trigger: "hero dies, hero = hero and controlled by user, show dialog".
And then the actuall button click:
Trigger:
- Events
- Dialog - A dialog button is clicked for Ressurection_Dialog
- Conditions
- (Clicked dialog button) Equal to (==) MountainRess_Dialogbutton
- Actions
- Unit Group - Pick every unit in unit_groupress[(Player number of (Triggering player))] and do (Hero - Instantly revive (Picked unit) at (Center of ress 1 <gen>), Show revival graphics)
- Selection - Select (Reviving Hero) for (Owner of (Reviving Hero))
- Unit - Remove Gravestenarray[(Player number of (Triggering player))] from the game
I will do the rest for the other locations later. But the problem is, That it works perectly ONE time. My hero dies, i click the "mountaint refuge" button, He gets revived where he should, I go and die with him again, click the same button. Now the really wierd part: He doesn't get revived, but the gravestone he left when dying gets removed as it should.
It sort of half-works haha.....
Any idéa why this is happening?
And also, if this will work with multiplayer?