Im trying to make one trigger with as few events as possible to detect over 300 different abilities. I just need the trigger to go off when one is used, thats IT. It doesn't have to do anything. Im very aware of the unit uses ability event. Its what i am currently using to detect 5 abilities for testing, but to do so i need 5 events. The unit uses ability even lets you select any unit, but there is no "any ability" option. I don't want to have a trigger with 300 events... has to be a better way.
I posted a question in the data section also, as i think the best way to achieve this is for my 300 abilities to each notify a trigger that they were used somehow. But if theres an efficient way to do this with triggers only, please let me know! thanks.
ideally id like to detect any ability at the very first stage of casting. Adding an event to detect each one is the very thing im trying to avoid since i have around 300 custom abilities that need detecting... thats a lot of clutter i want to avoid, and galaxy should be able to let me to.
but you are very right. everything is an ability... even standing still apparently, cause the moment my map loads, the trigger looking for any order spamms my chat screen with "ability used!" (a line i added into the trigger for testing) . so that doesnt work.
so is there any way to detect any ability command without hundreds of events?
You can use the "Unit uses Ability" Action, and put inside of the ability parameter the custom script: "AbilityCommand("", 0)" (But don't use Generic1 - Any as stage or you will mass spam the trigger :P Best would be Generic 3 - Execute I guess).
Add event for each abiltiy you want to detect... ( if theres 300 of them then add 300) this will help your map run much smoother.
You can use the "triggering Ability" refrence through out the rest of the trigger.
This is prolly the most optimal way to do it. I dont know why you need a trigger to detect all of your abilities though. Generally you shouldnt need to detect all of your abilities with trigger. Thats why I asked what your trying to do exactly there may be a better way.
To use the "Any ability event" you need to
Event - Any ability used at generic cast. (differnt abilities types have different cast stages) this may cause you problems
you will need a condition to prevent your code from running when units use abilties you dont want to run the code against. Although the event will still fire and may lag the hell out of the game
Triggering abiltiy != "move" - stand
Triggering abiltiy != "move" - move/attack
Triggering abiltiy != "move" - move
Triggering abiltiy != "move" - stop
Triggering abiltiy != "move" - hold position
Triggering abiltiy != attack
so yeah... i think if your gonna be tracking 300+ abilties with trigger you should create an event for each one.... you will have much more control if you do it this way. other wise your gonna run into some serious issues depending on what your abilities do, and lag issues from the trigger firing off too much
Rollback Post to RevisionRollBack
Skype
KageNinpo = SN
My Libraries
DialogLeaderboard & TeamSort
My Projects
SPACEWAR Tribute
Infinite TD
Baldey what your asking for can only be done like soulcarverr says. The thing is i doubt blizz will ever have an event possibility that responds to any ability used. The problem is that like said above everthing is an ability so that means your trigger would be run just about every 0.001 second regardless of what your doing.
This would hog down your map so badly it would hardly run.
The game already maps an event for every single ability you have, use or create so all you have to do is call on that event thats already being triggerd.
Even if you think this would create alot of cluter in your code it still will be by far the best and only method to do it without causing preformance problems
hmm i will be trying talon's idea later, and considering soulcarver's point till then. Is there a way to freeze all "default" abilities from being executed? i dono what those are, but like you said, when the map is just idling, the trigger i have now that looks for any ability used is being spammed many times a second. For my map, it would actually be beneficial to make all of the units on the map essentially dead... and if that were possible would that reduce the number of random abilities that are always being executed apparently? Nothing in my map needs to move, and oddly enough the abilities dont even need to actually do anything, they just need to be used.
Lol this map sounds confusing i know, but i wana keep it under the veil till i post it up on here.
a tally is kept every time an ability is used, and a comparison is made to an array of ability commands. thats it. not much fires :P . dono if theres any more efficient way to keep a tally of abilities used. making the comparison is easy, and is done by another triger anyway, so all i need here is a way to know when and what ability was used.
Ive been digging around abit and did get a valid idea as how to do it how ever i constantly run into a problem not being able to return the last used abilty from a unit. With out that part i cannot sum up the events into 1 event line.
Either blizz will have to add the abilty to return the last used ability on a unit or im completely overlooking it.
So all i can say sadly is your bound to adding an event line for every ability you want it to react too. I must note that its not bad coding to add that many lines in the event. It will not create any adverse lag or memory issues just need to type quite abit.
@anyone beside baldey
If you have a way to return last used abilty in an action i would love to know
Depending on what you need to do, you may want to try a switch statement. Basically just input the ability used, and what you want to do. However, with 300 abilities it may be a bit large to do that, and may lag. A lot.
no see if i could do that i wouldn't have a problem :P . making a switch block implies that you have an ability used that you got by triggering off some event that fires whenever any ability is used right? well as we found out earlier in the thread theres a hellofa lot of ghost abilities, and the map will lag a lot, but the switch block is gona be the least of the lag problems. but if you could get a triger to fire anytime an ability form the comand card was used and avoid all the ghost abilities constantly being in use, then i wouldn't have a problem. i already know what ability im looking for when im testing for one, so all i need to say is; if (abilityArr[x] != LastUsedAbility) do stuff } else do other stuff; and thats all i need to know.
@Bezerker18: Go
and bezerker says hes found a way, but if his way is used theres no way to get that LastUsedAbility. whats your idea btw? i might be able to play around and find something.
Well i was thinking of creating an extra function that returns an ability command.
The function can be added in the the event trigger in place of the ability command you enter on the standard event we are using above.
The idea is to pass on the triggering unit in a parameter to the function then get the ability command of the last used ability by that unit en return that as the return value of the function
After that it would be easy to define on what abilitys it triggers with a condition based ability array.
Oh one other thing i thought of but also restricts your ability's alittle is to use an event that rsponds to property change and then focus on energy used.
Event - any unit uses energy
bla bla bla
Only draw back is you would have to make sure that every abilty uses energy that you want to detect.
The examples Ive already listed... Should work for exactly what he is doing... If they dont.... then your doing something wrong.
You, are a dick. He saw what you wrote and will take it in as needed. Get over yourself and stop referencing what you already said. Repeating it is just dickish spam.
edit: jk i didnt see how old this was... walks away
Im trying to make one trigger with as few events as possible to detect over 300 different abilities. I just need the trigger to go off when one is used, thats IT. It doesn't have to do anything. Im very aware of the unit uses ability event. Its what i am currently using to detect 5 abilities for testing, but to do so i need 5 events. The unit uses ability even lets you select any unit, but there is no "any ability" option. I don't want to have a trigger with 300 events... has to be a better way.
I posted a question in the data section also, as i think the best way to achieve this is for my 300 abilities to each notify a trigger that they were used somehow. But if theres an efficient way to do this with triggers only, please let me know! thanks.
@Baldey: Go
anyone please? this cant be that hard...
Pretty much Event: Unit is Issued Order Condition: Comparison between: Ability of Ability Command and Ability Command for Order
This really depends on what your doing when you detect the used abilities...
Some abilities you might want to detect at different stages of thier casting.....
I would suggest adding a specific event for every abiltiy you want to detect to the events at the top.
This will prevent abilities that you dont want detect from being detected by it
Everything In SC2 is an abiltiy.... even attacking
@SouLCarveRR: Go
ideally id like to detect any ability at the very first stage of casting. Adding an event to detect each one is the very thing im trying to avoid since i have around 300 custom abilities that need detecting... thats a lot of clutter i want to avoid, and galaxy should be able to let me to.
but you are very right. everything is an ability... even standing still apparently, cause the moment my map loads, the trigger looking for any order spamms my chat screen with "ability used!" (a line i added into the trigger for testing) . so that doesnt work.
so is there any way to detect any ability command without hundreds of events?
You can use the "Unit uses Ability" Action, and put inside of the ability parameter the custom script: "AbilityCommand("", 0)" (But don't use Generic1 - Any as stage or you will mass spam the trigger :P Best would be Generic 3 - Execute I guess).
Like I said
This is prolly the most optimal way to do it. I dont know why you need a trigger to detect all of your abilities though. Generally you shouldnt need to detect all of your abilities with trigger. Thats why I asked what your trying to do exactly there may be a better way.
To use the "Any ability event" you need to
so yeah... i think if your gonna be tracking 300+ abilties with trigger you should create an event for each one.... you will have much more control if you do it this way. other wise your gonna run into some serious issues depending on what your abilities do, and lag issues from the trigger firing off too much
Baldey what your asking for can only be done like soulcarverr says. The thing is i doubt blizz will ever have an event possibility that responds to any ability used. The problem is that like said above everthing is an ability so that means your trigger would be run just about every 0.001 second regardless of what your doing.
This would hog down your map so badly it would hardly run.
The game already maps an event for every single ability you have, use or create so all you have to do is call on that event thats already being triggerd.
Even if you think this would create alot of cluter in your code it still will be by far the best and only method to do it without causing preformance problems
@Bezerker18: Go
hmm i will be trying talon's idea later, and considering soulcarver's point till then. Is there a way to freeze all "default" abilities from being executed? i dono what those are, but like you said, when the map is just idling, the trigger i have now that looks for any ability used is being spammed many times a second. For my map, it would actually be beneficial to make all of the units on the map essentially dead... and if that were possible would that reduce the number of random abilities that are always being executed apparently? Nothing in my map needs to move, and oddly enough the abilities dont even need to actually do anything, they just need to be used.
Lol this map sounds confusing i know, but i wana keep it under the veil till i post it up on here.
TBH i havent been able to think ovf anything you would want to use this kind of trigger for.
Tell me what are you fireing off when the ability event is registeerd? maybe there is a far more efficient method to doing what you want?
@Bezerker18: Go
a tally is kept every time an ability is used, and a comparison is made to an array of ability commands. thats it. not much fires :P . dono if theres any more efficient way to keep a tally of abilities used. making the comparison is easy, and is done by another triger anyway, so all i need here is a way to know when and what ability was used.
Ive been digging around abit and did get a valid idea as how to do it how ever i constantly run into a problem not being able to return the last used abilty from a unit. With out that part i cannot sum up the events into 1 event line.
Either blizz will have to add the abilty to return the last used ability on a unit or im completely overlooking it.
So all i can say sadly is your bound to adding an event line for every ability you want it to react too. I must note that its not bad coding to add that many lines in the event. It will not create any adverse lag or memory issues just need to type quite abit.
@anyone beside baldey
If you have a way to return last used abilty in an action i would love to know
Depending on what you need to do, you may want to try a switch statement. Basically just input the ability used, and what you want to do. However, with 300 abilities it may be a bit large to do that, and may lag. A lot.
@wOlfLisK: Go
no see if i could do that i wouldn't have a problem :P . making a switch block implies that you have an ability used that you got by triggering off some event that fires whenever any ability is used right? well as we found out earlier in the thread theres a hellofa lot of ghost abilities, and the map will lag a lot, but the switch block is gona be the least of the lag problems. but if you could get a triger to fire anytime an ability form the comand card was used and avoid all the ghost abilities constantly being in use, then i wouldn't have a problem. i already know what ability im looking for when im testing for one, so all i need to say is; if (abilityArr[x] != LastUsedAbility) do stuff } else do other stuff; and thats all i need to know.
@Bezerker18: Go and bezerker says hes found a way, but if his way is used theres no way to get that LastUsedAbility. whats your idea btw? i might be able to play around and find something.
Well i was thinking of creating an extra function that returns an ability command.
The function can be added in the the event trigger in place of the ability command you enter on the standard event we are using above.
The idea is to pass on the triggering unit in a parameter to the function then get the ability command of the last used ability by that unit en return that as the return value of the function
After that it would be easy to define on what abilitys it triggers with a condition based ability array.
Oh one other thing i thought of but also restricts your ability's alittle is to use an event that rsponds to property change and then focus on energy used.
Event - any unit uses energy
bla bla bla
Only draw back is you would have to make sure that every abilty uses energy that you want to detect.
@Bezerker18: Go
good ideas, but yeah i have no idea how to get the ability that was sued in either case. but my abilities can be as restricted as you need them to be.
The examples Ive already listed... Should work for exactly what he is doing... If they dont.... then your doing something wrong.
You, are a dick. He saw what you wrote and will take it in as needed. Get over yourself and stop referencing what you already said. Repeating it is just dickish spam.
edit: jk i didnt see how old this was... walks away
This will register all unit using all ability commands at all stage for the trigger "Test".