• 🏆 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!

How can I cut dialog button when clicked

Status
Not open for further replies.
Level 4
Joined
Mar 12, 2008
Messages
89
I have at start dialog button, People from it choosing race and I need when somebody chosen Night elf to button night elf dissapear, can somebody help me ? :(
 
Level 28
Joined
Mar 25, 2008
Messages
2,955
Make a boolean with an index for every race (I call it boolean_race[]).
Now, for the dialog, set the buttons like that
  • Actions
    • If boolean_race[0] = false then do: Dialog - Create a dialog button for *your dialog* titled *Race*
    • If boolean_race[1] = false then do: Dialog - Create a dialog button for *your dialog* titled *Race*
    • If boolean_race[2] = false then do: Dialog - Create a dialog button for *your dialog* titled *Race*
    • If boolean_race[3] = false then do: Dialog - Create a dialog button for *your dialog* titled *Race*
Now for the buttons, after peforming the actions after a button is clicked set the respective boolean to true
Like:
clicked dialog button == Button 1 -> set race_boolean[0] = true

Now if the boolean is set to true, the engine won't set up the dialogbutton ;)
 
Level 4
Joined
Mar 12, 2008
Messages
89
squiggy I think I am idiot or I don´t know .. that doesn´t work :((
can u write me whole the script ? :(
 
Last edited:
Level 4
Joined
Mar 12, 2008
Messages
89
The Code:

  • Events
  • Time - Elapsed game time is 5.00 seconds
  • Actions
  • Dialog - Clear DuchyCHoosedialog
  • Dialog - Change the title of DuchyCHoosedialog to Choose Duchy:
  • Dialog - Create a dialog button for DuchyCHoosedialog labelled England
  • Set DialogButton[1] = (Last created dialog Button)
  • Dialog - Create a dialog button for DuchyCHoosedialog labelled Normandy
  • Set DialogButton[2] = (Last created dialog Button)
  • Player Group - Pick every player in (All players) and do (Dialog - Show DuchyCHoosedialog for (Picked player))
variables = duchchoosedialog - dialog
dialigbutton - dialog button
now the trigger with england
  • Events
  • Dialog - A dialog button is clicked for DuchyCHoosedialog
  • Conditions
  • (Clicked dialog button) equal to DialogButton[1]
  • Actions
  • Game - Display to (All players) the text: England was picked
  • Unit - Create 1 Footman for (Triggering player) at (Center of zone 000 <gen>) facing Standart orientation of building degrees
 
Level 13
Joined
Sep 14, 2008
Messages
1,407
  • Events
  • Time - Elapsed game time is 5.00 seconds
  • Actions
  • Dialog - Clear DuchyCHoosedialog
  • Dialog - Change the title of DuchyCHoosedialog to Choose Duchy:
  • If - EnglandPicked = False
  • Dialog - Create a dialog button for DuchyCHoosedialog labelled England
  • Set DialogButton[1] = (Last created dialog Button)
  • If - NormandyPicked = False
  • Dialog - Create a dialog button for DuchyCHoosedialog labelled Normandy
  • Set DialogButton[2] = (Last created dialog Button)
  • Player Group - Pick every player in (All players) and do (Dialog - Show DuchyCHoosedialog for (Picked player))
I just edited your trigger... you know where to find if...(EnglandPicked and NormandyPicked are booleans)

Then you need another trigger:

  • Events
  • Dialog - A dialog button is clicked for DuchyCHoosedialog
  • Conditions
  • (Clicked dialog button) equal to DialogButton[1]
  • Actions
  • Game - Display to (All players) the text: England was picked
  • Set - EnglandPicked = True
  • Run trigger (the upper one, where the buttons are created)
  • Unit - Create 1 Footman for (Triggering player) at (Center of zone 000 <gen>) facing Standart orientation of building degrees
I think that should work...
Do the last trigger for every race
 
Level 4
Joined
Mar 12, 2008
Messages
89
hey ur idea sux, when play two players don´t sux when play one player I gave as attachment my map.. please rewrite buggs
 

Attachments

  • mapa1.w3x
    287 KB · Views: 33
Level 12
Joined
Apr 15, 2008
Messages
1,063
DarkAngelsAzalels idea was right, it just need a single fix:
Create initialization trigger, which creates a unit group.
  • Init Game
    • Events
      • Map Init
    • Actions
      • Set PlayerGroup = (All Players)
Then just remove players which choose race from the group
  • Button clicked
    • Events
      • Dialog Button Clicked
    • Actions
      • as above......
      • Player Group - Remove (Triggering player) from PlayerGroup
      • Trigger - run Init Dialog Trigger
And display the newly created dialog only to players that hasn't picked race already.
  • Init dialog
    • as above...
    • Player Group - Pick every player in PlayerGroup and do (Dialog - Show DuchyCHoosedialog for (Picked player))
 
Level 4
Joined
Mar 12, 2008
Messages
89
it now does who clicked first make him dialog again but if click on buttons no untis created..it is bug but it not sux... when player 1 picks holy roman empire it will dissapear huge moravia empire ...but not holy ro man empire .. I am attaching map..check it if I wrote it right please

EDIT:
hm can you help me ? :cry::cry:
 

Attachments

  • mapa1(2).w3x
    307.5 KB · Views: 52
Last edited by a moderator:
  • Angry
Reactions: Rui
Status
Not open for further replies.
Top