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

[Trigger] Wake Up!

Status
Not open for further replies.
Level 6
Joined
Jan 31, 2014
Messages
67
I'm trying to make something like - you go near a sleeping unit , no matter where it is , or what unit it is. And if I as unit come in range of like 200 that unit wakes up , but not the sleeping unit which is near it.
With one unit it works , but I want to make with every unit on the map and that all this process just take up like one , two , max three triggers .
Is it possible .If Yes , can you help me?
 
Level 12
Joined
Feb 22, 2010
Messages
1,115
Maybe show us how you did this for one unit, and we can continue from there.
 
Level 6
Joined
Jan 31, 2014
Messages
67
Something like that

Maybe show us how you did this for one unit, and we can continue from there.

Setting up
Wake Up
Events
Unit - A unit comes within 220.00 of Spider <gen>
Conditions
(Owner of (Triggering unit)) Equal to Player 12 (Brown)
Actions
Unit - Wake up Spider


Something like that ...With one it works , but I don't want to make over 20 same triggers...
 
Level 25
Joined
May 11, 2007
Messages
4,651
If the units that are sleeping are placed from the beginning of the map, this could work for ya:

  • Init sleepers
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Set tempGroup1 = (Units owned by Neutral Hostile)
      • Unit Group - Pick every unit in tempGroup1 and do (Actions)
        • Loop - Actions
          • Trigger - Add to wake me up <gen> the event (Unit - A unit comes within 200.00 of (Picked unit))
      • Custom script: call DestroyGroup(udg_tempGroup1)
  • wake me up
    • Events
    • Conditions
    • Actions
      • -------- Since there is no "sleeping unit" we check all nearby neutral hostile units that are around the position of the triggering unit --------
      • Set tempPoint1 = (Position of (Triggering unit))
      • Set tempGroup1 = (Units within 200.00 of tempPoint1 matching ((Owner of (Matching unit)) Equal to Neutral Hostile))
      • Unit Group - Pick every unit in tempGroup1 and do (Actions)
        • Loop - Actions
          • Unit - Wake up (Picked unit)
      • -------- Make sure you remove the leaks or this is gonna lag --------
      • Custom script: call RemoveLocation(udg_tempPoint1)
      • Custom script: call DestroyGroup(udg_tempGroup1)
 

Attachments

  • help_sleepingGiant.w3x
    13.6 KB · Views: 86
Level 6
Joined
Jan 31, 2014
Messages
67
If the units that are sleeping are placed from the beginning of the map, this could work for ya:

  • Init sleepers
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Set tempGroup1 = (Units owned by Neutral Hostile)
      • Unit Group - Pick every unit in tempGroup1 and do (Actions)
        • Loop - Actions
          • Trigger - Add to wake me up <gen> the event (Unit - A unit comes within 200.00 of (Picked unit))
      • Custom script: call DestroyGroup(udg_tempGroup1)
  • wake me up
    • Events
    • Conditions
    • Actions
      • -------- Since there is no "sleeping unit" we check all nearby neutral hostile units that are around the position of the triggering unit --------
      • Set tempPoint1 = (Position of (Triggering unit))
      • Set tempGroup1 = (Units within 200.00 of tempPoint1 matching ((Owner of (Matching unit)) Equal to Neutral Hostile))
      • Unit Group - Pick every unit in tempGroup1 and do (Actions)
        • Loop - Actions
          • Unit - Wake up (Picked unit)
      • -------- Make sure you remove the leaks or this is gonna lag --------
      • Custom script: call RemoveLocation(udg_tempPoint1)
      • Custom script: call DestroyGroup(udg_tempGroup1)

It kinda works , but I have little problem , if it comes to a unit which has skills the game lags for a bit... Anyway thank you for help .+Rep
 
Level 6
Joined
Jan 31, 2014
Messages
67
what kind of skill? these triggers shouldn't lag:/

When I add to spider a Multiply skill( when a unit dies from his guts emerge smaller spiders) and once I run , and spiders goes into the darkness , a minor lag comes in but I fixed that by not letting them sleep. Lag- just animation, spiders hit like every 5 sec (animation) but hp drops every sec.
 
Status
Not open for further replies.
Top