• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Help-dialog wont work!

Status
Not open for further replies.
Level 4
Joined
Jun 18, 2008
Messages
70
Hi. Im making a survival game. I made a dialog hero selection system,but it doesnt work. Here it is:


  • Events
    • Player - Player 1 (Red) types a chat message containing -dialog as An exact match
    • Conditions
    • Actions
      • Dialog - Create a dialog button for Dialog labelled Select your class.
      • Dialog - Create a dialog button for Dialog labelled Regular
      • Set DialogRegular= (Last created dialog Button)
      • Dialog - Create a dialog button for Dialog labelled DialogMechanic
      • Set DialogMechanic = (Last created dialog Button)
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
      • Dialog - Show Dialog for (Picked player)Dialog2

  • Events
    • Dialog - A dialog button is clicked for Dialog
    • Conditions
      • (Clicked dialog button) Equal to DialogRegular
    • Actions
      • Unit - Create 1 Regular for (Triggering player) at (Random point in (Playable map area)) facing Default building facing degreesDialogmechanic

  • Events
    • Dialog - A dialog button is clicked for Dialog
    • Conditions
      • (Clicked dialog button) Equal to DialogMechanic
    • Actions
      • Unit - Create 1 Mechanic for (Triggering player) at (Random point in (Playable map area)) facing Default building facing degrees
if any1 can help, please post here.
 
Last edited by a moderator:
Level 4
Joined
Jul 11, 2007
Messages
82
After you setup your dialog box with the buttons you need to use the Show Dialog action.
 
Level 4
Joined
Aug 14, 2007
Messages
66
When using dialog buttons and menus you generally need about 3 triggers to get it to work. The first trigger sets up the dialog (usually at initialization)

  • Dialog Setup
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Dialog - Change the title of mydialog to <Title of Dialog>
      • Dialog - Create a dialog button for mydialog labelled <Text on button>
      • Set mydialogbutton_yes = (Last created dialog Button)
Then you have the trigger for when the button is clicked on the dialog

  • my dialog clicked Yes
    • Events
      • Dialog - A dialog button is clicked for mydialog
    • Conditions
      • (Clicked dialog button) Equal to mydialogbutton_yes
    • Actions
      • -------- what you want as a result of clicked button --------
Then you need the trigger that makes the dialog show up giving the player the options on your dialog menu.

  • Untitled Trigger 003
    • Events
      • <your events>
    • Conditions
      • <your conditions>
    • Actions
      • Dialog - Show mydialog for Player 1 (Red)
If you were to create the buttons everytime you wanted to show the dialog then your dialog would build up a multitude of buttons adding new ones everytime it is shown. then it would make those buttons do nothing since your changing the variable for the button to another newly created button.

This would happen in your current trigger whenever player 1 types -dialog

instead make it so when player 1 types -dialog it only shows your dialog.

Also I see your using a button as the title currently, which you could just as easily be accomplished by changing the title of the dialog.

I should also mention you need to create a "Dialog" variable for the dialog and a "Dialog Button" variable for each of your buttons.

I cant remember whether or not dialogs automatically hide themselves when you push a button on a dialog but just in case add the Hide dialog after all the actions of your dialog button pushed trigger.

If they are hidden automatically then using a button as the title would cause it to close and the player would have nothing happen, so they wouldnt be able to select their class.
 
Level 4
Joined
Jun 18, 2008
Messages
70
ya nothing happens like u said at the last part!even if i type in -dialog nothin happens-is it because its hiding it?because at the end it says "show dialog for picked player"

ahhh! i jsut tried ur dialog-i did everything right-and it still wont work!!!!!!!!!!!!!!

ok so i did em all. after the 5 seconds are up, the screen freezes?is that cuz the dialog is invisible?

  • Events
    • Map initialization
    • Conditions
    • Actions
      • Dialog - Change the title of Dialog to Choose your soldier...
      • Dialog - Create a dialog button for Dialog labelled Mechanic
      • Set DialogMechanic = (Last created dialog Button)
      • Dialog - Create a dialog button for Dialog labelled Regular
      • Set DialogRegular = (Last created dialog Button)DialogMechanic
  • Events
    • Dialog - A dialog button is clicked for Dialog
    • Conditions
      • (Clicked dialog button) Equal to DialogMechanic
    • Actions
      • Unit - Create 1 Mechanic for (Triggering player) at ((Triggering player) start location) facing Default building facing degrees
  • DialogRegular
  • Events
    • Dialog - A dialog button is clicked for Dialog
    • Conditions
      • (Clicked dialog button) Equal to DialogRegular
    • Actions
      • Unit - Create 1 Regular for (Triggering player) at ((Triggering player) start location) facing Default building facing degrees
  • Showdialog

  • Events
    • Time - Elapsed game time is 5.00 seconds
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Dialog - Show Dialog for (Picked player)

and heres my variables

Name | Type | Initial value
Dialog | Dialog | new dialog
dialogmechanic | Dialog button | none
dialogregular | Dialog button | none

the screen freezes like theres a dialog there, cuz everything else is moving, and the other triggers work and keep goin.
 
Last edited by a moderator:
Level 4
Joined
Jun 18, 2008
Messages
70
it didnt work!!!!!!!!!!!!Dialog

Events
Time - Elapsed game time is 0.10 seconds
Conditions
Actions
Dialog - Change the title of Dialog to Choose your soldier...
Dialog - Create a dialog button for Dialog labelled Mechanic
Set DialogMechanic = (Last created dialog Button)
Dialog - Create a dialog button for Dialog labelled Regular
Set DialogRegular = (Last created dialog Button)
DialogMechanic

Events
Dialog - A dialog button is clicked for Dialog
Conditions
(Clicked dialog button) Equal to DialogMechanic
Actions
Unit - Create 1 Mechanic for (Triggering player) at ((Triggering player) start location) facing Default building facing degrees
DialogRegular
Events
Dialog - A dialog button is clicked for Dialog
Conditions
(Clicked dialog button) Equal to DialogRegular
Actions
Unit - Create 1 Regular for (Triggering player) at ((Triggering player) start location) facing Default building facing degrees
Showdialog

Events
Time - Elapsed game time is 0.50 seconds
Conditions
Actions
Dialog - Show Dialog for Player 1 (Red)
 
Level 17
Joined
May 6, 2008
Messages
1,598
You need to set the dialog variables in the same trigger as the dialog showing.

Also try putting clearing the dialog as the first action.
 
Level 4
Joined
Jun 18, 2008
Messages
70
hmmm....Ill try it.....so i would put


Events
Dialog - A dialog button is clicked for Dialog
Conditions
(Clicked dialog button) Equal to DialogMechanic
Actions
Unit - Create 1 Mechanic for (Triggering player) at ((Triggering player) start location) facing Default building facing degrees
Dialog - Show dialog for (picked player)
 
Level 4
Joined
Jun 18, 2008
Messages
70
yay!I got it working. I did this:



DialogMechanic
Events
Dialog - A dialog button is clicked for Dialog
Conditions
(Clicked dialog button) Equal to DialogMechanic
Actions
Unit - Create 1 Mechanic for (Triggering player) at ((Triggering player) start location) facing Default building facing degrees
Player Group - Pick every player in (All players matching (((Triggering player) is an enemy of Player 12 (Brown)) Equal to True)) and do (Actions)
Loop - Actions
Dialog - Show Dialog for (Matching player)
Dialog - Hide Dialog for (Matching player)
 
Level 3
Joined
Jun 14, 2008
Messages
34
-Player Group - Pick every player in (All players) and do (Actions)
-Loop - Actions
-Dialog - Show Dialog for (Picked player)Dialog2

That's your problem, you put the 'Show Dialog for (Picked player)' by itself, it has to be part of the 'Pick every player' I don't know how to put an image like all you guys did, if someone could tell me how, i could make my point in a less complicated way. Check the screen shots to see what I'm talking about.
Wrong! Wrong! on Flickr - Photo Sharing!
Right! Right! on Flickr - Photo Sharing!

By simply moving the 'Show Dialog' into the 'Pick every player' loop, it will now show your dialog to the picked player. If it doesn't work, then send me the map and I will personally spend MY time to fix all of it with the dialog.
With any dialog-related trigger, the very first action should be:

Dialog - Clear "Your dialog"
But that is true also, the very first thing MUST be 'Clear Dialog
 
Status
Not open for further replies.
Top