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

Spell

Status
Not open for further replies.
Level 18
Joined
May 11, 2012
Messages
2,103
was just testing my map, and it showed up error when I used this spell:

  • Death Hand
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Death Hand
    • Actions
      • Set DeathHand_TrigUnit = (Triggering unit)
      • Set DeathHand_TargetUnit = (Target unit of ability being cast)
      • Unit - Turn collision for DeathHand_TargetUnit Off
      • Animation - Play DeathHand_TrigUnit's spell animation
      • Lightning - Create a Magic Leash lightning effect from source (Position of DeathHand_TrigUnit) to target (Position of DeathHand_TargetUnit)
      • Set DeathHand_Lightning = (Last created lightning effect)
      • Lightning - Change color of DeathHand_Lightning to (128.00 0.00 128.00) with 1.00 alpha
      • Trigger - Turn on Death Hand Loop <gen>
  • Death Hand Loop
    • Events
      • Time - Every 0.05 seconds of game time
    • Conditions
    • Actions
      • Set DeathHand_TrigUnitLoc = (Position of DeathHand_TrigUnit)
      • Set DeathHand_TargetUnitLoc = (Position of DeathHand_TargetUnit)
      • Set DeathHand_Angle = (Angle from DeathHand_TargetUnitLoc to DeathHand_TrigUnitLoc)
      • Set DeathHand_MovingTargetUnit = (DeathHand_TargetUnitLoc offset by 20.00 towards DeathHand_Angle degrees)
      • Unit - Move DeathHand_TargetUnit instantly to DeathHand_MovingTargetUnit, facing DeathHand_Angle degrees
      • Lightning - Move DeathHand_Lightning to source (Position of DeathHand_TrigUnit) and target (Position of DeathHand_TargetUnit)
      • Set DeathHand_UnitGroup = (Units within 100.00 of DeathHand_TrigUnitLoc)
      • Unit Group - Pick every unit in DeathHand_UnitGroup and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Picked unit) Equal to DeathHand_TargetUnit
            • Then - Actions
              • Trigger - Turn off (This trigger)
              • Set DeathHand_TrigUnitLoc = (Position of DeathHand_TrigUnit)
              • Set DeathHand_TargetUnitLoc = (Position of DeathHand_TargetUnit)
              • Unit - Create 1 Dummy DeathHand for (Owner of DeathHand_TrigUnit) at DeathHand_TargetUnitLoc facing Default building facing degrees
              • Unit - Add Dummy Death Hand to (Last created unit)
              • Unit - Set level of Dummy Death Hand for (Last created unit) to (Level of Death Hand for DeathHand_TrigUnit)
              • Unit - Order (Last created unit) to Orc Tauren Chieftain - War Stomp
              • Special Effect - Create a special effect at DeathHand_TargetUnitLoc using war3mapImported\DarkNova.mdx
              • Special Effect - Destroy (Last created special effect)
              • Unit - Add a 0.20 second Generic expiration timer to (Last created unit)
              • Animation - Reset DeathHand_TrigUnit's animation
              • Unit - Turn collision for DeathHand_TargetUnit On
              • Lightning - Destroy DeathHand_Lightning
              • Custom script: call RemoveLocation(udg_DeathHand_TrigUnitLoc)
              • Custom script: call RemoveLocation(udg_DeathHand_TargetUnitLoc)
            • Else - Actions
      • Custom script: call RemoveLocation(udg_DeathHand_TrigUnitLoc)
      • Custom script: call RemoveLocation(udg_DeathHand_TargetUnitLoc)
      • Custom script: call RemoveLocation(udg_DeathHand_MovingTargetUnit)
      • Custom script: call DestroyGroup(udg_DeathHand_UnitGroup)
  • Death Hand Stop
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Triggering unit) Equal to DeathHand_TargetUnit
    • Actions
      • Trigger - Turn off Death Hand Loop <gen>
      • Lightning - Destroy DeathHand_Lightning
It crashed just now, before it didn't lol wtf?
Are those triggers correctly structed? can it be more optimized? :O
 
Level 29
Joined
Oct 24, 2012
Messages
6,543
it can be optimized. First it probably crashes because u destroy the Lightning in the group loop.

it isnt MUI.

store last created unit into a variable. Also this leaks.
  • Lightning - Move DeathHand_Lightning to source (Position of DeathHand_TrigUnit) and target (Position of DeathHand_TargetUnit)
same with when u create them
 
Level 18
Joined
May 11, 2012
Messages
2,103
it can be optimized. First it probably crashes because u destroy the Lightning in the group loop.

it isnt MUI.

store last created unit into a variable. Also this leaks.
  • Lightning - Move DeathHand_Lightning to source (Position of DeathHand_TrigUnit) and target (Position of DeathHand_TargetUnit)
same with when u create them

''it isnt MUI.''
I know it isn't MUI. I don't need it MUI. I don't want it MUI. So I won't make it MUI.
''First it probably crashes because u destroy the Lightning in the group loop.''
then why it didn't crashed now? and how should I destroy lightning? make new trig and run it in loop?
My map really has serious engine damage :D

''Also this leaks.
  • Lightning - Move DeathHand_Lightning to source (Position of DeathHand_TrigUnit) and target (Position of DeathHand_TargetUnit)
'' I have no idea how I missed that.... I even set the variables lol
Why to set picked unit into variable?
 
Level 18
Joined
May 11, 2012
Messages
2,103
not picked unit. last created unit. anything used twice or more should be put into a variable both for efficiency and useability

its ok if its not MUI lol but then y do the group loop ?

destroy the lightning outside of the group loop. after the group loop

corrected the leaks. Unit set to variable. lightning not destroyed after the group loop cuz then it will be destroyed and moving lightning will be impossible since there's no lightning.

How should I then check when target unit comes near without the group loop?
 
Level 29
Joined
Oct 24, 2012
Messages
6,543
corrected the leaks. Unit set to variable. lightning not destroyed after the group loop cuz then it will be destroyed and moving lightning will be impossible since there's no lightning.

How should I then check when target unit comes near without the group loop?

u destroy the lightning already so u cant move it. if u only want it destroyed when ur done then u have to create the lightning b4 the group and destroy it after. also it would help if u explain what u want the spell to do and how u want it to work.
 
Level 18
Joined
May 11, 2012
Messages
2,103
u destroy the lightning already so u cant move it. if u only want it destroyed when ur done then u have to create the lightning b4 the group and destroy it after. also it would help if u explain what u want the spell to do and how u want it to work.

I cr8 lightning when spell starts from me to him. And in loop, that lightning is moved as he moves. WHEN he comes to me, I simply destroy the lightning. What's such a big deal?
 
Level 18
Joined
May 11, 2012
Messages
2,103
if ur only moving the lightning with the unit then u dont need the group loop lol.

just put the target into a variable. and move the lightning every .05 or whatever u want.

I need the group to do the actions in ITE omg, how the heck am I going to check if the unit came to me without unit group? I taget unit, the loop moves unit and lightning with it and when unit comes to me, actions executes :O
 
Level 18
Joined
May 11, 2012
Messages
2,103
what im saying is the group is pointless u dont need it all u have to do is use the ITE to check the distance between points. point 1 is target unit point 2 is caster. put the actions u want done in the then block of the ITE. Also calm down lol if u dont understand just ask to explain better.

sorry, I easily got mad :D
But then why no tell that right away when u said group is pointless?
 
Status
Not open for further replies.
Top