If Condition then action1 or action2 Problem

Edy

You can change this now in User CP.
Reaction score
0
Everytime when i use this condition for anything it will trigger action2 anyway, even if the condition is turned to trigger the action1, what can i do to stop this?

Ex: If Clicked diolog button equal to Dialog_1 then do Unit - Add Spell1 to triggering unit else do Unit - Add spell2 to triggering unit

I dont even press the dialog button and the action2 is already made.
 

afisakov

You can change this now in User CP.
Reaction score
37
What is the event?
Are there other dialog buttons on your map, maybe that show up before the one and two you are trying to trigger from?

Fastest fix I can think of is:
If Clicked diolog button equal to Dialog_1 then do Unit - Add Spell1 to triggering unit else do Nothing
If Clicked diolog button equal to Dialog_2 then do Unit - Add Spell2 to triggering unit else do Nothing
It should prevent the problem for now, until you can find the true cause.
Takes a bit more space but I highly doubt that will be significant on a map.
 
  • Like
Reactions: Edy

Edy

You can change this now in User CP.
Reaction score
0
What is the event?
Are there other dialog buttons on your map, maybe that show up before the one and two you are trying to trigger from?

Fastest fix I can think of is:
If Clicked diolog button equal to Dialog_1 then do Unit - Add Spell1 to triggering unit else do Nothing
If Clicked diolog button equal to Dialog_2 then do Unit - Add Spell2 to triggering unit else do Nothing
It should prevent the problem for now, until you can find the true cause.
Takes a bit more space but I highly doubt that will be significant on a map.

still not working but here is the entire trigger

Events
Unit - A unit owned by Player 1 (Red) Gains a level
Conditions
Actions
Dialog - Change the title to Dialog1 to the 'Hero Culture'
Dialog - Create a dialog button for Dialog1 labelled Spell1
Set Dialog_Button[1] = (Last created dialog Button)
Dialog - Create a dialog button for Dialog1 labelled Spell2
Set Dialog_Button[2] = (Last created dialog Button)
Dialog - Show Dialog1 for Player 1 (Red)
If (Clicked dialog button) Equal to Dialog_Button[1] then do (Unit - Add Spell1 to (Triggering unit)) else do (Do nothing)
If (Clicked dialog button) Equal to Dialog_Button[2] then do (Unit - Add Spell2 to (Triggering unit)) else do (Do nothing)
Trigger - Turn off (This Trigger)
 

Solu9

You can change this now in User CP.
Reaction score
216
You need the "Click dialog" to be in a trigger for itself first of all. Because the If/then/else in your trigger refers to nothing since it is not a dialog button that is clicked, but a hero that gain a level.

Try to see if that alone works.

Edit:
Oh.
Trigger 1
Create the whole dialog with the buttons and all at the map initialization.

Trigger 2
When a hero gains a level show your dialog

Trigger 3
When a dialog button is clicked do something
 
  • Like
Reactions: Edy

Edy

You can change this now in User CP.
Reaction score
0
You need the "Click dialog" to be in a trigger for itself first of all. Because the If/then/else in your trigger refers to nothing since it is not a dialog button that is clicked, but a hero that gain a level.

Try to see if that alone works.

Edit:
Oh.
Trigger 1
Create the whole dialog with the buttons and all at the map initialization.

Trigger 2
When a hero gains a level show your dialog

Trigger 3
When a dialog button is clicked do something

i had to add the unit in a unit_variable to work for trigger 3, but now it works thx a lot mate
 
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