• 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.

Jass init trigger not working

Status
Not open for further replies.
Level 2
Joined
Sep 5, 2010
Messages
12
Just got back to wc3 after a year + off, and imported all my triggers in a new map I've been wanting to make for a while. For some reason, though, it won't work (and it seems none of the other jass triggers do either...)

JASS:
library LibraryGlobals initializer Init

    globals
            //HERO VARIABLES
            constant integer STATUP = 'A00N'
            constant integer STATDIS = 'A00W'
            constant integer CONFIRMCHOICE = 'A04C'
            effect HEROGLOW = null
            unit array HERO
            unit array HEROSHOP
            unit array HEROSELECTOR
            unit array STATUNIT
            unit array SKILLUNIT
            integer array STATPOINTS
            integer array SKILLPOINTS
            
            //SHOP VARIABLES
            constant integer ARMORY = 'n00V'
            constant integer MARKETPLACE = 'n006'
            integer ARMCOUNT = 0
            integer TRINKETCOUNT = 12
            integer RNDINTEGER = 0
            integer array ARM
            integer array TRINKET
            
            //MISC. VARIABLES
            constant integer DUMMYID = 'n00E'
            rect MAPENTIRE = null
            rect MAPPLAYABLE = null
            integer array SPAWNID
            real array CAMDIST
            string array COLORSTRING
            weathereffect array WEATHEREFFECT
    endglobals

    private function Init takes nothing returns nothing
        set MAPENTIRE = GetWorldBounds()
        set MAPPLAYABLE = bj_mapInitialPlayableArea
        
        //SET SPAWNID
        set SPAWNID[0] = 'h000' //FOOTMAN
        set SPAWNID[1] = 'n000' //ARCHER
        set SPAWNID[2] = 'n003' //WIZARD
        set SPAWNID[3] = 'o000' //CATAPULT
        set SPAWNID[4] = 'h003' //KNIGHT
        set SPAWNID[5] = 'h009' //RIFLEMAN
        set SPAWNID[6] = 'h00A' //WAR MAGE
        set SPAWNID[7] = 'h008' //MORTAR TEAM
        
        //SET HEROSHOP
        set HEROSHOP[0] = gg_unit_n01H_0013
        set HEROSHOP[1] = gg_unit_n01I_0001
        set HEROSHOP[2] = gg_unit_n01J_0012
        set HEROSHOP[3] = gg_unit_n01G_0016
        set HEROSHOP[4] = gg_unit_n01E_0014
        set HEROSHOP[5] = gg_unit_n01F_0015
        set HEROSHOP[6] = gg_unit_n005_0017
        set HEROSHOP[7] = gg_unit_n00U_0018
        set HEROSHOP[8] = gg_unit_n00O_0019
        
        // SET WEATHEREFFECT
        //set WEATHEREFFECT[0] = AddWeatherEffect(MAPENTIRE, 'RLhr')
        //set WEATHEREFFECT[1] = AddWeatherEffect(MAPENTIRE, 'RLlr')
        //set WEATHEREFFECT[2] = AddWeatherEffect(MAPENTIRE, 'FDwh')
        //set WEATHEREFFECT[3] = AddWeatherEffect(MAPENTIRE, 'SNhs')
        //set WEATHEREFFECT[4] = AddWeatherEffect(MAPENTIRE, 'Snls')
        
        //SET PLAYERCOLORSTRING
        set COLORSTRING[0] = "|cffff0000"
        set COLORSTRING[1] = "|cff0000ff"
        set COLORSTRING[2] = "|cff18e7bd"
        set COLORSTRING[3] = "|cff520084"
        set COLORSTRING[4] = "|cffffff00"
        set COLORSTRING[5] = "|cfffe8a0e"
        set COLORSTRING[6] = "|cff18be00"
        set COLORSTRING[7] = "|cffe759ad"
        set COLORSTRING[8] = "|cff949694"
        set COLORSTRING[9] = "|cff7bbef7"
        set COLORSTRING[10] = "|cff0F6145"
        set COLORSTRING[11] = "|cff4D2903"
    
    endfunction
endlibrary
 
Level 2
Joined
Feb 8, 2011
Messages
31
When I used GetWorldBounds in an initializer for a library, I was sent straight to the main menu during testing. When I put it in a scope, the test went fine.

I wasn't sure what you meant by "it won't work", but I'm assuming that was your problem.
 
Level 2
Joined
Sep 5, 2010
Messages
12
When I used GetWorldBounds in an initializer for a library, I was sent straight to the main menu during testing. When I put it in a scope, the test went fine.

I wasn't sure what you meant by "it won't work", but I'm assuming that was your problem.

Can't remember what scopes are but I erased
JASS:
set MAPENTIRE = GetWorldBounds()
and it still didn't work.
 
Level 2
Joined
Feb 8, 2011
Messages
31
Never mind, my problem was because of something I did.

I can't see anything that would cause problems in that Init function. Are you sure it's the cause?
 
Level 2
Joined
Sep 5, 2010
Messages
12
Never mind, my problem was because of something I did.

I can't see anything that would cause problems in that Init function. Are you sure it's the cause?

Yep, I've disabled every single trigger and it doesn't work. Same for every other jass trigger. If you'd like, I can upload my map.
 
Level 2
Joined
Feb 8, 2011
Messages
31
Yep, I've disabled every single trigger and it doesn't work. Same for every other jass trigger. If you'd like, I can upload my map.

That would be helpful. I used your script and customized it for the test map so there would be no errors and it worked fine.
 
Level 2
Joined
Feb 8, 2011
Messages
31
here you go: http://www.mediafire.com/?ceo6d46adjmglu6

If it works for you, then it must be a problem on my end.

Did a test that creates a footman at the end of the init function. It worked, which means there are no thread crashes which also means that everything should be working in the function. If a variable isn't set to something it should be, then try making a trigger that runs after 0 seconds of game time and set the variable there. I need to go for now.
 
Level 2
Joined
Sep 5, 2010
Messages
12
Did a test that creates a footman at the end of the init function. It worked, which means there are no thread crashes which also means that everything should be working in the function. If a variable isn't set to something it should be, then try making a trigger that runs after 0 seconds of game time and set the variable there. I need to go for now.

I can't. When I save & hit "test map", it just takes me to the TFT menu. I also tsted downloading an old jass map, and it works fine, so I know it's not omy side.
 
Status
Not open for further replies.
Top