Trigger Clean Up

irgan

New Member
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
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
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
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
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
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
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
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
@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
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
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
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.
 

Accname

2D-Graphics enthusiast
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
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
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
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 The Helper:
    what is this Ghan? https://enterprise.ghannet.com/ you are totally holding out on us my friend
  • Ghan Ghan:
    Not mine, I just ran the server. They let the domain expire but it was a cool project so I kept it alive there.
  • Ghan Ghan:
    Used to be enterpriserpg.com I think.
  • The Helper The Helper:
    If you go to the world editor tutorials site and click the starcraft link it takes you there :)
  • Ghan Ghan:
    lol
  • Ghan Ghan:
    I forgot about that alias name. (The full URL still went to the correct site.) That should be fixed.
  • Ghan Ghan:
    Silkroad Forums site really needs help.
  • Ghan Ghan:
    Its software has been out of support since 2017.
  • Ghan Ghan:
    The woes of using custom styles....
  • The Helper The Helper:
    does anyone still use silk road forums?
  • Ghan Ghan:
    It's about as active as here I'd say. Not much going on.
  • Wizard Wizard:
    I think it doesn't help that the silk road game isn't as popular any more I think. The only MMO I play these days is FFXIV like most other people I know.
  • The Helper The Helper:
    I checked a status page for players and it says the game has 500 daily players.
  • The Helper The Helper:
    I cannot believe that site is still going I wonder if Ryoko is involved with it at all would love to talk to him again and see what he is up to
  • The Helper The Helper:
    my oldest daughter failed her driving test today for her license she is 22 and yes I have been driving her everywhere her whole life
  • The Helper The Helper:
    Now they are blaming me on Facebook for her failure LOL I am accepting it because it is my failure I am her driving teacher even though she had certified driving instruction from the best place in town I for some reason cannot teach her how to drive this is frustrating
  • jonas jonas:
    I didn't get my license until I was 25
    +1
  • The Helper The Helper:
    Back in the old days when I was getting a license people were getting them at 16 yrs old and many were getting hardships so they could get them earlier. Almost nobody did not drive when they were able. Nowadays though....
  • Ghan Ghan:
    Why drive when there's Uber Eats?
    +2
  • The Helper The Helper:
    I hope Varine is OK have not heard from him in a while.
    +1
  • Ghan Ghan:
    Diablo 2 Resurrected launching in 9 days.
  • The Helper The Helper:
    Just got a new to me computer hope it will run it
  • jonas jonas:
    I would buy if it had better modding support than D2, like a small lua script engine or much less hardcoded stuff
  • Ghan Ghan:
    Lots of folks are upset that they aren't supporting mods.

    Members online

    Affiliates

    Hive Workshop NUON Dome
    Top