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
889
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
889
> 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.
  • WildTurkey WildTurkey:
    is there a stephen green in the house?
    +1
  • The Helper The Helper:
    What is up WildTurkey?
  • The Helper The Helper:
    Looks like Google fixed whatever mistake that made the recipes on the site go crazy and we are no longer trending towards a recipe site lol - I don't care though because it motivated me to spend alot of time on the site improving it and at least now the content people are looking at is not stupid and embarrassing like it was when I first got back into this like 5 years ago.
  • The Helper The Helper:
    Plus - I have a pretty bad ass recipe collection now! That section of the site is 10 thousand times better than it was before
  • The Helper The Helper:
    We now have a web designer at my job. A legit talented professional! I am going to get him to redesign the site theme. It is time.
  • Varine Varine:
    I got one more day of community service and then I'm free from this nonsense! I polished a cop car today for a funeral or something I guess
  • Varine Varine:
    They also were digging threw old shit at the sheriff's office and I tried to get them to give me the old electronic stuff, but they said no. They can't give it to people because they might use it to impersonate a cop or break into their network or some shit? idk but it was a shame to see them take a whole bunch of radios and shit to get shredded and landfilled
  • The Helper The Helper:
    whatever at least you are free
  • Monovertex Monovertex:
    How are you all? :D
    +1
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?

      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