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

[Trigger] Condition

Status
Not open for further replies.
Level 5
Joined
Jan 5, 2019
Messages
108
Does someone know how to make a condition, If Picked Player chose a Hero and types -repick = Action ?
 
Level 15
Joined
Nov 30, 2007
Messages
1,202
  • CreateHero
    • Events
      • Game - SBM_event becomes Equal to 1.00
    • Conditions
      • SBM_menuKey Equal to heroMenu
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • SBM_event Equal to 1.00
        • Then - Actions
          • Set tempLoc = (Center of Spawn <gen>)
          • Unit - Create 1 heroType[SBM_customData] for SBM_player at tempLoc facing Default building facing degrees
          • Set Hero[(Player number of SBM_player)] = (Last created unit)
          • Custom script: call RemoveLocation(udg_tempLoc)
          • Trigger - Run CloseMenu <gen> (ignoring conditions)
          • Skip remaining actions
        • Else - Actions
  • Repick
    • Events
      • Player - Player 1 (Red) types a chat message containing -repick as An exact match
      • Player - Player 2 (Blue) types a chat message containing -repick as An exact match
      • Player - Player 3 (Teal) types a chat message containing -repick as An exact match
      • Player - Player 4 (Purple) types a chat message containing -repick as An exact match
      • Player - Player 5 (Yellow) types a chat message containing -repick as An exact match
      • Player - Player 6 (Orange) types a chat message containing -repick as An exact match
      • Player - Player 7 (Green) types a chat message containing -repick as An exact match
      • Player - Player 8 (Pink) types a chat message containing -repick as An exact match
      • Player - Player 9 (Gray) types a chat message containing -repick as An exact match
      • Player - Player 10 (Light Blue) types a chat message containing -repick as An exact match
      • Player - Player 11 (Dark Green) types a chat message containing -repick as An exact match
      • Player - Player 12 (Brown) types a chat message containing -repick as An exact match
      • Player - Player 13 (Maroon) types a chat message containing -repick as An exact match
      • Player - Player 14 (Navy) types a chat message containing -repick as An exact match
      • Player - Player 15 (Turquoise) types a chat message containing -repick as An exact match
      • Player - Player 16 (Violet) types a chat message containing -repick as An exact match
      • Player - Player 17 (Wheat) types a chat message containing -repick as An exact match
      • Player - Player 18 (Peach) types a chat message containing -repick as An exact match
      • Player - Player 19 (Mint) types a chat message containing -repick as An exact match
      • Player - Player 20 (Lavender) types a chat message containing -repick as An exact match
      • Player - Player 21 (Coal) types a chat message containing -repick as An exact match
      • Player - Player 22 (Snow) types a chat message containing -repick as An exact match
      • Player - Player 23 (Emerald) types a chat message containing -repick as An exact match
      • Player - Player 24 (Peanut) types a chat message containing -repick as An exact match
    • Conditions
      • Hero[(Player number of (Triggering player))] Not equal to No unit
    • Actions
      • Unit - Remove Hero[(Player number of (Triggering player))] from the game
      • Set SBM_player = (Triggering player)
      • Set SBM_GUI_menu = heroMenu
      • Trigger - Run OpenMenu <gen> (ignoring conditions)
You store the hero inside a variable and then check if there is any hero when repick is entered.
Basically this: hero[PlayernNumber(TriggerPlayer())] not equal to a unit, which means it exists then we execute the repick sequence.

I coppied this trigger from a map I just happend to have open right now, ignore the fluff. ^^
 
Status
Not open for further replies.
Top