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

[Solved] Detect Building/Structure Menu Click

Status
Not open for further replies.
Level 5
Joined
Jan 23, 2020
Messages
86
I'd like to implement a paging system for multiple structures in the building selection on a worker unit.

I have two units, "Next page" and "Previous page"

When the units are selected/clicked in the build menu, it should change the buildings available for the triggering player.

ISSUE: The event "Game - Button for build Building Next pressed." only seems to work for one player (works 100% in single player), is there a way to get it to work for multiple players? Using something with LocalPlayer/TriggeringPlayer Custom Script.

  • Next Page
    • Events
      • Game - Button for build Building Next pressed.
    • Conditions
    • Actions
      • Set VariableSet PN = (Player number of (Triggering player))
      • Game - Force Builder[PN] to press Escape/Cancel
      • Unit - Order Player_Builder[PN] to Build.
      • -------- --------
      • Player - Make Building1Page1 Unavailable for training/construction by (Player(PN))
      • Player - Make Building2Page1 Unavailable for training/construction by (Player(PN))
      • Player - Make Building2Page1 Unavailable for training/construction by (Player(PN))
      • -------- --------
      • Player - Make Building Next Unavailable for training/construction by (Player(PN))
      • Player - Make Building Previous Available for training/construction by (Player(PN))
      • Player - Make Building1Page2 Available for training/construction by (Player(PN))

  • Prev Page
    • Events
      • Game - Button for build Building Previous pressed.
    • Conditions
    • Actions
      • Set VariableSet PN = (Player number of (Triggering player))
      • Game - Force (Player(PN)) to press Escape/Cancel
      • Unit - Order Player_Builder[PN] to Build.
      • -------- --------
      • Player - Make Building1Page1 Available for training/construction by (Player(PN))
      • Player - Make Building2Page1 Available for training/construction by (Player(PN))
      • Player - Make Building2Page1 Available for training/construction by (Player(PN))
      • -------- --------
      • Player - Make Building Previous Unavailable for training/construction by (Player(PN))
      • Player - Make Building Next Available for training/construction by (Player(PN))
      • Player - Make Building1Page2 Unavailable for training/construction by (Player(PN))

I know about the Bear Form and Spellbook tricks, but I'd much prefer this system.

Thx in advance!
 
Last edited:
Status
Not open for further replies.
Top