- Joined
- May 11, 2008
- Messages
- 1,198
so i thought, why not combine multiple spells into one trigger?
so all the triggers that look like this at the bottom:
for them i made them into one trigger, with
then i have
above that i have
so what do you think? with this system i can put all the spells that fire according to epuse ( call TriggerRegisterAnyUnitEventBJ( t, EVENT_PLAYER_UNIT_SPELL_EFFECT ))...all into one trigger.
i noticed one thing i hadn't done but just started doing today is you should preload abilites and special effects so they won't lag the first time you learn them or cast them...that seems to help so i added that...like this:
any thoughts? i like this because i can access my spells so much faster, and less typing is required, i don't have to make some 20 or more spell triggers and i don't have to keep making so many functions if i just check which ability is being used, right? are there any drawbacks to doing this? well, besides making your map easy to read of course this might make that hard but i don't really care about that... JESP i don't like that, it's silly imo. just commentate everything like go
//nameofabilityhere
if i == 'A000' then...
so yeah. the comments obviously can be replaced by the JESP thing though if you want and you could potentially have a huge spellpack in one trigger using this method, even if being JESP i suppose...if i'm not mistaken.
so doing that, you can make spellpack importable by a single trigger then importing triggers is even easier...only hard part will be the importing of the objects...like always, right?
point is...i like doing this because it saves a lot of space in the trigger editor...much less triggers to browse through, and less jumping around from trigger to trigger to make comparisons, helping you to spend less time in the trigger editor than otherwise...enabling you to put more time into it or something else for some purpose other than referencing the spells. so going to just a handful of spell triggers i can see most of the spells using this method.
now would there be any major drawbacks besides the obvious part about making it hard for newbies to withdraw their favorite spells?
it seems like everyone has their own ideas which are very good and i think i have a good idea here, but if i am missing some good points to make it even better, or if i'm missing something unrelated, be sure to let me know if you notice it. thanks guys.
so all the triggers that look like this at the bottom:
JASS:
local trigger t = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( t, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddAction( t, function A )
for them i made them into one trigger, with
JASS:
private function A takes nothing returns nothing
set i = GetSpellAbilityId()
if i == 'A00M' or i == 'A00K' or i == 'A03P' or i == 'A03O' or i == 'A03N' or i == 'A030' or i == 'A02P' or i == 'A02Z' then
call epuseherospells()
endif
endfunction
then i have
JASS:
private function epuseherospells takes nothing returns nothing
local variables here
if i == 'A02P' then
actions
else
if i == 'A03O' then
actions
else
if i == 'A03P' then
else and so on and then some endifs then
//null variables here
endfunction
above that i have
JASS:
globals
private integer i
endglobals
so what do you think? with this system i can put all the spells that fire according to epuse ( call TriggerRegisterAnyUnitEventBJ( t, EVENT_PLAYER_UNIT_SPELL_EFFECT ))...all into one trigger.
i noticed one thing i hadn't done but just started doing today is you should preload abilites and special effects so they won't lag the first time you learn them or cast them...that seems to help so i added that...like this:
JASS:
local trigger t = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( t, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddAction( t, function A )
call Preload(START_EFFECT)
call Preload(REAPPEAR_EFFECT)
//preloading the ability
set bj_lastCreatedUnit = CreateUnit(Player(PLAYER_NEUTRAL_PASSIVE), 'e008', 380, 380, 0)//a tutorial used this, with a global JESP integer instead of my rawcode for my dummy unit, also he used 0,0 for x,y but that spot is out of bounds on my map...
call UnitAddAbility(bj_lastCreatedUnit, 'A03N')
call KillUnit(bj_lastCreatedUnit)
set bj_lastCreatedUnit = CreateUnit(Player(PLAYER_NEUTRAL_PASSIVE), 'e008', 380, 380, 0)
call UnitAddAbility(bj_lastCreatedUnit, 'A00M')
call KillUnit(bj_lastCreatedUnit)
any thoughts? i like this because i can access my spells so much faster, and less typing is required, i don't have to make some 20 or more spell triggers and i don't have to keep making so many functions if i just check which ability is being used, right? are there any drawbacks to doing this? well, besides making your map easy to read of course this might make that hard but i don't really care about that... JESP i don't like that, it's silly imo. just commentate everything like go
//nameofabilityhere
if i == 'A000' then...
so yeah. the comments obviously can be replaced by the JESP thing though if you want and you could potentially have a huge spellpack in one trigger using this method, even if being JESP i suppose...if i'm not mistaken.
so doing that, you can make spellpack importable by a single trigger then importing triggers is even easier...only hard part will be the importing of the objects...like always, right?
point is...i like doing this because it saves a lot of space in the trigger editor...much less triggers to browse through, and less jumping around from trigger to trigger to make comparisons, helping you to spend less time in the trigger editor than otherwise...enabling you to put more time into it or something else for some purpose other than referencing the spells. so going to just a handful of spell triggers i can see most of the spells using this method.
now would there be any major drawbacks besides the obvious part about making it hard for newbies to withdraw their favorite spells?
it seems like everyone has their own ideas which are very good and i think i have a good idea here, but if i am missing some good points to make it even better, or if i'm missing something unrelated, be sure to let me know if you notice it. thanks guys.
Last edited: