• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Dialog is misbehaving

Status
Not open for further replies.
Level 8
Joined
Sep 15, 2006
Messages
426
I'm using a dialog in my map to let the players select their initial unit, but it's not doing anything when the dialog button gets clicked. Here's the trigger. Can anybody tell me what's not going right?

  • Display and Set Up Dialog
    • Events
      • Time - Elapsed game time is 0.10 seconds
    • Conditions
    • Actions
      • Player Group - Pick every player in (All allies of Player 1 (Red)) and do (Actions)
        • Loop - Actions
          • Dialog - Change the title of d_typeselect to Select Class
          • Dialog - Create a dialog button for d_typeselect labelled Select Grunt
          • Set db_grunt = (Last created dialog Button)
          • Dialog - Create a dialog button for d_typeselect labelled Select Sniper
          • Set db_sniper = (Last created dialog Button)
          • Dialog - Create a dialog button for d_typeselect labelled Select Parahacker
          • Set db_parahacker = (Last created dialog Button)
          • Dialog - Create a dialog button for d_typeselect labelled Select Seige Engine...
          • Set db_seigeeng = (Last created dialog Button)
          • Dialog - Show d_typeselect for (Picked player)
  • Click Grunt
    • Events
      • Dialog - A dialog button is clicked for d_typeselect
    • Conditions
      • (Clicked dialog button) Equal to db_grunt
    • Actions
      • Unit - Create 1 Grunt for (Triggering player) at (Center of Marine Start <gen>) facing Default building facing degrees
      • Hero - Create M7 Assault Rifle and give it to (Last created unit)
      • Dialog - Hide (Clicked dialog) for (Triggering player)
 
Level 6
Joined
Feb 2, 2005
Messages
205
I Think you messed up with the Player Group Loop, you will set those variables over and over for each player. Try this

  • Actions
  • Dialog - Change the title of d_typeselect to Select Class
  • Dialog - Create a dialog button for d_typeselect labelled Select Grunt
  • Set db_grunt = (Last created dialog Button)
  • Dialog - Create a dialog button for d_typeselect labelled Select Sniper
  • Set db_sniper = (Last created dialog Button)
  • Dialog - Create a dialog button for d_typeselect labelled Select Parahacker
  • Set db_parahacker = (Last created dialog Button)
  • Dialog - Create a dialog button for d_typeselect labelled Select Seige Engine...
  • Set db_seigeeng = (Last created dialog Button)
  • Player Group - Pick every player in (All allies of Player 1 (Red)) and do (Actions)
    • Loop - Actions
    • Dialog - Show d_typeselect for (Picked player)
And btw you have an typo its siege not seige :wink:
 
Level 5
Joined
Apr 12, 2007
Messages
158
You are using different variables for the dialog button. Make one variable with an amount of arrays that are equal to the amount of classes that your making since it is one dialog, therefore one dialog button variable. Re-do the set part for the dialog button with the array variable you have.

Example:
Dialog - Create a dialog button for d_typeselect labelled Select Sniper
Set db_class [2] = (Last created dialog Button)
Dialog - Create a dialog button for d_typeselect labelled Select Parahacker
Set db_class [3] = (Last created dialog button)
 
Last edited:
Level 8
Joined
Sep 15, 2006
Messages
426
Thanks. It works now. One more question, how would I go about making a system that wouldn't let a unit pick up an item if it already had certain items? (IE - unit picks up a gun, can't pick up another gun until it drops current one) I've made several failed attempts. Any help?
 
Level 8
Joined
Sep 15, 2006
Messages
426
No. In this situation I have a bunch of items that are weapons. I need the hero to be able to have one weapon at a time, and only one.
 
Level 5
Joined
Apr 12, 2007
Messages
158
So one weapon only. Well are all your weapons listed under one category like 'Miscellanous' or 'Campaign'?
 
Status
Not open for further replies.
Top