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

[General] Efficient Unit Hiding

Status
Not open for further replies.
Level 6
Joined
Sep 11, 2006
Messages
172
What is the best way to repeatedly hide and unhide units? Adding invisibility to units does nothing and the hide/unhide function in GUI is broken. It only fires once and then it causes custom script to not fire at all.

What I'm trying to put together now is an environmental script where light rays (the units in question) appear from windows during lightning strikes and then disappear when it ends.

I have fade filters and sounds tied to local player variables so that only the players in the area of the windows can see whats happening. The fade filters and the sounds work fine, but any function I use involving hiding the light rays simply does not work how I want it to.
 
Level 6
Joined
Sep 11, 2006
Messages
172
Here's the script so far. It's hardly finished. I'm just trying to get the window flashes done first.

The units are hidden 2 seconds after start. Then when they are unhidden in this trigger they don't ever appear again even if I try having their stand animation played. They don't have birth animations.

  • Storm
    • Events
      • Time - Every 8.00 seconds of game time
    • Conditions
    • Actions
      • Custom script: local player p
      • Set TempGroup = (Units in (Playable map area)((Unit-type of (Matching unit)) Equal to Window Shine))
      • Unit Group - Pick every unit in TempGroup and do (Actions)
        • Loop - Actions
          • Unit - Unhide (Picked unit)
          • Animation - Play (Picked unit)'s Stand animation
      • Custom script: call DestroyGroup (udg_TempGroup)
      • -------- Local Player --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Hunting Rect Copy 2 <gen> contains Hero[1]) Equal to True
        • Then - Actions
          • Game - Display to (All players) the text: Fire 2
          • Set sound = No sound
          • Set sound = RollingThunder1 <gen>
          • Custom script: if GetLocalPlayer() == GetOwningPlayer(udg_Hero[1]) then
          • Sound - Play sound
          • Custom script: endif
          • Custom script: set p = GetOwningPlayer(udg_Hero[1])
          • Custom script: call SetCineFilterTexture("ReplaceableTextures\\CameraMasks\\White_mask.blp")
          • Custom script: call SetCineFilterStartColor(255,255,255,100)
          • Custom script: call SetCineFilterEndColor(0,0,0,0)
          • Custom script: call SetCineFilterDuration(0.5)
          • Custom script: if GetLocalPlayer()==p then
          • Custom script: call DisplayCineFilter(true)
          • Custom script: endif
          • Wait 1.00 seconds
          • Custom script: call SetCineFilterStartColor(0,0,0,0)
          • Custom script: call SetCineFilterEndColor(0,0,0,0)
          • Custom script: call SetCineFilterDuration(2.5)
          • Custom script: if GetLocalPlayer()==p then
          • Custom script: call DisplayCineFilter(true)
          • Custom script: endif
          • Custom script: set p=null
        • Else - Actions
      • -------- Local Player --------
      • Wait 3.00 seconds
      • -------- Block --------
      • Set TempGroup = (Units in (Playable map area)((Unit-type of (Matching unit)) Equal to Window Shine))
      • Unit Group - Pick every unit in TempGroup and do (Actions)
        • Loop - Actions
          • Unit - Hide (Picked unit)
      • Custom script: call DestroyGroup (udg_TempGroup)
      • Wait 0.25 seconds
      • -------- Block --------
      • Set TempGroup = (Units in (Playable map area)((Unit-type of (Matching unit)) Equal to Window Shine))
      • Unit Group - Pick every unit in TempGroup and do (Actions)
        • Loop - Actions
          • Unit - Unhide (Picked unit)
          • Animation - Play (Picked unit)'s Stand animation
      • Custom script: call DestroyGroup (udg_TempGroup)
      • -------- Block --------
      • Set TempGroup = (Units in (Playable map area)((Unit-type of (Matching unit)) Equal to Window Shine))
      • Unit Group - Pick every unit in TempGroup and do (Actions)
        • Loop - Actions
          • Unit - Hide (Picked unit)
      • Custom script: call DestroyGroup (udg_TempGroup)
      • Wait 0.25 seconds
      • -------- Block --------
      • Set TempGroup = (Units in (Playable map area)((Unit-type of (Matching unit)) Equal to Window Shine))
      • Unit Group - Pick every unit in TempGroup and do (Actions)
        • Loop - Actions
          • Unit - Unhide (Picked unit)
          • Animation - Play (Picked unit)'s Stand animation
      • Custom script: call DestroyGroup (udg_TempGroup)
      • Wait 1.00 seconds
 
Status
Not open for further replies.
Top