• 🏆 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!

Code compile errors.

Status
Not open for further replies.
Level 5
Joined
Nov 21, 2014
Messages
151
Hey there everyone, I've been away for 2.5 years or so, and finally found my map back that I had started then. I made a custom race, using a custom build animation, which, at some point in time worked, I remember. But when I loaded up the map and tried it out, I got tons of "Unknown compile errors".

In those 2.5 years I've become an actual programmer, so using those terms would be no issue.

If more information is needed as to where the errors occur precisely, just say the word.
This is the Jass file:

Code:
//TESH.scrollpos=0
//TESH.alwaysfold=0
library DemonBirth initializer Init

    globals
        unit array Dummy
    endglobals

    private function Create takes nothing returns boolean
        local unit u = GetTriggerUnit()
        if GetUnitAbilityLevel(u, udg_Ability) > 0 then
            set Dummy[GetUnitUserData(u)] = CreateUnit(GetTriggerPlayer(), udg_Dummy, GetUnitX(u), GetUnitY(u), 0.00)
            call SetUnitVertexColor(u, 0, 0, 0, 0)
        endif
        set u = null
        return false
    endfunction
   
    private function End takes nothing returns boolean
        local unit u = GetTriggerUnit()
        local integer id
        if GetUnitAbilityLevel(u, udg_Ability) > 0 then
            set id = GetUnitUserData(u)
            call KillUnit(Dummy[id])
            set Dummy[id] = null
            call SetUnitVertexColor(u, 255, 255, 255, 255)
        endif
        set u = null
        return false
    endfunction
   
    private function Death takes nothing returns boolean
        local unit u = GetTriggerUnit()
        local integer id
        if GetUnitAbilityLevel(u, udg_Ability) > 0 then
            set id = GetUnitUserData(u)
            if GetUnitState(Dummy[id], UNIT_STATE_LIFE) > 0 then
                call RemoveUnit(Dummy[id])
            endif
        endif
        set u = null
        return false
    endfunction

    private function Init takes nothing returns nothing
        local trigger t1 = CreateTrigger()
        local trigger t2 = CreateTrigger()
        local trigger t3 = CreateTrigger()
        local integer index = 0
        loop
            call TriggerRegisterPlayerUnitEvent(t1, Player(index), EVENT_PLAYER_UNIT_CONSTRUCT_START, null)
            call TriggerRegisterPlayerUnitEvent(t2, Player(index), EVENT_PLAYER_UNIT_CONSTRUCT_FINISH, null)
            call TriggerRegisterPlayerUnitEvent(t3, Player(index), EVENT_PLAYER_UNIT_DEATH, null)
            set index = index + 1
            exitwhen index == bj_MAX_PLAYER_SLOTS
        endloop
        call TriggerAddCondition(t1, function Create)
        call TriggerAddCondition(t2, function End)
        call TriggerAddCondition(t3, function Death)
        set t1 = null
        set t2 = null
        set t3 = null
    endfunction

endlibrary

Thanks in advance!
 
Level 39
Joined
Feb 27, 2007
Messages
5,011
Don't see any errors there. It just says "unknown compile error"? Does it list a line?

What game version are you running? What editor are you using? (vanilla, JNGP, WEX, something else) If you're using the same editor/installation from 2.5 years ago you may have to update your JASSHelper or pjass. There have also been some significant updates in the past couple years and vJASS is now supported directly in the trigger editor as of 1.30+. I would recommend at the very least going to a 1.29 install.
 
Level 5
Joined
Nov 21, 2014
Messages
151
I'm on 1.3b in the vailla editor and this is what it says:
upload_2018-9-29_2-8-28.png
 
Level 39
Joined
Feb 27, 2007
Messages
5,011
Weird. I would try wiping your install and redownloading the installer. Do you get errors trying to save a blank map with regular JASS (no vJASS features)? What about a blank map with an empty library?

At least with things like the JNGP back in the day pressing test map button didn't actually run the precompiler. Instead you'd have to save first and then hit test map once it had saved. I'm not on 1.30 but I would imagine with vanilla support for vJASS that would have been ironed out by now.
 
Level 5
Joined
Nov 21, 2014
Messages
151
If I disable the trigger, the map runs Just fine. Buy the error doesn't occur in the precompile before the map runs. It actually happens the second you get into the loading screen and immediately kicks you out
 
Level 5
Joined
Nov 21, 2014
Messages
151
Reinstalled wc3 and now when I launch the map, I get into wc3 but get this error:
upload_2018-9-29_11-48-47.png



When pressing OK it throws me to the warcraft 3 menu.
 
Level 5
Joined
Nov 21, 2014
Messages
151
Resolved! I figured this out when I installed a different library and that didnt seem to work either! While on another map it did. So, I figured out that, another trigger had a vjass syntax error, causing it to mess with all other vjass triggers!
 
Resolved! I figured this out when I installed a different library and that didnt seem to work either! While on another map it did. So, I figured out that, another trigger had a vjass syntax error, causing it to mess with all other vjass triggers!

If I had to guess, some parenthesis or block was left unclosed causing everything after it to throw an error.
 
Status
Not open for further replies.
Top