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

[Spell] Reveal enemies while moving in a custom range

Level 11
Joined
Sep 11, 2013
Messages
325
Hi there!
I want to make a new item, but is seems very impossible to me:peasant-sad:..
The item description sound like this: When activated, this item will search for 10 seconds each second in 3000 range around you for enemies and will put a red ping on minimap on each enemy in that range. If you move in these 10 seconds the position of searching (3000 range) must update with your position and must red ping the new units (if there any) and will close the red ping for units that are no longer in your range. Also, when the spell start a green 360 grades green pings will show on minimap updating each second with your position and in the same time a special effect "TalkToMe.mdl" will fliker to your head each second until the spell end(10 seconds). (I think the spell must be MUI)

In my map I have 2 teams( team1 & team2 ) and i have 1 Player Group(PG) for team1 & 1 for team2. Also i have 1 Unit Group(UG) for team1 & 1 for team2.
I am still a noob with triggers, but here is what i've tried. (I know if shouldn't work, but i don't know how to fix that):peasant-shocked:..

The Help will be appreciated!:peasant-bowing:

  • Wraithwatcher Use
    • Events
      • Unit - A unit Uses an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Book of the Dead
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Owner of (Hero manipulating item)) is in PG_Team2.) Equal to True
        • Then - Actions
          • Set VariableSet UG_Wraithwatcher1 = (Units within 3000.00 of (Position of (Triggering unit)) matching (((Matching unit) belongs to an enemy of (Owner of (Triggering unit)).) Equal to True).)
          • Countdown Timer - Start PingTimer1Wraith as a One-shot timer that will expire in 10.00 seconds
          • Trigger - Turn on PingTeam1Wraith <gen>
          • Game - Display to (All players) the text: z1
        • Else - Actions
          • Set VariableSet UG_Wraithwatcher1 = (Units within 3000.00 of (Position of (Triggering unit)) matching (((Matching unit) belongs to an enemy of (Owner of (Triggering unit)).) Equal to True).)
          • Countdown Timer - Start PingTimer2Wraith as a One-shot timer that will expire in 10.00 seconds
          • Trigger - Turn on PingTeam2Wraith <gen>
          • Game - Display to (All players) the text: z2
  • PingTeam1Wraith
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Cinematic - Ping minimap for (Player group((Triggering player))) at ((Position of (Triggering unit)) offset by 3000.00 towards 0.00 degrees.) for 3.00 seconds, using a Simple ping of color (0.00%, 100.00%, 0.00%)
      • Cinematic - Ping minimap for (Player group((Triggering player))) at ((Position of (Triggering unit)) offset by 3000.00 towards 45.00 degrees.) for 3.00 seconds, using a Simple ping of color (0.00%, 100.00%, 0.00%)
      • Cinematic - Ping minimap for (Player group((Triggering player))) at ((Position of (Triggering unit)) offset by 3000.00 towards 90.00 degrees.) for 3.00 seconds, using a Simple ping of color (0.00%, 100.00%, 0.00%)
      • Cinematic - Ping minimap for (Player group((Triggering player))) at ((Position of (Triggering unit)) offset by 3000.00 towards 135.00 degrees.) for 3.00 seconds, using a Simple ping of color (0.00%, 100.00%, 0.00%)
      • Cinematic - Ping minimap for (Player group((Triggering player))) at ((Position of (Triggering unit)) offset by 3000.00 towards 180.00 degrees.) for 3.00 seconds, using a Simple ping of color (0.00%, 100.00%, 0.00%)
      • Cinematic - Ping minimap for (Player group((Triggering player))) at ((Position of (Triggering unit)) offset by 3000.00 towards 225.00 degrees.) for 3.00 seconds, using a Simple ping of color (0.00%, 100.00%, 0.00%)
      • Cinematic - Ping minimap for (Player group((Triggering player))) at ((Position of (Triggering unit)) offset by 3000.00 towards 270.00 degrees.) for 3.00 seconds, using a Simple ping of color (0.00%, 100.00%, 0.00%)
      • Cinematic - Ping minimap for (Player group((Triggering player))) at ((Position of (Triggering unit)) offset by 3000.00 towards 315.00 degrees.) for 3.00 seconds, using a Simple ping of color (0.00%, 100.00%, 0.00%)
      • Game - Display to (All players) the text: zzz1
      • Special Effect - Create a special effect attached to the overhead of (Triggering unit) using Abilities\Spells\Other\TalkToMe\TalkToMe.mdl
      • Special Effect - Destroy (Last created special effect)
      • Unit Group - Pick every unit in UG_Wraithwatcher1 and do (Actions)
        • Loop - Actions
          • Set VariableSet TempLoc6 = (Position of (Picked unit))
          • Cinematic - Ping minimap for PG_Team2 at TempLoc6 for 1.00 seconds, using a Simple ping of color (100.00%, 0.00%, 0.00%)
          • Custom script: call RemoveLocation(udg_TempLoc6)
  • PingTeam2Wraith
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Cinematic - Ping minimap for (Player group((Triggering player))) at ((Position of (Triggering unit)) offset by 3000.00 towards 0.00 degrees.) for 3.00 seconds, using a Simple ping of color (0.00%, 100.00%, 0.00%)
      • Cinematic - Ping minimap for (Player group((Triggering player))) at ((Position of (Triggering unit)) offset by 3000.00 towards 45.00 degrees.) for 3.00 seconds, using a Simple ping of color (0.00%, 100.00%, 0.00%)
      • Cinematic - Ping minimap for (Player group((Triggering player))) at ((Position of (Triggering unit)) offset by 3000.00 towards 90.00 degrees.) for 3.00 seconds, using a Simple ping of color (0.00%, 100.00%, 0.00%)
      • Cinematic - Ping minimap for (Player group((Triggering player))) at ((Position of (Triggering unit)) offset by 3000.00 towards 135.00 degrees.) for 3.00 seconds, using a Simple ping of color (0.00%, 100.00%, 0.00%)
      • Cinematic - Ping minimap for (Player group((Triggering player))) at ((Position of (Triggering unit)) offset by 3000.00 towards 180.00 degrees.) for 3.00 seconds, using a Simple ping of color (0.00%, 100.00%, 0.00%)
      • Cinematic - Ping minimap for (Player group((Triggering player))) at ((Position of (Triggering unit)) offset by 3000.00 towards 225.00 degrees.) for 3.00 seconds, using a Simple ping of color (0.00%, 100.00%, 0.00%)
      • Cinematic - Ping minimap for (Player group((Triggering player))) at ((Position of (Triggering unit)) offset by 3000.00 towards 270.00 degrees.) for 3.00 seconds, using a Simple ping of color (0.00%, 100.00%, 0.00%)
      • Cinematic - Ping minimap for (Player group((Triggering player))) at ((Position of (Triggering unit)) offset by 3000.00 towards 315.00 degrees.) for 3.00 seconds, using a Simple ping of color (0.00%, 100.00%, 0.00%)
      • Game - Display to (All players) the text: zzz2
      • Special Effect - Create a special effect attached to the overhead of (Triggering unit) using Abilities\Spells\Other\TalkToMe\TalkToMe.mdl
      • Special Effect - Destroy (Last created special effect)
      • Unit Group - Pick every unit in UG_Wraithwatcher1 and do (Actions)
        • Loop - Actions
          • Set VariableSet TempLoc6 = (Position of (Picked unit))
          • Cinematic - Ping minimap for PG_Team1 at TempLoc6 for 1.00 seconds, using a Simple ping of color (100.00%, 0.00%, 0.00%)
          • Custom script: call RemoveLocation(udg_TempLoc6)
  • PingTeam1TimerWraith expires
    • Events
      • Time - PingTimer1Wraith expires
    • Conditions
    • Actions
      • Trigger - Turn off PingTeam1Wraith <gen>
      • Game - Display to (All players) the text: turn off 1
  • PingTeam2TimerWraith expires
    • Events
      • Time - PingTimer2Wraith expires
    • Conditions
    • Actions
      • Trigger - Turn off PingTeam2Wraith <gen>
      • Game - Display to (All players) the text: turn off 2
 
Last edited:
Level 24
Joined
Jun 26, 2020
Messages
1,852
The main problem is in the timer triggers, (appart from the memory leaks) you are using:
(Player group((Triggering player))) at ((Position of (Triggering unit))
since the event is
Time - Every 1.00 seconds of game time
there are no Triggering player nor Triggering unit, you have to store them in a variable in your first trigger to use them in the timer triggers, but also you will need make it MUI, for that are tutorials and resources:
 
Last edited:

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,543
Hello, so I attached two maps, the first uses a system that I made called GST which helps make Timers in GUI more useful. The second does not use this system so it's more lightweight but also doesn't rely on Timers so it suffers from some imprecision. Both require Bribe's Unit Indexer (see Herly's link) but they can easily be repurposed to use something else - you just need some kind of unique integer ID on your Unit to allow it to be MUI.
 

Attachments

  • Radar Item 1.w3m
    39.9 KB · Views: 3
  • Radar Item 2 no gst.w3m
    27.1 KB · Views: 4
Last edited:
Level 11
Joined
Sep 11, 2013
Messages
325
Hello, so I attached two maps, the first uses a system that I made called GST which helps make Timers in GUI more useful. The second does not use this system so it's more lightweight but also doesn't rely on Timers so it suffers from some imprecision. Both require Bribe's Unit Indexer (see Herly's link) but they can easily be repurposed to use something else - you just need some kind of unique integer ID on your Unit to allow it to be MUI.
Thank you so much, Uncle!:peasant-thumbs-up:
I've tested both maps and I found few minor problems..:sad:
As you recommend me, I'll use the first map with GST.
1.I saw that if i put for example 2 heroes with same item in the map and if i activate both and there are more than 16 pings in the map, the rest of the pings dissapear.
2.After i active the item, there is a 1 second delay until pings arrived for the first time. It is possible to appear instantly at first?
3.What do you mean with "some imprecision"? I saw the position of enemy unit through pings is very few decalated from the original position.(I think you talk about that with "some imprecision", no?)
4.I suppose i just have to disable the pings in this action trigger because i don't need to ping my ally, no?
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Radar_Target belongs to an ally of Radar_Player.) Equal to True
    • Then - Actions
      • Cinematic - Ping minimap for Radar_Player_Group at Radar_Point[1] for 1.00 seconds, using a Simple ping of color (0.00%, 100.00%, 0.00%)
    • Else - Actions
      • Cinematic - Ping minimap for Radar_Player_Group at Radar_Point[1] for 1.00 seconds, using a Simple ping of color (100.00%, 0.00%, 0.00%)
5.How can i remove those 8 pings 360° around hero? I think this will be a problem with this limit of 16 pings that's why i want to remove this feature.
Is enough to delete this?
  • For each (Integer Radar_Loop) from 1 to 8, do (Actions)
    • Loop - Actions
      • Set VariableSet Radar_Point[1] = (Radar_Point[0] offset by Radar_Area_Of_Effect towards Radar_Degrees degrees.)
      • Cinematic - Ping minimap for Radar_Player_Group at Radar_Point[1] for 1.00 seconds, using a Simple ping of color (0.00%, 0.00%, 100.00%)
      • Custom script: call RemoveLocation( udg_Radar_Point[1] )
      • -------- --------
      • Set VariableSet Radar_Degrees = (Radar_Degrees + 45.00)


Thanks!:infl_thumbs_up:
 
Last edited:

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,543
Thank you so much, Uncle!:peasant-thumbs-up:
I've tested both maps and I found few minor problems..:sad:
As you recommend me, I'll use the first map with GST.
1.I saw that if i put for example 2 heroes with same item in the map and if i activate both and there are more than 16 pings in the map, the rest of the pings dissapear.
2.After i active the item, there is a 1 second delay until pings arrived for the first time. It is possible to appear instantly at first?
3.What do you mean with "some imprecision"? I saw the position of enemy unit through pings is very few decalated from the original position.(I think you talk about that with "some imprecision", no?)
4.I suppose i just have to disable the pings in this action trigger because i don't need to ping my ally, no?
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Radar_Target belongs to an ally of Radar_Player.) Equal to True
    • Then - Actions
      • Cinematic - Ping minimap for Radar_Player_Group at Radar_Point[1] for 1.00 seconds, using a Simple ping of color (0.00%, 100.00%, 0.00%)
    • Else - Actions
      • Cinematic - Ping minimap for Radar_Player_Group at Radar_Point[1] for 1.00 seconds, using a Simple ping of color (100.00%, 0.00%, 0.00%)
5.How can i remove those 8 pings 360° around hero? I think this will be a problem with this limit of 16 pings that's why i want to remove this feature.
Is enough to delete this?
  • For each (Integer Radar_Loop) from 1 to 8, do (Actions)
    • Loop - Actions
      • Set VariableSet Radar_Point[1] = (Radar_Point[0] offset by Radar_Area_Of_Effect towards Radar_Degrees degrees.)
      • Cinematic - Ping minimap for Radar_Player_Group at Radar_Point[1] for 1.00 seconds, using a Simple ping of color (0.00%, 0.00%, 100.00%)
      • Custom script: call RemoveLocation( udg_Radar_Point[1] )
      • -------- --------
      • Set VariableSet Radar_Degrees = (Radar_Degrees + 45.00)


Thanks!:infl_thumbs_up:
1. Warcraft 3 must have a hardcoded ping limit.
2. Yes, you just need to run the same logic used in the Interval trigger in response to using the item. (Adjust Event Responses/variables accordingly)
3. The GST system creates a brand new Timer each time you use the Radar. This timer is used exclusively by the unit that used the item which means that the timer can start and stop exactly when I tell it to. On the other hand, using a single trigger with a Periodic Interval of 1.00 second means that multiple units will be sharing the same periodic "timer" which leads to some imprecision. For instance, if you activate the Radar 0.10 seconds before the 1.00 second has passed then your next activation will come 0.10 seconds later rather than the full 1.00 second later.
4. You can delete the If Then Else and just use the enemy ping (red one).
5. Yes, you can just delete the For Loop.

Anyway, I fixed everything in this new map.
 

Attachments

  • Radar Item 1 less pings.w3m
    39.7 KB · Views: 1
Last edited:
Level 11
Joined
Sep 11, 2013
Messages
325
1. Warcraft 3 must have a hardcoded ping limit.
2. Yes, you just need to run the same logic used in the Interval trigger in response to using the item. (Adjust Event Responses/variables accordingly)
3. The GST system creates a brand new Timer each time you use the Radar. This timer is used exclusively by the unit that used the item which means that the timer can start and stop exactly when I tell it to. On the other hand, using a single trigger with a Periodic Interval of 1.00 second means that multiple units will be sharing the same periodic "timer" which leads to some imprecision. For instance, if for you activate the Radar 0.10 seconds before the 1.00 second has passed then your next activation will come 0.10 seconds later rather than the full 1.00 second later.
4. You can delete the If Then Else and just use the enemy ping (red one).
5. Yes, you can just delete the For Loop.

Anyway, I fixed everything in this new map.
Seems to work perfectly!:grin:
Thank you so much!
:peasant-thumbs-up:
 
Level 11
Joined
Sep 11, 2013
Messages
325
Anyway, I fixed everything in this new map.
Greetings again!
I wonder if is possible to change this item a little bit and how:confused:2

I have a better idea, but i don't know if that would work with your trigger..
It is possible to make this ability to detect only enemy units, but without buildings?

Also, as a bonus, is possible to make an exception in order to not detect 1 specific unit type?

Thank you for your patience, the help will be always appreciated!
 
Level 11
Joined
Sep 11, 2013
Messages
325
Yeah, add to the Conditions in the Pick Every Unit action. You can add your own Conditions to filter out what you want and don't want.
  • Unit Group - Pick every unit in Radar_Unit_Group and do (Actions)
    • Loop - Actions
      • Set VariableSet Radar_Target = (Picked unit)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Radar_Target is alive) Equal to True
          • (Radar_Target is A structure) Equal to False
          • (Radar_Target belongs to an enemy of Radar_Player.) Equal to True
        • Then - Actions
          • -------- Red ping on enemies: --------
          • Set VariableSet Radar_Point = (Position of Radar_Target)
          • Cinematic - Ping minimap for Radar_Player_Group at Radar_Point for 1.00 seconds, using a Simple ping of color (100.00%, 0.00%, 0.00%)
          • Custom script: call RemoveLocation( udg_Radar_Point )
        • Else - Actions
Like this? ((Radar_Target is A structure) Equal to False) And how can i add an exception for some unit type because Radar_Target is a variable unit, not unit type..? :peasant-shocked:
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,543
  • Unit Group - Pick every unit in Radar_Unit_Group and do (Actions)
    • Loop - Actions
      • Set VariableSet Radar_Target = (Picked unit)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Radar_Target is alive) Equal to True
          • (Radar_Target is A structure) Equal to False
          • (Radar_Target belongs to an enemy of Radar_Player.) Equal to True
        • Then - Actions
          • -------- Red ping on enemies: --------
          • Set VariableSet Radar_Point = (Position of Radar_Target)
          • Cinematic - Ping minimap for Radar_Player_Group at Radar_Point for 1.00 seconds, using a Simple ping of color (100.00%, 0.00%, 0.00%)
          • Custom script: call RemoveLocation( udg_Radar_Point )
        • Else - Actions
Like this? ((Radar_Target is A structure) Equal to False) And how can i add an exception for some unit type because Radar_Target is a variable unit, not unit type..? :peasant-shocked:
This line already excludes Structures so they shouldn't be getting pinged:
  • Radar_Target is A structure) Equal to False
You can get the Unit-type of a Unit:
  • (Unit-type of Radar Target) Not equal to Peon
Always check the Condition category related to what you're looking for. If you're trying to check a Unit-Type then it'll be under the Unit Type Comparison category. Then look for a function that sounds like it does what you need, there's almost always an option.
 
Level 11
Joined
Sep 11, 2013
Messages
325
This line already excludes Structures so they shouldn't be getting pinged:
  • Radar_Target is A structure) Equal to False
You can get the Unit-type of a Unit:
  • (Unit-type of Radar Target) Not equal to Peon
Oh:peasant-victory:That is very smart! I didn't know that trick! Thank you, i'll go to test it now!

Edit:Seems to work perfect, again! :peasant-thumbs-up:
 
Last edited:
Top