Trigger: Detect Level Up
Event: Any unit gain exp level
Action:
Create a Modal dialog
Set title = "Level Up"
Create button "Stamina"
Set Stamina = Last created dialog item
Create button "Strength"
Set Strength = Last created dialog item
Create button "Agility"
Set Agility = Last created dialog item
Create button "Intellect"
Set Intellect = Last created dialog item
Show last created dialog for Group of (Triggering Player)
Trigger: Menu button selected
Event: Any dialog item is used by Group of Player 1 type Clicked
Actions:
Switch (Used Dialog Item)
Case Stamina
Add 1 Stamina behavior to Triggering Unit from Triggering Unit
Case Strength
Add 1 Strength behavior to Triggering Unit from Triggering Unit
Case Agility
Add 1 Agility behavior to Triggering Unit from Triggering Unit
Case Intellect
Add 1 Intellect behavior to Triggering Unit from Triggering Unit
Dialog - Hide Last Created Dialog for All Players
Is the event in the 2nd trigger the correct way to detect when a button is pressed?
I did not see a Any Player function listed like shown in all the guides I seen that says set this to "Event - Any dialog item is used by Any Player type clicked"
Been struggling with this one trigger for over an hour.
Action
Unit Selection - Select Warp Prism (Phasing Mode) [186.27, 86.96] for player 1
I think what you are missing is the condition.
You should also use a variable to store your dialog itself btw, using "last created" will bring you problems in the end.
In your Action Triggering Unit doesent work because there is NO Unit that triggers the Dialog item only the Player can use Dialogitems :)
So you need to specify your Unit with a Variable or directly. And replace the "Triggering Unit" with the UnitVar or the Unit itself:)
What is the exact options I need to choose to create this event?
Event: Dialog - Any Dialog Item is used by Player Any Player with event type Clicked
I am not finding the Any Player in Function section or Preset section.
Was it listed in the Beta editor and not in the Current version?
A lot of the guides I've seen with pictures look different to the editor I have.
Edit:
Just copied the event from the Lost Viking arcade map from the campaign. I must be blind, no clue where the Any Player thing is at.
Think I'm understanding how dialog menus work now after viewing Blizzard's dialog code in the map.
I looked at my own data to try and understand, and weirdly, I couldn't _find_ Any Player either. HOWEVER, when you first create that event type, it defaults to Any Player... so just recreate the event? :)
It is a little odd.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Here is my code:
Global variables:
Stamina [Dialog Item]
Strength [Dialog Item]
Agility [Dialog Item]
Intellect [Dialog Item]
Trigger: Detect Level Up
Event: Any unit gain exp level
Action:
Create a Modal dialog
Set title = "Level Up"
Create button "Stamina"
Set Stamina = Last created dialog item
Create button "Strength"
Set Strength = Last created dialog item
Create button "Agility"
Set Agility = Last created dialog item
Create button "Intellect"
Set Intellect = Last created dialog item
Show last created dialog for Group of (Triggering Player)
Trigger: Menu button selected
Event: Any dialog item is used by Group of Player 1 type Clicked
Actions:
Switch (Used Dialog Item)
Case Stamina
Add 1 Stamina behavior to Triggering Unit from Triggering Unit
Case Strength
Add 1 Strength behavior to Triggering Unit from Triggering Unit
Case Agility
Add 1 Agility behavior to Triggering Unit from Triggering Unit
Case Intellect
Add 1 Intellect behavior to Triggering Unit from Triggering Unit
Dialog - Hide Last Created Dialog for All Players
Is the event in the 2nd trigger the correct way to detect when a button is pressed?
I did not see a Any Player function listed like shown in all the guides I seen that says set this to "Event - Any dialog item is used by Any Player type clicked"
Been struggling with this one trigger for over an hour.
@redconfusion: Go
edit: sorry i misread your post ignore what i said if you read it...
This is a trigger that works.
Event Dialog - Any Dialog Item is used by Player Any Player with event type Clicked
Conditions (Used dialog item) == [Your Button Variable]
Action Unit Selection - Select Warp Prism (Phasing Mode) [186.27, 86.96] for player 1
I think what you are missing is the condition. You should also use a variable to store your dialog itself btw, using "last created" will bring you problems in the end.
In your Action Triggering Unit doesent work because there is NO Unit that triggers the Dialog item only the Player can use Dialogitems :) So you need to specify your Unit with a Variable or directly. And replace the "Triggering Unit" with the UnitVar or the Unit itself:)
What is the exact options I need to choose to create this event?
Event: Dialog - Any Dialog Item is used by Player Any Player with event type Clicked
I am not finding the Any Player in Function section or Preset section.
Was it listed in the Beta editor and not in the Current version?
A lot of the guides I've seen with pictures look different to the editor I have.
Edit:
Just copied the event from the Lost Viking arcade map from the campaign. I must be blind, no clue where the Any Player thing is at.
Think I'm understanding how dialog menus work now after viewing Blizzard's dialog code in the map.
@redconfusion: Go
I looked at my own data to try and understand, and weirdly, I couldn't _find_ Any Player either. HOWEVER, when you first create that event type, it defaults to Any Player... so just recreate the event? :)
It is a little odd.