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

Tail Whip

Status
Not open for further replies.
Level 8
Joined
Oct 8, 2005
Messages
409
I made a spell but, when ever the spell kills a units...the corpse freezes (standing up). This is a bug.

The spell is supose to make a naga royal guard wag his tail and throw enemy units.

  • Tail Whip
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Tail Whip
    • Actions
      • Trigger - Turn on Tail Whip Whip Effect <gen>
      • Set Tail_Whip_Target = (Target point of ability being cast)
      • Set Tail_Whip_UnitGroup = (Units within 300.00 of Tail_Whip_Target)
      • Set Tail_Caster = (Triggering unit)
      • Unit Group - Pick every unit in Tail_Whip_UnitGroup and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • Player 1 (Red) Equal to (Owner of (Picked unit))
                  • Player 3 (Teal) Equal to (Owner of (Picked unit))
                  • Player 4 (Purple) Equal to (Owner of (Picked unit))
                  • Player 5 (Yellow) Equal to (Owner of (Picked unit))
                  • Player 6 (Orange) Equal to (Owner of (Picked unit))
                  • Player 7 (Green) Equal to (Owner of (Picked unit))
            • Then - Actions
              • Unit Group - Remove (Picked unit) from Tail_Whip_UnitGroup
            • Else - Actions
      • Wait 1.50 seconds
      • Trigger - Turn off Tail Whip Whip Effect <gen>
      • Unit Group - Pick every unit in Tail_Whip_UnitGroup and do (Actions)
        • Loop - Actions
          • Unit - Pause (Picked unit)
      • Trigger - Turn on Tail Whip Effect <gen>
      • Unit Group - Pick every unit in Tail_Whip_UnitGroup and do (Actions)
        • Loop - Actions
          • Animation - Play (Picked unit)'s attack defend animation
          • Unit - Turn collision for (Picked unit) Off
      • Wait 0.50 game-time seconds
      • Trigger - Turn off Tail Whip Effect <gen>
      • Special Effect - Destroy (Last created special effect)
      • Wait 0.50 game-time seconds
      • Unit Group - Pick every unit in Tail_Whip_UnitGroup and do (Actions)
        • Loop - Actions
          • Animation - Reset (Picked unit)'s animation
          • Unit - Turn collision for (Picked unit) On
          • Unit - Unpause (Picked unit)
      • Wait 0.50 game-time seconds
      • Unit Group - Pick every unit in Tail_Whip_UnitGroup and do (Actions)
        • Loop - Actions
          • Animation - Reset (Picked unit)'s animation
          • Unit - Turn collision for (Picked unit) On
          • Unit - Unpause (Picked unit)
      • Wait 0.50 game-time seconds
      • Unit Group - Pick every unit in Tail_Whip_UnitGroup and do (Actions)
        • Loop - Actions
          • Animation - Reset (Picked unit)'s animation
          • Unit - Turn collision for (Picked unit) On
          • Unit - Unpause (Picked unit)
  • Tail Whip Effect
    • Events
      • Time - Every 0.01 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in Tail_Whip_UnitGroup and do (Actions)
        • Loop - Actions
          • Unit - Move (Picked unit) instantly to ((Position of (Picked unit)) offset by 10.00 towards (Facing of Tail_Caster) degrees), facing (Position of Tail_Caster)
  • Tail Whip Whip Effect
    • Events
      • Time - Every 0.25 seconds of game time
    • Conditions
    • Actions
      • Unit - Make Tail_Caster face ((Facing of Tail_Caster) + 60.00) over 0.20 seconds
      • Animation - Play Tail_Caster's walk animation
 
Level 12
Joined
Aug 18, 2006
Messages
1,193
it might be that you happend to kill them between 1.5 and 2.5 seconds, which is the time when they are Paused, and therefore they will not get Unpaused

and i really dont see why you are doing the final thing 3 times, and the fact that you are using a Special Effect - Destroy (Last created effect) when there is no Special Effect to destroy :p

oh, and you realise that they are pushed back 1000 Range per Second right? that is quite much if you ask me, but that might be as it should be, how should i know? :p
 
Level 8
Joined
Oct 8, 2005
Messages
409
I am still getting frozen bodies...

Quote: "Just change the time from 0.01 to 0.05 "
Reply: Done, thank you that makes it run much smoother.

Quote: "your triggers will leak like hell"
Reply: I have read the tutorial many times, but never understood it...
What is a leak?

Quote: "Reset Animation plays "stand", that's your problem."
Reply: I disabled those lines of code, but it did not help.

Quote: "i really dont see why you are doing the final thing 3 times"
Reply: To try to catch leaks...lol

Quote: "there is no Special Effect to destroy "
Reply: Sorry, that was from old code, Line removed.

Quote: "they are pushed back 1000 Range per Second right?"
Replt: yes, that is the way I need it...

Quote: "it might be that you happend to kill them between 1.5 and 2.5 seconds, which is the time when they are Paused, and therefore they will not get Unpaused"
Reply: How do I fix this?
 
Level 9
Joined
May 27, 2006
Messages
498
2. Leaks, the full name: memory leaks. When you create/move a unit, you must also create a location, to define where the unit have to be placed. It is done by using position of another unit, center of region, position with offset... All the things that are defining location.

After you create locations, you have to destroy them. If you wont do so, each undestroyed location will take a bit of memory. And now think, if you create lots of these locations, the memory taken will be huge, and that will cause laggs.

To avoid that, create a Point-type variable, name it TempPoint. Then place "Set variable" line before your create/move unit action. Set the variable to the position you want unit to be placed at, and in your action, use TempPoint instead of defining location. After that line (or lines, if there are many of them, using one point, and TempPoint variable is not changed during they are done.) place this:
  • Custom script: call RemoveLocation(udg_TempPoint)
Example:
  • Set TempPoint = (Position of(Triggering unit) with polar offset 600 with (Facing of (Triggering unit)) angle)
  • Unit Group - Pick every unit in (Units in (Entire map)) and do If (Picked unit) have buff BlinkBuff then do Unit - Move unit instantly to TempPoint else (Do nothing)
  • Special Effect - Create a special effect using (Blink model) at TempPoint
  • Custom script: call RemoveLocation(udg_TempPoint)
  • Set TempPoint = (Position of (Casting Unit))
  • Unit - Cause (Casting Unit) to damage circular area after 0.00 seconds of radius 500.00 at TempPoint, dealing 500.00 damage of attack type Spells and damage type Normal
  • Custom script: call RemoveLocation(udg_TempPoint)
  • Set TempEffect = (Last Created special effect)
  • Wait 2 seconds.
  • Special Effect - Destroy TempEffect
Special effects also leak, so i removed them.
Thats only example of many leak types. Hope you`ll get the tutorial now...

7. Unpause them just before they die. It can be even 0.0001 sec, but they must be unpaused before they are killed.
EDIT: Or make them invulnerable... Its very short period of time, oh, and place the Unpause unit action near Turn off Tail Whip Effect (if it still matches your needs)
 
Last edited:
Level 12
Joined
Aug 18, 2006
Messages
1,193
Quote: "it might be that you happend to kill them between 1.5 and 2.5 seconds, which is the time when they are Paused, and therefore they will not get Unpaused"
Reply: How do I fix this?
I have myself never got this problem, so i dont know if this trigger works or not, but you can give it a try and see if it works
  • Events
    • Unit - A unit Dies
  • Conditions
    • ((Dying unit) is paused) Equal to True
  • Actions
    • Unit - Unpause (Dying unit)
you will find the condition in the Boolean category
 
  • Special Effect - Create a special effect using (Blink model) at TempPoint
  • Special Effect - Destroy (Last created special effect)
  • Custom script: call RemoveLocation(udg_TempPoint)
Creating and then destroying a special effect works just fine, and you don't even need a special effect variable.

The special effect is spawned and then immediately destroyed, but the actual effect model plays through its entire animation before being cleaned up and removed.
 
Status
Not open for further replies.
Top