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

Team Position Trigger

Status
Not open for further replies.

xplicitjohn

X

xplicitjohn

If you ever played NoTD before you can type something like -tp and it will ping everyone's position to everyone in the minimap.

How do i make a trigger like that? I think you need like variable for player's position but i dont know how to do it :/
 
UnitArray should store be the "hero" or "marine" of each player.

  • Untitled Trigger 001
    • Events
      • Player - Player 1 (Red) types a chat message containing -tp as An exact match
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 10, do (Actions)
        • Loop - Actions
          • Set Point = (Position of UnitArray[(Integer A)])
          • Cinematic - Ping minimap for (Player group((Triggering player))) at Point for 1.00 seconds
          • Custom script: call RemoveLocation(udg_Point)
 

xplicitjohn

X

xplicitjohn

UnitArray should store be the "hero" or "marine" of each player.

  • Untitled Trigger 001
    • Events
      • Player - Player 1 (Red) types a chat message containing -tp as An exact match
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 10, do (Actions)
        • Loop - Actions
          • Set Point = (Position of UnitArray[(Integer A)])
          • Cinematic - Ping minimap for (Player group((Triggering player))) at Point for 1.00 seconds
          • Custom script: call RemoveLocation(udg_Point)

i dont get it
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
It's quite simple.

You have 2 variables in TriggerHappy's trigger:
- UnitArray.
Although the name of the variable could not be more obvious, I shall explain it: it is a variable with as type "unit" and it has an array.
- Point.
Also very obvious, it is a variable with as type "point" and does NOT have an array.

When a player chooses a unit/hero, you set that variable with as array the player number of the player who chose the unit/hero to the unit/hero he chose (complex sentence, I know).
A simple example:
set UnitArray[Player number of (Triggering Player)] = (last created unit).
Thus: you will store the unit inside a variable, every player will have its own hero stored inside this variable.

Then you literally do what TriggerHappy just did for you ^^
(The custom script and point are used to remove a leak, since leaks cause lag).

If you don't know what variables are (or how to use them correctly), or you're having problems with the loop, then you can ask us here.
 
Status
Not open for further replies.
Top