| 04-18-2009, 09:16 PM | #1 |
I'm going to explain this: in my few experiences with JASS I'm not using conditions to make actions work, I call them with If/Then/Else statements, example: JASS:function blabla_Actions takes nothing returns nothing if (GetSpellAbilityId() == 'A000') then //Actions here else call DoNothing () //Obviously, not necessary to call nothing, but I'm doing it anyway :P endif endfunction function InitTrig_blabla takes nothing returns nothing set gg_trg_blabla = CreateTrigger() call TriggerRegisterAnyUnitEventBJ(gg_trg_blabla, EVENT_PLAYER_UNIT_SPELL_EFFECT) call TriggerAddAction(gg_trg_blabla, function blabla_Actions) endfunction May seem a silly question, but I'd like to have a clarification. And don't point out that I omitted the "event" part :P EDIT: Added the event part :P |
| 04-18-2009, 10:02 PM | #2 |
AFAIK its slower (since Actions are slower than Conditions, but Actions can use TriggerSleepAction and Conditions cant...) When you dont have any waits in your code, you can write your whole spell in the Condition however (just don add a triggeraction...), that should be slightly faster ... |
| 04-18-2009, 10:13 PM | #3 | |
Quote:
So, "If/Then/Else" is slower compared to "Conditions", because of its existance in "Actions", that is slower than "Conditions". But then I have another question: Is a "Conditions + Actions" trigger faster than a trigger like mine (without Conditions)? |
| 04-18-2009, 10:30 PM | #4 | |
Quote:
Condition with a single if are supposedly faster but I don't think this is really something to care about unless the event runs VERY frequently. |
| 04-18-2009, 10:36 PM | #5 | |
Quote:
![]() |
