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:
    I read in the PC Gamer review that it was not much of an update to the game like just a re-release
  • Ghan Ghan:
    It's a good remaster. They did not want to change the game much because there are still many die-hard players out there that wouldn't like it to be a new game.
  • Ghan Ghan:
    They've said they are open to adding new content in the future, but wanted to get what's there correct first. As it is, for what you get the $40 asking price is a bit steep.
  • The Helper The Helper:
    Yeah that is a high price think I am going to wait a minute and see if it goes down some.
  • The Helper The Helper:
    Looking forward to doing some dungeon grinding again though.
  • The Helper The Helper:
    still 101 bots on the site constantly
  • midnight8 midnight8:
    my bots got out of their cage? oh no
  • The Helper The Helper:
    these bots are from russia, china and asia they are less than they were but more than they need to be I have no idea why they hover here
  • tom_mai78101 tom_mai78101:
    Probably because of my Headline News
  • The Helper The Helper:
    Facebook is getting fucked right now lol
  • The Helper The Helper:
    I learned one thing from the Facebook outage - BGP - I am sure Ghan is an expert in it but I did not know what the name of it was I knew there was something like that there though
  • The Helper The Helper:
    What is up Tom?
  • jonas jonas:
    We once considered doing a project on BGP looking for problems in the implementations. But we didn't get sufficient interest and Tony Li was mean to us so we said whatever
  • Varine Varine:
    hello, peeps. I got most of my computer back up to Idaho so I have passwords again after that nightmare of like 4 months
  • Varine Varine:
    We're all trying to get time off now, but holy shit. I did not expect it to be that busy. Every day was a historical record, and every week was a total sales record for like all of summer. My pay is going to almost double next summer, which makes cooking finally a viable career, I might actually afford to change industries soon!
  • Varine Varine:
    We had people ask if there was anything we could do about the fucking sun. There's like 30 inside tables and every outside table has a sunbrella thing.
  • Varine Varine:
    No, I'm sorry, I cannot move the sun and the umbrella doesn't go 90 degrees sideways. They unfortunately had to deal with a sunset across mountains and a lake, we can only imagine the horror they had to undergo by visiting our restaurant
  • Varine Varine:
    Well, they do, but they're big and blow away and a 10 foot runaway umbrella is a much bigger problem than some cunt with the sun sorta in her eyes
  • The Helper The Helper:
    What is up Varine? Good to see you buddy! Too bad you are not in Houston I have a friend that needs Cooking staff like desperately remember if you ever want to get a different landscape, not sunsets over mountains and a lake Houston has opportunity!
  • tom_mai78101 tom_mai78101:
    Nice to see Varine back in action.
  • The Helper The Helper:
    Welcome back Varine!
  • The Helper The Helper:
    can someone answer a question in the World Editor Help forum?
  • jonas jonas:
    ok
  • The Helper The Helper:
    thank you jonas!
  • Varine Varine:
    I'll probably be here through next summer at least, I get paid decent at the moment and I expect it to go up significantly next year. Plus I'm on contract through the end of the year
    +1

    Members online

    No members online now.

    Affiliates

    Hive Workshop NUON Dome
    Top