• 🏆 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] ESC Menu

Status
Not open for further replies.
Level 5
Joined
Dec 3, 2012
Messages
117
So, I want the players to be able to press ESC to get a Dialog menu, but for some reason it's only working for Red right now.

Heres my trigger:
  • Events
  • Player - Player 1 (Red) skips a cinematic sequence
  • Player - Player 2 (Blue) skips a cinematic sequence
  • Player - Player 3 (Teal) skips a cinematic sequence
  • Player - Player 4 (Purple) skips a cinematic sequence
  • Player - Player 5 (Yellow) skips a cinematic sequence
  • Player - Player 6 (Orange) skips a cinematic sequence
    • Conditions
    • Actions
  • Dialog - Clear DIAESC[(Player number of (Triggering player))]
  • Dialog - Change the title of DIAESC[(Player number of (Triggering player))] to Menu
  • -------- Learn Skills --------
  • Dialog - Create a dialog button for DIAESC[(Player number of (Triggering player))] labelled |cfff5f5f5Learn Ski...
  • Set DIAButtons[((Player number of (Triggering player)) + 6)] = (Last created dialog Button)
  • -------- Show SP & Job Lvl --------
  • Dialog - Create a dialog button for DIAESC[(Player number of (Triggering player))] labelled |cfff5f5f5Show SP &...
  • Set DIAButtons[((Player number of (Triggering player)) + 12)] = (Last created dialog Button)
  • -------- Cancel --------
  • Dialog - Create a dialog button for DIAESC[(Player number of (Triggering player))] labelled Cancel
  • Set DIAButtons[(Player number of (Triggering player))] = (Last created dialog Button)
  • Dialog - Show DIAESC[(Player number of (Triggering player))] for (Triggering player)
The events are in there for all players, yet it only works for Red. :(
 
Level 29
Joined
Oct 24, 2012
Messages
6,543
it looks like it should work. make sure in the variable editor that the variable is set to 19 not 1. Also whenever u use something more than twice put it in a temp variable and use that temp variable. for this case put player number of triggering player into a variable at the top and use that variable. when u need the + 6 and + 12 use the arithmetic and add them to ur temp integer for that.

also this will help u post triggers easier http://www.hiveworkshop.com/forums/miscellaneous-tutorials-456/how-easily-post-triggers-163285/
 
Level 5
Joined
Dec 3, 2012
Messages
117
Why I didn't put "Player Number of triggering player" in a temp variable is because I'm afraid of interference, I also use alot of "Player number of Owner of Triggering Unit" and "Player number of Owner of Casting Unit" If I'd put those in a temp variable then they might interrupt eachother if multiple players were to use those at the same time.

And what do you mean with setting the variable to 19? Which one?
 
Level 5
Joined
Dec 3, 2012
Messages
117
wc3 runs one thread from start to finish at a time so they cant interfere. also u should always use triggering unit and not casting unit or anything else unless necessary.

The DIAESC should be 7 and DIAButtons should be 19 in the variable editor.

Ha! DIAESC was 1, what a silly mistake. Thanks alot!

Also many thanks for the tips, especially on the "can't interfere" one!
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
The DIAESC should be 7 and DIAButtons should be 19 in the variable editor.

DIAButtons should be left at 1 since those are created with the GUI actions he uses. If the initial size is changed from 1 to 19, there will be 18 new leaks introduced.

Dialogs can't be created in GUI without custom scripts, that is why the DIAButtons should be set to max player number that is used.
 
Level 7
Joined
Jan 22, 2013
Messages
293
DIAButtons should be left at 1 since those are created with the GUI actions he uses. If the initial size is changed from 1 to 19, there will be 18 new leaks introduced.

Dialogs can't be created in GUI without custom scripts, that is why the DIAButtons should be set to max player number that is used.

GUI Dialogs are using just show/hide. there is no Create action for dialog. you just set everything up.

Maker is right though

Number of Dialogs = 1 for each player in the game
Number of Buttoms (Players * Buttons for each player just use an array) and that's just for one dialog feature <_> for all players.
 
Status
Not open for further replies.
Top