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:
    that sucks
  • jonas jonas:
    @midnight8 how is it looking
  • midnight8 midnight8:
    meh, me, wife and her friend thaty traveled with us all have covid, seems to be winding down some for me at least. Felt like complete shit, been sleeping a lot, just bieng lazy as hell. I feel like that today has probably been like 11 or 12 days since exposure. Have not had any fever today, and have not taken any meds, so hopefully by monday or tuesday I will be good to go, sadly have passed it on to our teen son, I guess that was pretty much unavoidable
  • The Helper The Helper:
    hope you get to feeling better and get vaccinated my friend
  • midnight8 midnight8:
    I will at some point, but so many vaccinated people still getting it. One of the bands we watch in vegas, all 4 had been vaccinated and are now positive.
  • Ghan Ghan:
    Symptoms?
  • Ghan Ghan:
    I think the symptoms are typically less severe if previously vaccinated.
  • midnight8 midnight8:
    I have had all of the symptoms, taste is slightly starting to come back, but smell, no. Honestly, just been a little miserable, have never felt in any danger from it. Being trapped at home sucks. lol
  • midnight8 midnight8:
    meh, got a little fever again this morning, guess gonna be a few more days
  • The Helper The Helper:
    I went to Comicon this last weekend I hope I dont get it I feel fine and I am not vaccinated and did not wear a mask
  • The Helper The Helper:
    Comicon really was not packed though like it was in the past. I am not really worried though it was the most people I have been around in a year.
  • tom_mai78101 tom_mai78101:
    Still, getting vaccinated is a good idea. We're getting Delta variant spikes here in Boston.
  • The Helper The Helper:
    I am not against vaccination at all I just have a serious procrastination problem I plan on getting vaccinated soon
  • midnight8 midnight8:
    was kinda same with me, I was gonna do it, and life got in the way.
  • midnight8 midnight8:
    we wore mask in some places, but at 118 degrees outside, little rough. :)
  • The Helper The Helper:
    yeah i had another friend in Vegas talking about that heat damn
  • The Helper The Helper:
    Well I do not think I got Covid from the Comicon
    +1
  • tom_mai78101 tom_mai78101:
    Pushed out a new Pokemon Walking algorithm build. With a new system in place, I'll probably start tackling triggers and NPCs,
    +1
  • Varine Varine:
    Is it fucking hot everywhere?
  • Varine Varine:
    What's a pokemon walking algorithm?
  • jonas jonas:
    it's an engine for pokemon games that closely emulates the walking behavior of pokemon red/blue/yellow
  • jonas jonas:
    basically if you wanted to implement pokemon yellow from scratch, and you'd want it to feel as close as possible to the real thing, you'd start with that
  • Varine Varine:
    Like from the Gameboy games? I'm not at all familiar with Pokemon.
  • jonas jonas:
    yeah
  • The Helper The Helper:
    I only played the Pokemon games on the Gamecube and Wii and such not on the portables my kids had all those games but I never really played on the portables. Now that I think about maybe once sooooo long ago.

    Staff online

    Members online

    Affiliates

    Hive Workshop NUON Dome
    Top