• Check out the results of the Techtree Contest #19!
  • 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.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

[General] Chat message for changing units

yes it is possible
  • replace
    • Events
      • Player - Player 1 (Red) types a chat message containing -replace as An exact match
    • Conditions
    • Actions
      • Set VariableSet TempGroup = (Units currently selected by (Triggering player))
      • Unit Group - Pick every unit in TempGroup and do (Actions)
        • Loop - Actions
          • Set VariableSet TempUnit = (Picked unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Triggering unit) is A Hero) Equal to False
            • Then - Actions
              • Unit - Replace TempUnit with a Gryphon Rider using The old unit's relative life and mana
            • Else - Actions
 
  • Naga Dialog Setup
    • Events
      • Time - Elapsed game time is 0.50 seconds
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked player) controller) Equal to User
              • (Race of (Picked player)) Equal to Night Elf
            • Then - Actions
              • Set PN = (Player number of (Picked player))
              • -------- --------
              • Dialog - Clear Naga_Dialog[PN]
              • Dialog - Change the title of Naga_Dialog[PN] to Play as the Naga?
              • -------- --------
              • Dialog - Create a dialog button for Naga_Dialog[PN] labelled Yes
              • Set Naga_Dialog_Yes[PN] = (Last created dialog Button)
              • -------- --------
              • Dialog - Create a dialog button for Naga_Dialog[PN] labelled No
              • Set Naga_Dialog_No[PN] = (Last created dialog Button)
              • -------- --------
              • Dialog - Show Naga_Dialog[PN] for (Picked player)
            • Else - Actions
  • Naga Dialog Click
    • Events
      • Dialog - A dialog button is clicked for Naga_Dialog[1]
      • Dialog - A dialog button is clicked for Naga_Dialog[2]
      • Dialog - A dialog button is clicked for Naga_Dialog[3]
      • Dialog - A dialog button is clicked for Naga_Dialog[4]
      • Dialog - A dialog button is clicked for Naga_Dialog[5]
      • Dialog - A dialog button is clicked for Naga_Dialog[6]
      • Dialog - A dialog button is clicked for Naga_Dialog[7]
      • Dialog - A dialog button is clicked for Naga_Dialog[8]
      • Dialog - A dialog button is clicked for Naga_Dialog[9]
      • Dialog - A dialog button is clicked for Naga_Dialog[10]
      • Dialog - A dialog button is clicked for Naga_Dialog[11]
      • Dialog - A dialog button is clicked for Naga_Dialog[12]
    • Conditions
      • (Clicked dialog button) Equal to Naga_Dialog_Yes[(Player number of (Triggering player))]
    • Actions
      • Set Temp_Group = (Units owned by (Triggering player))
      • -------- --------
      • Unit Group - Pick every unit in Temp_Group and do (Actions)
        • Loop - Actions
          • Set Temp_Unit = (Picked unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of Temp_Unit) Equal to Wisp
            • Then - Actions
              • Unit - Replace Temp_Unit with a Mur'gul Slave using The old unit's relative life and mana
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Unit-type of Temp_Unit) Equal to Tree of Life
                • Then - Actions
                  • Set Temp_Point = (Position of Temp_Unit)
                  • Unit - Remove Temp_Unit from the game
                  • Unit - Create 1 Temple of Tides for (Owner of Temp_Unit) at Temp_Point facing Default building facing degrees
                  • Custom script: call RemoveLocation( udg_Temp_Point )
                • Else - Actions
      • -------- --------
      • Custom script: call DestroyGroup( udg_Temp_Group )
Actually i use this system in my map, it works in singleplayer well but in multiplayer the game won't show button to other player.
 
If targeting a reforged based version of Warcraft III I recommend trying to create some sort of UI for functionality rather than using chat messages. Chat messages are left over from the old days before new UI elements could be freely added to the screen.

As for parsing chat messages, you will need to describe how you imagine the command will work in game. For example would it be "-replace 3" or "-unit footman" or e.t.c. It is difficult for people to suggest how to implement such a command when they are unsure what exactly you are after.
 
Back
Top