• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

world editor(Vanilla) crashes when I enable this trigger

Status
Not open for further replies.
Level 4
Joined
Aug 18, 2013
Messages
71
Heys guys, Anytime I enable this trigger in Vanilla world editor, windows brings up the message "World Editor has stopped working" etc. and I have to force close the editor. Any Ideas?
JASS:
function Trig_SplitOneBonusHealth_Actions takes nothing returns nothing
local integer s = GetLearnedSkill()
local integer l = GetLearnedSkillLevel()
local unit u = GetLearningUnit()

if(s == 'A03E') then
    if(l == 2) then
        call UnitAddItem(u,'I02P')
    endif
endif//end if

endfunction

//===========================================================================
function InitTrig_SplitOneBonusHealth takes nothing returns nothing
    local trigger t = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( t, EVENT_PLAYER_HERO_SKILL )
    call TriggerAddAction( t, function Trig_SplitOneBonusHealth_Actions )
    set t = null
endfunction

kinda made me mad as I lost about an hour of coding due to this crash
 
Vanilla WE is kind of weird in response to JASS. For example, if you make a return mismatch, it'll crash (iirc).

In this case, I can't see anything noticeably wrong, but it looks like you've excluded a space between the "if" and the condition:
if(s == 'A03E') then
To:
if (s == 'A03E') then
Do the same for the other if statement. Then see if it doesn't crash. (hell, I don't even remember if this throws an error or not. Probably not as long as you have the parentheses)

Otherwise, you may have to comment the whole thing out, enable it, and then manually uncomment lines and see which one is causing the error.

Pst: For future reference, you may have a much better time coding in JNGP. Coding without it was/is a pain.
 
Last edited:
Status
Not open for further replies.
Top