• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] Dialog System

Status
Not open for further replies.
Level 8
Joined
Sep 18, 2008
Messages
298
This is the initalizition for the dialog

Dialog Initialization
Events
Time - Elapsed game time is 1.00 seconds
Conditions
Actions
-------- Remove the following action when using the Dialog system --------
Player Group - Pick every player in (All players) and do (Actions)
Loop - Actions
Dialog - Hide Dialog for (Picked player)
-------- Remove the previous action when using the Dialog system --------
Dialog - Change the title of Dialog to Select your hero
Dialog - Create a dialog button for Dialog labelled Totem Master
Set DialogTotem = (Last created dialog Button)
Dialog - Create a dialog button for Dialog labelled Warlord
Set DialogWarlord = (Last created dialog Button)
Dialog - Create a dialog button for Dialog labelled Arthas
Set DialogArthas = (Last created dialog Button)
Dialog - Create a dialog button for Dialog labelled Skull Crusher
Set DialogHammer = (Last created dialog Button)
Player Group - Pick every player in (All players) and do (Actions)
Loop - Actions
Dialog - Show Dialog for (Picked player)
Trigger - Turn off (This trigger)


This is an example of a hero for orcs

Dialog Totem Master
Events
Dialog - A dialog button is clicked for Dialog
Conditions
((Triggering player) is an ally of Player 1 (Red)) Equal to True
(Clicked dialog button) Equal to DialogTotem
Actions
Unit - Create 1 Totem Master for (Triggering player) at (Center of Urlekk Spawn <gen>) facing Default building facing degrees
Camera - Pan camera for (Triggering player) to (Center of Urlekk Spawn <gen>) over 1.00 seconds


This is an example of a hero for the humans

Dialog Arthas
Events
Dialog - A dialog button is clicked for Dialog
Conditions
((Triggering player) is an ally of Player 4 (Purple)) Equal to True
(Clicked dialog button) Equal to DialogArthas
Actions
Unit - Create 1 Arthas (wielding Frostmourne) for (Triggering player) at (Center of Human Spawn <gen>) facing Default building facing degrees
Camera - Pan camera for (Triggering player) to (Center of Human Spawn <gen>) over 1.00 seconds
 
Level 16
Joined
Jul 21, 2008
Messages
1,121
Here is the example trigger:

  • Dialog Initialize
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • -------- This is simple dialog system --------
      • -------- Uses 2 dialog variables and several buttons --------
      • -------- You have to set opposing players in different player group variable --------
      • Player Group - Add Player 1 (Red) to Group1
      • Player Group - Add Player 2 (Blue) to Group1
      • Player Group - Add Player 3 (Teal) to Group2
      • Player Group - Add Player 4 (Purple) to Group2
      • -------- We will now create first dialog --------
      • Dialog - Change the title of Dialog1 to Dialog for Group 1
      • Dialog - Create a dialog button for Dialog1 labelled Hero 1
      • -------- I am using array in variable for dialog buttons --------
      • -------- So I can set more buttons in single variable --------
      • -------- Creating arrays is easy, just place tick in array field when creating new variable --------
      • -------- Now, set how many objects can array have in the next field named size --------
      • -------- Now, back to our dialog --------
      • Set Button[1] = (Last created dialog Button)
      • Dialog - Create a dialog button for Dialog1 labelled Hero 2
      • Set Button[2] = (Last created dialog Button)
      • -------- Notice changing of array index --------
      • -------- When dialog is done do this --------
      • Player Group - Pick every player in Group1 and do (Actions)
        • Loop - Actions
          • Dialog - Show Dialog1 for (Picked player)
      • -------- Now, creating next dialog will be piece of cake --------
      • Dialog - Change the title of Dialog2 to Dialog for Group 2
      • Dialog - Create a dialog button for Dialog2 labelled Hero 3
      • Set Button[3] = (Last created dialog Button)
      • Dialog - Create a dialog button for Dialog2 labelled Hero 4
      • Set Button[4] = (Last created dialog Button)
      • Player Group - Pick every player in Group2 and do (Actions)
        • Loop - Actions
          • Dialog - Show Dialog2 for (Picked player)
      • -------- Go to the next trigger :) --------
  • Dialog Picking
    • Events
      • Dialog - A dialog button is clicked for Dialog1
      • Dialog - A dialog button is clicked for Dialog2
    • Conditions
    • Actions
      • -------- We will make all picking in a single trigger --------
      • -------- In IF conditions I am using Dialog button comparison --------
      • -------- Don't forget which button is used to spawn certain hero --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to Button[1]
        • Then - Actions
          • -------- Points also leak and create lag --------
          • -------- We can remove it using single variable, TempPoint --------
          • Set TempPoint = (Center of (PickArea1))
          • Unit - Create 1 Archmage for (Triggering player) at TempPoint facing Default building facing degrees
          • -------- Use custom script function and type there text below --------
          • Custom script: call RemoveLocation(udg_TempPoint)
        • Else - Actions
      • -------- It is time to take care of other buttons --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to Button[2]
        • Then - Actions
          • Set TempPoint = (Center of (PickArea1))
          • Unit - Create 1 Paladin for (Triggering player) at TempPoint facing Default building facing degrees
          • Custom script: call RemoveLocation(udg_TempPoint)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to Button[3]
        • Then - Actions
          • Set TempPoint = (Center of (PickArea2))
          • Unit - Create 1 Mountain King for (Triggering player) at TempPoint facing Default building facing degrees
          • Custom script: call RemoveLocation(udg_TempPoint)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to Button[4]
        • Then - Actions
          • Set TempPoint = (Center of (PickArea2))
          • Unit - Create 1 Blood Mage for (Triggering player) at TempPoint facing Default building facing degrees
          • Custom script: call RemoveLocation(udg_TempPoint)
        • Else - Actions
It is a bit long, but I think it is useful.
 
Status
Not open for further replies.
Top