Trigger Clean Up

irgan

New Member
Reaction score
3
Is there anything i should do to clean this trigger up and make it smoother?
Trigger:
  • Untitled Trigger 001
    • Events
      • Unit - A unit Begins channeling an ability
    • Conditions
      • (Ability being cast) Equal to Bide
    • Actions
      • Set BideHealthStart = (Life of (Triggering unit))
      • Unit - Set (Triggering unit) movement speed to 0.00
      • Unit - Order (Triggering unit) to Special - Channel
      • Wait 10.00 seconds
      • Set BideHealthEnd = (Life of (Triggering unit))
      • Unit - Order (Triggering unit) to Neutral Pit Lord - Howl Of Terror
      • Special Effect - Create a special effect attached to the feet of (Triggering unit) using Units\NightElf\Wisp\WispExplode.mdl
      • Unit Group - Pick every unit in (Units within 700.00 of (Position of (Triggering unit)) matching (((Picked unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True)) and do (Actions)
        • Loop - Actions
          • Special Effect - Create a special effect attached to the body of (Picked unit) using Abilities\Spells\Undead\DeathCoil\DeathCoilSpecialArt.mdl
          • Unit - Cause (Triggering unit) to damage (Picked unit), dealing ((BideHealthStart - BideHealthEnd) x 5.00) damage of attack type Chaos and damage type Normal
      • Unit - Set (Triggering unit) movement speed to (Default movement speed of (Triggering unit))


If you need to know what its supposed to do the name of the ability should give it away. You take damage over a set amount of time then if you don't die, you return the damage and then some more.
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
First of all your trigger leaks heavily. Points and unitgroups and special effects.
If you dont know what a memory leak is, search for it and remove them properly.

Next thing is, this trigger will bug, imagine the caster is getting killed / cancels the channel / is stunned before the wait is finished. The effects will still take place.
Better split it up into 2 separate triggers, one trigger to set things up when he starts channeling and one trigger when he successfully finishes channeling.

Another thing to note is that this trigger is not MUI nor MPI, dont even try to make 2 units cast this spell at the same time. It will not work.
 

irgan

New Member
Reaction score
3
Yeah i know what memory leaks are. I'll do all the custom scripts to remove those later (copy paste :D)

And alright, 2 triggers would be a better idea, didnt think about that thanks.

And 2 units WONT be casting it at the same time xD so i think it's fine
 

NBalfa

New Member
Reaction score
10
your trigger leaks greatly first of all you should make 2 triggers
secondly the damage to the hero should be dealt trough the trigger
finally the best way to deal with this trigger is with hashtables if you don't know about how to use hashtables then have a quick search on the hive workshop. there is a good tutorial about hashtables, check it out and after finishing with this trigger of yours you wont imagine how easily you will be able to handle with hashtables
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
your trigger leaks greatly first of all you should make 2 triggers
secondly the damage to the hero should be dealt trough the trigger
finally the best way to deal with this trigger is with hashtables if you don't know about how to use hashtables then have a quick search on the hive workshop. there is a good tutorial about hashtables, check it out and after finishing with this trigger of yours you wont imagine how easily you will be able to handle with hashtables

why would anybody need hashtables for this?
 

ultimate11

Active Member
Reaction score
25
It`s hand written i hope it help you a little more



Trigger:
  • Map init
    • Events
    • Map initializations
    • Conditions
    • Actions
    • Hastable - create a hashtable
    • Set - Hashtable = last created hashtable



Trigger:
  • Untitled Trigger 001
    • Events
    • Unit - A unit Begins channeling an ability
    • Conditions
    • (Ability being cast) Equal to Bide
    • Actions
    • Set Caster = triggering unit
    • Set Temp_point = ((Position of (Caster))
    • Set Check = Load 1 of 1 ((Key(triggering unit)) from Hashtable
    • If then Else
      • If Conditions
        • Check = 0
        • Then Actions
          • Hashtable Save 1 as 1 of ((key(triggering unit)) in Hashtable
          • Trigger - Add (triggering unit take damage) new event to trigger (Damage)
          • Set Speed = Base movement speed of (Caster)
          • Hashtable Save Speed as 2 of ((key(triggering unit)) in Hashtable
          • Unit - Set (Caster) movement speed to 0.00
    • Unit - Order (Caster) to Special - Channel
    • Wait 10.00 seconds
    • Unit - Order (Caster) to Neutral Pit Lord - Howl Of Terror
    • Special Effect - Create a special effect attached to the feet of (Caster) using Units\NightElf\Wisp\WispExplode.mdl
    • Special Effect = Destroy Last created special effect
    • Set Spell_group = (Units within 700.00 of (Temp_point) matching (((Picked unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True))
    • Unit Group - Pick every unit in Spell_group) and do (Actions)
    • Loop - Actions
    • Special Effect - Create a special effect attached to the body of (Picked unit) using Abilities\Spells\Undead\DeathCoil\DeathCoilSpecialArt.mdl
    • special Effect - Destroy las created special effect
    • Unit - Cause (Caster) to damage (Picked unit), dealing ((Load 3 of ((key(triggering unit) from my hashtable) x 5.00) damage of attack type Chaos and damage type Normal
    • Unit - Set (Caster) movement speed to (Load 2 of ((key(triggerin unit) from Hashtable)
    • Hashtable Clear all child hastble of ((key(triggering unit))
    • Custom Script - call RemoveLocation (udg_Temp_point)
    • Custom Script - call DestroyGroup (udg_Spell_group)
    • Else
      • Hastable Save 0 as 3 of ((key(triggering unit)) in Hashtable
    • Set Speed = Base movement speed of (Caster)
      • Hashtable Save Speed as 2 of ((key(triggering unit)) in Hashtable
      • Unit - Set (Caster) movement speed to 0.00
    • Unit - Order (Caster) to Special - Channel
    • Wait 10.00 seconds
    • Unit - Order (Caster) to Neutral Pit Lord - Howl Of Terror
    • Special Effect - Create a special effect attached to the feet of (Caster) using Units\NightElf\Wisp\WispExplode.mdl
    • Special Effect = Destroy Last created special effect
    • Set Spell_group = (Units within 700.00 of (Position of (Triggering unit)) matching (((Picked unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True))
    • Unit Group - Pick every unit in Spell_group) and do (Actions)
    • Loop - Actions
    • Special Effect - Create a special effect attached to the body of (Picked unit) using Abilities\Spells\Undead\DeathCoil\DeathCoilSpecialArt.mdl
    • special Effect - Destroy las created special effect
    • Unit - Cause (Caster) to damage (Picked unit), dealing ((Load 3 of ((key(triggering unit) from my hashtable) x 5.00) damage of attack type Chaos and damage type Normal
    • Unit - Set (Caster) movement speed to (Load 2 of ((key(triggerin unit) from Hashtable)
    • Hashtable Clear all child hastble of ((key(triggering unit))
    • Custom Script - call RemoveLocation (udg_Temp_point)
    • Custom Script - call DestroyGroup (udg_Spell_group)


Trigger:
  • Damage
    • Event
    • Conditions
    • Actions
    • Set check = Load 1 of ((key(triggering unit))
    • If Then Else
      • If Conditions
        • Check = 1
      • Actions
        • Hashtable Save (Load 3 of ((key(triggering unit) from myHashtable) + (Damage Taken)) of (key(triggering unit))
 

Smitty

Member
Reaction score
20
That trigger won't work. Unless temp_point isn't used in any other trigger. Also you're leaking at least one unit group.
 

ultimate11

Active Member
Reaction score
25
Smitty dude read again Temp_point isn`t useless,if u dont know dont talk and I garantee you that the trigger work .
Is not look as It should be becouse is hand written.
So next time take your time to read and then post

The trigger contain only 1 unit group that is destroyed isn`t leaking in unit group.
I told you if you dont know dont replay !!!!

Set Spell_group = (Units within 700.00 of (Temp_point) matching (((Picked unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True))

Custom Script - call DestroyGroup (udg_Spell_group)
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
@ultimate:
Those triggers are terrible as well. Its not MUI, its leaking, and its even worse as the original trigger in the first post.

here is a demo map. Check it out and see how easy this spell is:
http://www.2shared.com/file/osB0ax3V/ZBide.html

Here are the triggers:
Trigger:
  • Spell Bide Start
    • Events
      • Unit - A unit Begins channeling an ability
    • Conditions
      • (Ability being cast) Equal to#Normal Bide
    • Actions
      • Set Spell_Bide_CasterInitHP = (Life of (Triggering unit))


Trigger:
  • Spell Bide End
    • Events
      • Unit - A unit ends casting an ability
    • Conditions
      • (Ability being cast) Equal to #Normal Bide
    • Actions
      • Set Temp_Point = (Position of (Triggering unit))
      • Set Temp_Group = (Units within 512.00 of Temp_Point matching ((((Matching unit) is alive) Equal to True) and ((((Matching unit) is a building) Equal to False) and (((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True))))
      • Unit Group - Pick every unit in Temp_Group and do (Actions)
        • Loop - Actions
          • Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Spells\Orc\FeralSpirit\feralspiritdone.mdl
          • Special Effect - Destroy (Last created special effect)
          • Unit - Cause (Triggering unit) to damage (Picked unit), dealing (Spell_Bide_CasterInitHP - (Life of (Triggering unit))) damage of attack type Normal and damage type Normal
      • Custom script: call RemoveLocation (udg_Temp_Point)
      • Custom script: call DestroyGroup (udg_Temp_Group)
 

ultimate11

Active Member
Reaction score
25
Unit - Cause (Triggering unit) to damage (Picked unit), dealing (Spell_Bide_CasterInitHP - (Life of (Triggering unit))) damage of attack type Normal and damage type Normal
Accame this not represent the damage that has taken in that specific interval of time.
Maybe that unit in the 10 seconds can restore back his life (for ex. using potions etc) so think again man (no offense)
Second can you shoow me the line that is leaking please in my trigger ...i`m so damn currious !
 

Smitty

Member
Reaction score
20
Smitty dude read again Temp_point isn`t useless,if u dont know dont talk and I garantee you that the trigger work .
Is not look as It should be becouse is hand written.
So next time take your time to read and then post

So the variable temp_point isn't a local variable? Then why not give it a name? Usually variables with names like temp_point are locals used in multiple triggers. Your trigger is confusing in that regard at least. In this issue, leaks aside, your triggers need revision. Maybe you should read through again before you assume I'm wrong :)
 

ultimate11

Active Member
Reaction score
25
I had used Temp_point over and over in my map and I have 225 trigger most of them skill in hashtable with verry fast periodic event and I never saw a bit of frame even in full house so teoreticlly may be like you say, practiclly is like me.If that variable should be a leak then i supposed to see memory leak or skills that have mallfunction or create lag.None of them happened ever.
 

Smitty

Member
Reaction score
20
I'm not talking about a leak. You can't use locals across a wait or they cease to be local.
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
Unit - Cause (Triggering unit) to damage (Picked unit), dealing (Spell_Bide_CasterInitHP - (Life of (Triggering unit))) damage of attack type Normal and damage type Normal
Accame this not represent the damage that has taken in that specific interval of time.
Maybe that unit in the 10 seconds can restore back his life (for ex. using potions etc) so think again man (no offense)
Second can you shoow me the line that is leaking please in my trigger ...i`m so damn currious !
I copied the trigger in the first post, if you look at it, he does it the same way.
 

ultimate11

Active Member
Reaction score
25
yea he does it in same way but is wrong and isn`t represent the real amount of damage taken.
whatever i dont care how will do it,i will not replay any,ore
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
yea he does it in same way but is wrong and isn`t represent the real amount of damage taken.
whatever i dont care how will do it,i will not replay any,ore
maybe thats the effect he wants to have? who are you to know whether what he likes is right or wrong?
I personally like this version more, it give the spell a little twist. Because you dont want to get healed while you channel this spell, it would decrease the effectivity. but you dont want to die either. its much more interesting and balanced this way.
 

irgan

New Member
Reaction score
3
oh jesus, there was like a small battle going on in my post o.o thanks for all your help guys, but i had already created/cleaned up my own trigger and it turned out to be pretty close to accname's :p i'll pretend i got it from him and give him the rep

The only thing wrong with accname's triggers is that he didnt account really for any of my special effects.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top