1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still haven't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. Rubbed the right way, the genie is out of its lamp! The 12th Concept Art Contest Results have been announced.
    Dismiss Notice
  4. Race against the odds and Reforge, Don't Refund. The 14th Techtree Contest has begun!
    Dismiss Notice
  5. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Unit Ping

Discussion in 'Triggers & Scripts' started by meeio87, Jun 9, 2009.

  1. meeio87

    meeio87

    Joined:
    Aug 14, 2006
    Messages:
    20
    Resources:
    0
    Resources:
    0
    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
     
  2. QueloR

    QueloR

    Joined:
    Jul 22, 2008
    Messages:
    241
    Resources:
    0
    Resources:
    0
    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
     
  3. Amigurumi

    Amigurumi

    Joined:
    Apr 7, 2008
    Messages:
    1,575
    Resources:
    45
    Models:
    27
    Icons:
    3
    Packs:
    3
    Maps:
    7
    Spells:
    4
    Tutorials:
    1
    Resources:
    45
    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
     
  4. Eleandor

    Eleandor

    Joined:
    Aug 21, 2005
    Messages:
    3,681
    Resources:
    2
    Models:
    1
    Tutorials:
    1
    Resources:
    2
    could be moved outside the group event, since it's independant of the picked unit.
     
  5. meeio87

    meeio87

    Joined:
    Aug 14, 2006
    Messages:
    20
    Resources:
    0
    Resources:
    0
    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
     
  6. QueloR

    QueloR

    Joined:
    Jul 22, 2008
    Messages:
    241
    Resources:
    0
    Resources:
    0
    The one I posted works for all types.
     
  7. Lord_BoNes

    Lord_BoNes

    Joined:
    Sep 5, 2007
    Messages:
    264
    Resources:
    0
    Resources:
    0
    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.
     
  8. L33T-ViV

    L33T-ViV

    Joined:
    Oct 22, 2008
    Messages:
    156
    Resources:
    0
    Resources:
    0
    Where i find the " Loop - Actions " ?
     
  9. QueloR

    QueloR

    Joined:
    Jul 22, 2008
    Messages:
    241
    Resources:
    0
    Resources:
    0
    The:
    • Unit Group - Pick every unit in TempGroup and do (Actions)

    Is the one making the loop in this case
     
  10. Amigurumi

    Amigurumi

    Joined:
    Apr 7, 2008
    Messages:
    1,575
    Resources:
    45
    Models:
    27
    Icons:
    3
    Packs:
    3
    Maps:
    7
    Spells:
    4
    Tutorials:
    1
    Resources:
    45
    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
     
  11. L33T-ViV

    L33T-ViV

    Joined:
    Oct 22, 2008
    Messages:
    156
    Resources:
    0
    Resources:
    0