Really wierd Dialog Problem!

Tooblet

Active Member
Reaction score
6
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 :p
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?
 

Ghan

Administrator - Servers are fun
Staff member
Reaction score
888
Why do you need to use a Unit Group? I would probably just use a Unit array. See if that works.
 

Ghan

Administrator - Servers are fun
Staff member
Reaction score
888
> Those 0.30 second waits aren't MUI so it wouldn't work in multiplayer (only the second trigger).

That really shouldn't make any difference considering the trigger doesn't use any player-specific actions and is only run once when the map starts up.
 

Tooblet

Active Member
Reaction score
6
> Why do you need to use a Unit Group?
Thats because Those variables are from a ressurection spell I made, and has to be that way. Thought I'd sort of combine the two "systems" instead of storing the same hero into 2 separate variables.

But still, If I would change it to simply a unit array, what difference would that make really? just curious :p

> Those 0.30 second waits aren't MUI so it wouldn't work in multiplayer (only the second trigger).

Well, It's the first time I'm dealing with dialogs. So I just thought I had to separate the "last created button" with a short wait.
But if I remove them, it will still work as it does now?


Still no idéa why it works fully first time, and then only half trigger works second time :/
 

HydraRancher

Truth begins in lies
Reaction score
197
[del]I dont know how your dialogs are working, you never show them o_O[/del]
[del]Ahh right you show them later.[/del]
No you dont :eek:. Where do you show your dialogs? Do you have any other triggers? we might need to see them
Note:Why not give tombstones locust?
 

Tooblet

Active Member
Reaction score
6
haha. I didn't post the trigger where I show the dialog.

But I did write: "Then I have a trigger: "unit dies, unit = hero and controlled by user, show dialog".

I WANT to have locust on tombstones. But if I have that, I can't use action: "kill - unit". And remove don't cut it for my Ressurection spell I have. So I need to kill the gravestones. Any idéa on how to work locust with a kill action? :p
 

Ryuu

I am back with Chocolate (:
Reaction score
64
> Any idéa on how to work locust with a kill action? :p

Play death animation on "Locust"-ed unit, and remove it.​
 

Tooblet

Active Member
Reaction score
6
lol, I don't need to see that it dies. I need to use the action - kill.
So I can have another trigger "when unit dies".
But ANYWAY.

The Locust thing is not the actual problem here!

I have a theory, that maybe it's the BUTTON that I click that only works one time?
Sort of like, i click it. then it's "used" and gone?

Anyways, I need it to work a million times and flawless :p
but then again, second time i click it it removes the gravestone..
but doesnt revive my hero.
 

Ryuu

I am back with Chocolate (:
Reaction score
64
For your last trigger:

Selection - Select (Reviving Hero) for (Owner of (Reviving Hero))

What does 'Reviving Hero' refers to?
 

Tooblet

Active Member
Reaction score
6
yeah i know, i removed that yesterday :)
Thanks for noticing though, see if u can find out some more glitches and bugs in it.
I'm not that good at triggering so I just make something just out of thought, then I refine my triggers and optimize them as good as I can.
But this one is not working properly yet even.
And I rly don't know why.
 

Ryuu

I am back with Chocolate (:
Reaction score
64
Try removing every unit in your unit group before you pick every unit in it.
 

Tooblet

Active Member
Reaction score
6
My Bad

Ok This is what I did that is working also with my Ressurection spell.

Unit Dies:
Trigger:
  • Events
    • Unit - A unit Dies
    • Conditions
      • ((Dying unit) is A Hero) Equal to (==) True
      • ((Owner of (Dying unit)) controller) Equal to (==) User
    • Actions
      • Set PlayerHero[(Player number of (Owner of (Dying unit)))] = (Dying unit)
      • 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
      • Dialog - Show Ressurection_Dialog for (Triggering player)


I changed the unitgroup to simply a unit Array, and it works fine with the spell aswell.. So now there's no leaks from "pick every unit in" either :)

This is the button click:
Trigger:
  • Events
    • Dialog - A dialog button is clicked for Ressurection_Dialog
    • Conditions
      • (Clicked dialog button) Equal to (==) MountainRess_Dialogbutton
    • Actions
      • Unit - Remove Gravestenarray[(Player number of (Triggering player))] from the game
      • Hero - Instantly revive PlayerHero[(Player number of (Triggering player))] at (Center of ress 1 <gen>), Show revival graphics


Works as a charm.

But I have a simple question. Will this work MUI and MPI?

As u saw before I set the dialog at 1.00 sec gametime.

EDIT: I actually have another question aswell :p For the locust on Gravestone. Is it possible to have the locust ability and actually kill the unit?
like if I add it on spawn or something wierd like that??
 

Ryuu

I am back with Chocolate (:
Reaction score
64
> Will this work MUI and MPI?

If I'm not wrong, it is MUI and MPI.​

> Is it possible to have the locust ability and actually kill the unit?

No. Unless you want the "animation tactic", I can't think of others. If you want to detect the the "Locust"-ed unit that is about to die (and couldn't die), just remove it and set a boolean to true.​

Oh and by the way, you have a leak on this line:

Code:
    * Events
          o Unit - A unit Dies
          o Conditions
                + ((Dying unit) is A Hero) Equal to (==) True
                + ((Owner of (Dying unit)) controller) Equal to (==) User
          o Actions
                + Set PlayerHero[(Player number of (Owner of (Dying unit)))] = (Dying unit)
                + [B]Unit - Create 1 gravesten for (Owner of (Dying unit)) at [COLOR="Red"](Position of (Dying unit))[/COLOR] facing Default building facing (270.0) degrees[/B]
                + 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
                + Dialog - Show Ressurection_Dialog for (Triggering player)

and this line:

Code:
    * Events
          o Dialog - A dialog button is clicked for Ressurection_Dialog
          o Conditions
                + (Clicked dialog button) Equal to (==) MountainRess_Dialogbutton
          o Actions
                + Unit - Remove Gravestenarray[(Player number of (Triggering player))] from the game
                +[B] Hero - Instantly revive PlayerHero[(Player number of (Triggering player))] at [COLOR="Red"](Center of ress 1 <gen>)[/COLOR], Show revival graphics[/B]
 

Tooblet

Active Member
Reaction score
6
Allright, then invulnerable gravestones will have to do.

Ok, I'll add some variables for those position and then call destroy(udg_variable).

is it remove or is it destroy?

I'm a bit unsure on those things where exactly to put the custom scripts to remove leaks.
I mean WHERE in the trigger.
just in general, I have a couple of leaks i'd like to get rid of but sometimes it makes the trigger broken.
 

Tooblet

Active Member
Reaction score
6
Ok so I made som a region variable array for the different places I wanna revive my heros, and also the point of created Gravestone.
Double Checking if this is the correct way to do stuff:

GravestoneVariable:
Trigger:
  • Events
    • Unit - A unit Dies
    • Conditions
      • ((Dying unit) is A Hero) Equal to (==) True
      • ((Owner of (Dying unit)) controller) Equal to (==) User
    • Actions
      • Set DyingHeroLocation = (Position of (Dying unit))
      • Set PlayerHero[(Player number of (Owner of (Dying unit)))] = (Dying unit)
      • Unit - Create 1 gravesten for (Owner of (Dying unit)) at DyingHeroLocation 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
      • Dialog - Show Ressurection_Dialog for (Triggering player)
      • Custom script: call RemoveLocation(udg_DyingHeroLocation)



And then The button click:
Trigger:
  • Events
    • Dialog - A dialog button is clicked for Ressurection_Dialog
    • Conditions
      • (Clicked dialog button) Equal to (==) MountainRess_Dialogbutton
    • Actions
      • Unit - Remove Gravestenarray[(Player number of (Triggering player))] from the game
      • Hero - Instantly revive PlayerHero[(Player number of (Triggering player))] at (Center of RessLocations[1]), Show revival graphics
      • Custom script: call RemoveRect(udg_RessLocations[1])
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top