• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[JASS] idea for spell triggers

Status
Not open for further replies.
Level 13
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:
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:
Level 13
Joined
May 11, 2008
Messages
1,198
ok i edited the first post with tags for you people without world editor...
now since the tags mess with my writing style and i'm not going to rewrite my post...argh...i'll just post the whole trigger here.

JASS:
scope spellsEPUSE initializer I

globals
private integer i
private constant string DIVINITYSTART_EFFECT = "Abilities\\Spells\\Orc\\Reincarnation\\ReincarnationTarget.mdl"
private constant string DIVINITYREAPPEAR_EFFECT = "Abilities\\Spells\\Other\\Monsoon\\MonsoonBoltTarget.mdl"
endglobals

private function epuseherospells takes nothing returns nothing
    local real ux = GetUnitX(GetTriggerUnit())
    local real uy = GetUnitY(GetTriggerUnit())
    local unit u = null
    local effect s = null
    //additionalmovespeedreductiondebilitate
    if i == 'A02P' then
    call TriggerSleepAction( 7.00 )
    call SetUnitMoveSpeed( GetSpellTargetUnit(), ( GetUnitMoveSpeed(GetSpellTargetUnit()) - 135.00 ) )
    call TriggerSleepAction( 4.00 )
    call SetUnitMoveSpeed( GetSpellTargetUnit(), ( GetUnitMoveSpeed(GetSpellTargetUnit()) + 135.00 ) )
    else
    //whirlwindsith
    if i == 'A02Z' then
    set u = CreateUnit(GetOwningPlayer(GetSpellAbilityUnit()), 'o005', GetUnitX(GetSpellTargetUnit()), GetUnitY(GetSpellTargetUnit()), 270.00)
    call SetUnitAbilityLevel(u, 'A02Y', GetUnitAbilityLevel(GetSpellAbilityUnit(),'A02Z'))
    call IssueImmediateOrder(u, "whirlwind")
    call UnitApplyTimedLife(u, 'BTLF', 5.0)
    else
    //sleepunitjeditrance
    if i == 'A030' then
    set u = CreateUnit(GetOwningPlayer(GetTriggerUnit()), 'e000', GetUnitX(GetSpellTargetUnit()), GetUnitY(GetSpellTargetUnit()), 270.00)
    call UnitAddAbility(u, 'A03B')
    call IssueTargetOrder(u, "sleep", GetSpellTargetUnit() )
    call UnitApplyTimedLife(u, 'BTLF', 2.0)
    else
    //frozen divinity spell
    if i == 'A03N' then
    call TriggerSleepAction( 1.267 )//the animation duration for spellcasting
    call ShowUnit (GetTriggerUnit(), false)
    set s = AddSpecialEffect(DIVINITYSTART_EFFECT, ux, uy)
    set u = CreateUnit(GetOwningPlayer(GetTriggerUnit()), 'o006', ux, uy, GetRandomReal(0, 360))
    call UnitApplyTimedLife(u, 'BTLF', 1.80 + (1.00 * GetUnitAbilityLevel(GetTriggerUnit(), 'A03N')))
    call SetUnitAnimation( u, "Birth" )
    call TriggerSleepAction( 1.30 )
    call SetUnitAnimationWithRarity( u, "Stand", RARITY_FREQUENT )
    set u = CreateUnit(GetOwningPlayer(GetTriggerUnit()), 'o008', ux, uy, GetRandomReal(0, 360))
    call UnitApplyTimedLife(u, 'BTLF', 0.50 + (1.00 * GetUnitAbilityLevel(GetTriggerUnit(), 'A03N')))
    call SetUnitAnimation( u, "birth" )
    call TriggerSleepAction( 0.50 )
    call SetUnitAnimationWithRarity( u, "stand", RARITY_FREQUENT )
    call TriggerSleepAction( 1.00 * GetUnitAbilityLevel(GetTriggerUnit(), 'A03N') )
    call DestroyEffect(AddSpecialEffect(DIVINITYREAPPEAR_EFFECT, ux, uy))
    call DestroyEffect(s)
    call CinematicFadeBJ( bj_CINEFADETYPE_FADEIN, 1.00, "ReplaceableTextures\\CameraMasks\\White_mask.blp", 100.00, 100.00, 100.00, 0 )
    call ShowUnit( GetTriggerUnit(), true )
    call SelectUnitForPlayerSingle(GetTriggerUnit(), GetOwningPlayer(GetTriggerUnit()))
    set u = CreateUnit(GetOwningPlayer(GetTriggerUnit()), 'o00A', ux + GetRandomReal(150.00, 800.00) * Cos(GetRandomReal(0, 360) * bj_DEGTORAD), uy + GetRandomReal(150.00, 800.00) * Sin(GetRandomReal(0, 360) * bj_DEGTORAD), GetRandomReal(0, 360))
    call UnitApplyTimedLife(u, 'BTLF', 30.00)
    set u = CreateUnit(GetOwningPlayer(GetTriggerUnit()), 'o00A', ux + GetRandomReal(150.00, 800.00) * Cos(GetRandomReal(0, 360) * bj_DEGTORAD), uy + GetRandomReal(150.00, 800.00) * Sin(GetRandomReal(0, 360) * bj_DEGTORAD), GetRandomReal(0, 360))
    call UnitApplyTimedLife(u, 'BTLF', 30.00)
    set u = CreateUnit(GetOwningPlayer(GetTriggerUnit()), 'o00A', ux + GetRandomReal(150.00, 800.00) * Cos(GetRandomReal(0, 360) * bj_DEGTORAD), uy + GetRandomReal(150.00, 800.00) * Sin(GetRandomReal(0, 360) * bj_DEGTORAD), GetRandomReal(0, 360))
    call UnitApplyTimedLife(u, 'BTLF', 30.00)
    set u = CreateUnit(GetOwningPlayer(GetTriggerUnit()), 'o00A', ux + GetRandomReal(150.00, 800.00) * Cos(GetRandomReal(0, 360) * bj_DEGTORAD), uy + GetRandomReal(150.00, 800.00) * Sin(GetRandomReal(0, 360) * bj_DEGTORAD), GetRandomReal(0, 360))
    call UnitApplyTimedLife(u, 'BTLF', 30.00)
    set u = CreateUnit(GetOwningPlayer(GetTriggerUnit()), 'o00A', ux + GetRandomReal(150.00, 800.00) * Cos(GetRandomReal(0, 360) * bj_DEGTORAD), uy + GetRandomReal(150.00, 800.00) * Sin(GetRandomReal(0, 360) * bj_DEGTORAD), GetRandomReal(0, 360))
    call UnitApplyTimedLife(u, 'BTLF', 30.00)
    set u = CreateUnit(GetOwningPlayer(GetTriggerUnit()), 'o00A', ux + GetRandomReal(150.00, 800.00) * Cos(GetRandomReal(0, 360) * bj_DEGTORAD), uy + GetRandomReal(150.00, 800.00) * Sin(GetRandomReal(0, 360) * bj_DEGTORAD), GetRandomReal(0, 360))
    call UnitApplyTimedLife(u, 'BTLF', 30.00)
    set u = CreateUnit(GetOwningPlayer(GetTriggerUnit()), 'o00A', ux + GetRandomReal(150.00, 800.00) * Cos(GetRandomReal(0, 360) * bj_DEGTORAD), uy + GetRandomReal(150.00, 800.00) * Sin(GetRandomReal(0, 360) * bj_DEGTORAD), GetRandomReal(0, 360))
    call UnitApplyTimedLife(u, 'BTLF', 30.00)
    set u = CreateUnit(GetOwningPlayer(GetTriggerUnit()), 'o00A', ux + GetRandomReal(150.00, 800.00) * Cos(GetRandomReal(0, 360) * bj_DEGTORAD), uy + GetRandomReal(150.00, 800.00) * Sin(GetRandomReal(0, 360) * bj_DEGTORAD), GetRandomReal(0, 360))
    call UnitApplyTimedLife(u, 'BTLF', 30.00)
    set u = CreateUnit(GetOwningPlayer(GetTriggerUnit()), 'o00A', ux + GetRandomReal(150.00, 800.00) * Cos(GetRandomReal(0, 360) * bj_DEGTORAD), uy + GetRandomReal(150.00, 800.00) * Sin(GetRandomReal(0, 360) * bj_DEGTORAD), GetRandomReal(0, 360))
    call UnitApplyTimedLife(u, 'BTLF', 30.00)
    set u = CreateUnit(GetOwningPlayer(GetTriggerUnit()), 'o00A', ux + GetRandomReal(150.00, 800.00) * Cos(GetRandomReal(0, 360) * bj_DEGTORAD), uy + GetRandomReal(150.00, 800.00) * Sin(GetRandomReal(0, 360) * bj_DEGTORAD), GetRandomReal(0, 360))
    call UnitApplyTimedLife(u, 'BTLF', 30.00)
    set u = CreateUnit(GetOwningPlayer(GetTriggerUnit()), 'o00A', ux + GetRandomReal(150.00, 800.00) * Cos(GetRandomReal(0, 360) * bj_DEGTORAD), uy + GetRandomReal(150.00, 800.00) * Sin(GetRandomReal(0, 360) * bj_DEGTORAD), GetRandomReal(0, 360))
    call UnitApplyTimedLife(u, 'BTLF', 30.00)
    set u = CreateUnit(GetOwningPlayer(GetTriggerUnit()), 'o00A', ux + GetRandomReal(150.00, 800.00) * Cos(GetRandomReal(0, 360) * bj_DEGTORAD), uy + GetRandomReal(150.00, 800.00) * Sin(GetRandomReal(0, 360) * bj_DEGTORAD), GetRandomReal(0, 360))
    call UnitApplyTimedLife(u, 'BTLF', 30.00)
    set u = CreateUnit(GetOwningPlayer(GetTriggerUnit()), 'o00A', ux + GetRandomReal(150.00, 800.00) * Cos(GetRandomReal(0, 360) * bj_DEGTORAD), uy + GetRandomReal(150.00, 800.00) * Sin(GetRandomReal(0, 360) * bj_DEGTORAD), GetRandomReal(0, 360))
    call UnitApplyTimedLife(u, 'BTLF', 30.00)
    set u = CreateUnit(GetOwningPlayer(GetTriggerUnit()), 'o00A', ux + GetRandomReal(150.00, 800.00) * Cos(GetRandomReal(0, 360) * bj_DEGTORAD), uy + GetRandomReal(150.00, 800.00) * Sin(GetRandomReal(0, 360) * bj_DEGTORAD), GetRandomReal(0, 360))
    call UnitApplyTimedLife(u, 'BTLF', 30.00)
    set u = CreateUnit(GetOwningPlayer(GetTriggerUnit()), 'o00A', ux + GetRandomReal(150.00, 800.00) * Cos(GetRandomReal(0, 360) * bj_DEGTORAD), uy + GetRandomReal(150.00, 800.00) * Sin(GetRandomReal(0, 360) * bj_DEGTORAD), GetRandomReal(0, 360))
    call UnitApplyTimedLife(u, 'BTLF', 30.00)
    set u = CreateUnit(GetOwningPlayer(GetTriggerUnit()), 'o007', ux + 200 * Cos(270 * bj_DEGTORAD), uy + 200 * Sin(270 * bj_DEGTORAD), GetRandomReal(0, 360))
    call SetUnitAbilityLevel(u, 'A03M', GetUnitAbilityLevel(GetTriggerUnit(),'A03N'))
    call SetUnitAnimationWithRarity( u, "Stand Upgrade First", RARITY_FREQUENT )
    call UnitApplyTimedLife(u, 'BTLF', 30.00)
    else
    //ice nova slow effect
    if i == 'A03O' then
    set u = CreateUnit(GetOwningPlayer(GetSpellAbilityUnit()), 'o009', ux, uy, 270.00)
    call SetUnitAbilityLevel(u, 'A03L', GetUnitAbilityLevel(GetSpellAbilityUnit(),'A03O'))
    call IssueImmediateOrder( u, "thunderclap" )
    call UnitApplyTimedLife(u, 'BTLF', 3.0)
    else
    //graphics for searing light spell
    if i == 'A03P' then
    set u = CreateUnit(GetOwningPlayer(GetSpellAbilityUnit()), 'o00B', ux + 400.00 * Cos(45.00 * bj_DEGTORAD), uy + 400.00 * Sin(45.00 * bj_DEGTORAD), 270.00)
    call UnitApplyTimedLife(u, 'BTLF', 3.0)
    set u = CreateUnit(GetOwningPlayer(GetSpellAbilityUnit()), 'o00B', ux + 400.00 * Cos(45.00 * bj_DEGTORAD), uy + 400.00 * Sin(45.00 * bj_DEGTORAD), 180.00)
    call UnitApplyTimedLife(u, 'BTLF', 3.0)
    set u = CreateUnit(GetOwningPlayer(GetSpellAbilityUnit()), 'o00B', ux + 400.00 * Cos(45.00 * bj_DEGTORAD), uy + 400.00 * Sin(45.00 * bj_DEGTORAD), 225.00)
    call UnitApplyTimedLife(u, 'BTLF', 3.0)
    set u = CreateUnit(GetOwningPlayer(GetSpellAbilityUnit()), 'o00B', ux + 400.00 * Cos(135.00 * bj_DEGTORAD), uy + 400.00 * Sin(135.00 * bj_DEGTORAD), 270.00)
    call UnitApplyTimedLife(u, 'BTLF', 3.0)
    set u = CreateUnit(GetOwningPlayer(GetSpellAbilityUnit()), 'o00B', ux + 400.00 * Cos(135.00 * bj_DEGTORAD), uy + 400.00 * Sin(135.00 * bj_DEGTORAD), 0.00)
    call UnitApplyTimedLife(u, 'BTLF', 3.0)
    set u = CreateUnit(GetOwningPlayer(GetSpellAbilityUnit()), 'o00B', ux + 400.00 * Cos(135.00 * bj_DEGTORAD), uy + 400.00 * Sin(135.00 * bj_DEGTORAD), 315.00)
    call UnitApplyTimedLife(u, 'BTLF', 3.0)
    set u = CreateUnit(GetOwningPlayer(GetSpellAbilityUnit()), 'o00B', ux + 400.00 * Cos(225.00 * bj_DEGTORAD), uy + 400.00 * Sin(225.00 * bj_DEGTORAD), 90.00)
    call UnitApplyTimedLife(u, 'BTLF', 3.0)
    set u = CreateUnit(GetOwningPlayer(GetSpellAbilityUnit()), 'o00B', ux + 400.00 * Cos(225.00 * bj_DEGTORAD), uy + 400.00 * Sin(225.00 * bj_DEGTORAD), 0.00)
    call UnitApplyTimedLife(u, 'BTLF', 3.0)
    set u = CreateUnit(GetOwningPlayer(GetSpellAbilityUnit()), 'o00B', ux + 400.00 * Cos(225.00 * bj_DEGTORAD), uy + 400.00 * Sin(225.00 * bj_DEGTORAD), 45.00)    
    call UnitApplyTimedLife(u, 'BTLF', 3.0)
    set u = CreateUnit(GetOwningPlayer(GetSpellAbilityUnit()), 'o00B', ux + 400.00 * Cos(315.00 * bj_DEGTORAD), uy + 400.00 * Sin(315.00 * bj_DEGTORAD), 90.00)
    call UnitApplyTimedLife(u, 'BTLF', 3.0)
    set u = CreateUnit(GetOwningPlayer(GetSpellAbilityUnit()), 'o00B', ux + 400.00 * Cos(315.00 * bj_DEGTORAD), uy + 400.00 * Sin(315.00 * bj_DEGTORAD), 180.00)
    call UnitApplyTimedLife(u, 'BTLF', 3.0)
    set u = CreateUnit(GetOwningPlayer(GetSpellAbilityUnit()), 'o00B', ux + 400.00 * Cos(315.00 * bj_DEGTORAD), uy + 400.00 * Sin(315.00 * bj_DEGTORAD), 135.00)    
    call UnitApplyTimedLife(u, 'BTLF', 3.0)
    //flame storm slow effect
    else
    if i == 'A00M' then
    if GetFloatGameState(GAME_STATE_TIME_OF_DAY) < 18.00 then
    set u = CreateUnit(GetOwningPlayer(GetSpellAbilityUnit()), 'e000', ux, uy, 270.00)
    call UnitAddAbility(u, 'A00Z')
    call SetUnitAbilityLevel(u, 'A00Z', GetUnitAbilityLevel(GetSpellAbilityUnit(),'A00M'))
    call UnitApplyTimedLife(u, 'BTLF', 5.0)
    endif
    else
    //coldstorm slow effect
    if i == 'A00K' then
    if GetFloatGameState(GAME_STATE_TIME_OF_DAY) >= 18.00 then
    set u = CreateUnit(GetOwningPlayer(GetSpellAbilityUnit()), 'e000', ux, uy, 270.00)
    call UnitAddAbility(u, 'A00Y')
    call SetUnitAbilityLevel(u, 'A00Y', GetUnitAbilityLevel(GetSpellAbilityUnit(),'A00K'))
    call UnitApplyTimedLife(u, 'BTLF', 5.0)
    endif
    endif
    endif
    endif
    endif
    endif
    endif
    endif
    endif
set s = null
set u = null
endfunction

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

//===========================================================================
private function I takes nothing returns nothing
    local trigger t = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( t, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddAction( t, function A )
    call Preload(DIVINITYSTART_EFFECT)     
    call Preload(DIVINITYREAPPEAR_EFFECT)
    //preloading the ability       
    set bj_lastCreatedUnit = CreateUnit(Player(PLAYER_NEUTRAL_PASSIVE), 'e008', 380, 380, 0)    
    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)
    set bj_lastCreatedUnit = CreateUnit(Player(PLAYER_NEUTRAL_PASSIVE), 'e008', 380, 380, 0)    
    call UnitAddAbility(bj_lastCreatedUnit, 'A00K')        
    call KillUnit(bj_lastCreatedUnit)
    set bj_lastCreatedUnit = CreateUnit(Player(PLAYER_NEUTRAL_PASSIVE), 'e008', 380, 380, 0)    
    call UnitAddAbility(bj_lastCreatedUnit, 'A03P')        
    call KillUnit(bj_lastCreatedUnit)
    set bj_lastCreatedUnit = CreateUnit(Player(PLAYER_NEUTRAL_PASSIVE), 'e008', 380, 380, 0)    
    call UnitAddAbility(bj_lastCreatedUnit, 'A03O')        
    call KillUnit(bj_lastCreatedUnit)
    set bj_lastCreatedUnit = CreateUnit(Player(PLAYER_NEUTRAL_PASSIVE), 'e008', 380, 380, 0)
    call UnitAddAbility(bj_lastCreatedUnit, 'A03B')
    call KillUnit(bj_lastCreatedUnit)
    set bj_lastCreatedUnit = CreateUnit(Player(PLAYER_NEUTRAL_PASSIVE), 'e008', 380, 380, 0)
    call UnitAddAbility(bj_lastCreatedUnit, 'A030')
    call KillUnit(bj_lastCreatedUnit)
    set bj_lastCreatedUnit = CreateUnit(Player(PLAYER_NEUTRAL_PASSIVE), 'e008', 380, 380, 0)
    call UnitAddAbility(bj_lastCreatedUnit, 'A02Z')
    call KillUnit(bj_lastCreatedUnit)
    set bj_lastCreatedUnit = CreateUnit(Player(PLAYER_NEUTRAL_PASSIVE), 'e008', 380, 380, 0)
    call UnitAddAbility(bj_lastCreatedUnit, 'A02Y')
    call KillUnit(bj_lastCreatedUnit)
    set bj_lastCreatedUnit = CreateUnit(Player(PLAYER_NEUTRAL_PASSIVE), 'e008', 380, 380, 0)
    call UnitAddAbility(bj_lastCreatedUnit, 'A02P')
    call KillUnit(bj_lastCreatedUnit)
endfunction
endscope

i'm just getting started with this and a couple of spells...mostly the ones with the special effects weren't mine to begin with...if you got any pointers go for it.
 
Level 13
Joined
May 11, 2008
Messages
1,198
*facepalm*, i've never seen anything quite like this.

If you have multiple spells that are the same, use functions for repeated actions, don't mash them all into giant untabbed if/then statements.

Also, jass has something called ELSEIF! Holyshit.

I'm at a loss for words, in all honesty.

whenever i've tried using elseif it doesn't work, why do people keep harping on me about it?

i actually haven't seen any systems that use it.

and what are you talking about, repeated actions? you're not making any sense.

to the other poster, dark dragon, what's so unreadable about it? i have comment triggers explaining where each spell is...if it's an issue of something like the dummy units aren't made to say dummy unit with a global variable corresponding to the unit code, that's bologna, man. if i was looking for, omg, it's so beautiful praise then i'd do something like that. the purpose of programming is to make things work, not make them beautiful. i'll leave that for the modelers and skinners whose work i use in my maps. if you want to take a crack at taking my idea and making it more readable, fine, GO FOR IT. But if all you're saying is the idea itself looks like crap...then your opinion is well noted.
 
Last edited:
Status
Not open for further replies.
Top