• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

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