• 🏆 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] Freeze tim spell

Status
Not open for further replies.
In my map i have one hero spell called freeze time. When you activate itall untis on the map are paused. This caused before brief lag in the game, but now CRASHES the map.

  • Freeze Time
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Freeze Time (Time Warper)(E)
    • Actions
      • Set Freeze_Time = (Units in (Playable map area) matching ((Unit-type of (Matching unit)) Not equal to Time Warper (Agility)))
      • Countdown Timer - Pause A_Time_Resurrect[1]
      • Countdown Timer - Pause A_Time_Resurrect[2]
      • Countdown Timer - Pause A_Time_Resurrect[3]
      • Countdown Timer - Pause A_Time_Resurrect[4]
      • Countdown Timer - Pause A_Time_Resurrect[5]
      • Countdown Timer - Pause Hide_And_Seek
      • Countdown Timer - Pause Timer_GS
      • Countdown Timer - Pause LivingBomb_Timer
      • Countdown Timer - Pause Haunting
      • Countdown Timer - Pause Ghost_Temp
      • Countdown Timer - Pause Ghost_Temp
      • Unit Group - Pick every unit in Freeze_Time and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Triggering unit) has buff Imprisonment (Gem Master)) Equal to False
            • Then - Actions
              • Unit - Pause (Picked unit)
              • Animation - Change (Picked unit)'s animation speed to 0.00% of its original speed
            • Else - Actions
      • Countdown Timer - Start Timer_Freeze as a One-shot timer that will expire in (6.00 x (Real((Level of Freeze Time (Time Warper)(E) for (Triggering unit))))) seconds
Can you tell me how to make it better so it doesny crash map? :D
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
First of all, just pick every unit in the map and make a condition inside the loop to filter out units of which unit types are not Time Warper.
Or remove the casting unit (triggering unit) from the unit group. Your choice.
It is just a leak that cannot be avoided.

The pause should work, however there are quite a few things that pause do as side effect. One of those might be able to crash the map.
I dont know all side effects but there are some nasty ones in it.
 
Question: can pausing timer that has 0 remaining time crash the map?

Edit: After I tested disabling some triggers I found something. In the trigger above you see that I pause timers and start the tiemr of the spell. In the other trigger that checkxs if the spell expires, these timers are 'resumed' and that causes crash. Why? What's wrong with resuming timer that has 0 remaining time?
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
Pausing or resuming a timer with 0 remaining time doesnt give any lead to a crash.
Pausing timers is not that bad, but pausing units on the other hand...

If you can show me the trigger that does cause the crash then maybe I can see what happens.
 
Level 12
Joined
May 22, 2015
Messages
1,051
I had an issue like this. I couldn't find a solution. I was getting crashes sometimes with starting timers that weren't initialised or something and also some of the shorter interval (< 10 seconds) were not restarting at the end which basically breaks my whole map.

I just ignored the timers except for the main, visible one. Not a perfect solution though. I would like to know if there is a nice way to do this without things breaking.

So far, with pausing units, the main side effect I found was that it made flame strike deal 0 damage. I think the unit is considered paused for duration effects as well, so the ticks for those effects don't happen. I would have to recode many spells to make them do the damage properly. Instead, I am just using a war stomp that hits the whole map.
 
Level 12
Joined
May 22, 2015
Messages
1,051
Thanks Wietlol. That explains a lot. The main timer for my map is actually separate timers, so I guess that's why that one still worked.

My guess for the OP is that at least one of those timers is not currently on or not active, so it causes it to crash when you try to pause it. I had that exact issue with my map. It looks like you have resurrection timers. It is likely that not all of those are active when this spell is cast.
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
To completely freeze time and everything related to it, you are forced to trigger everything.
I mean, you even want to pause buffs, missiles, knockback, cooldowns, respawn timers and every other special thing like resurrection etc.
That is why noone uses a full freeze.
But when you have triggered everything and made sure that everything supports a pause... that means that you really are able to freeze time.

hmm...
 
Level 12
Joined
May 22, 2015
Messages
1,051
Ya I went with not a full freeze. It's fine if a bunch of little things don't work properly. In my map, it is basically there to allow the players to wombo combo a boss while it can't do anything. The time stop spell only freezes non-heroes. If it were a major part of the game, I would consider triggering everything to work with it properly, but it is just one hero's ult. Not worth redoing large chunks of my map just to work properly with it.
 
Status
Not open for further replies.
Top