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

Unit Ping

Status
Not open for further replies.
Level 2
Joined
Aug 14, 2006
Messages
20
okay basically i need a trigger that will ping all units of a type lets say grunt. when a player says -grunt or something like that it will ping all the grunts. how do i do this i know you go into Cinematic but i don't know how to do it from there
 
Level 6
Joined
Jul 22, 2008
Messages
243
Not all to sure about this... But I'm guessing somewhat like this(May contain leaks!).

  • Ping
    • Events
      • Player - Player 1 (Red) types a chat message containing <Empty String> as A substring
    • Conditions
      • (Substring((Entered chat string), 1, 1)) Equal to -
    • Actions
      • Unit Group - Pick every unit in (Units of type (Unit-type((Substring((Entered chat string), 2, (Length of (Entered chat string))))))) and do (Actions)
        • Loop - Actions
          • Cinematic - Ping minimap for (Player group((Triggering player))) at (Position of (Picked unit)) for 1.00 seconds
 
Do it like QueloR, but leakless :p

  • Ping
    • Events
      • Player - Player 1 (Red) types a chat message containing -grunt as an exact match
    • Conditions
    • Actions
      • set TempGroup = Units of type (Grunt)
      • Unit Group - Pick every unit in TempGroup and do (Actions)
        • Loop - Actions
          • set TempPoint = Position of (Picked Unit)
          • set TempForce = Playergroup(Triggering player)
          • Cinematic - Ping minimap for TempForce at TempPoint for 1.00 seconds
          • call RemoveLocation(udg_TempPoint)
          • call DestroyForce(udg_TempForce)
      • call DestroyGroup(udg_TempGroup)
//Edit: TempGroup = Group variable
TempPoint = Point variable
TempForce = Playergroup variable
 
Level 2
Joined
Aug 14, 2006
Messages
20
ok thanks for the help but lets say i wanted to do it for both grunts and footmen, i just need the actions i got to events ok
 
Level 6
Joined
Sep 5, 2007
Messages
264
One problem I foresee with the above trigger is that it doesn't check to see if the units are owned by the correct player, it would ping any grunt, even under the fog-of-war. You need to use:
  • set TempGroup = Units Owned by player (player 1) of type (Grunt)
I hope this helps you figure it out :thumbs_up:

EDIT:
To add footmen, just use "Owned by player matching condition". Put an "AND" in there. In the first blank space, do a unit-type comparison and put in matching unit equal to grunt... for the second blank space, do matching unit equal to footman.
 
Level 6
Joined
Jul 22, 2008
Messages
243
The:
  • Unit Group - Pick every unit in TempGroup and do (Actions)
Is the one making the loop in this case
 
every action, that picks more than one unit/destructable, has a loop. you don't have to add it manually.
also For each integer has a loop.
  • Actions
    • For each Integer (A) - do Actions
      • Loop - Actions
    • Unit Group - Pick every unit (Owned by (Player 1 (Red))) and do Actions
      • Loop - Actions
  • ...
I did this without the we, but I think you get it
 
Status
Not open for further replies.
Top