HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Is this even possible?

03-12-2008, 02:49 AM#1
darkwulfv
Could it be possible that my WE is making my maps screw up? Here's my problem:

I am not allowed to declare or give anything a value at map init. It just doesn't work. The values come up null or 0, and it happens in more than 1 map. It happens in all of them. Here's a small example of what I try to do.

Collapse JASS:
globals
integer array hax
real number
rect array wee
endglobals

function SetStuffs takes nothing returns nothing
  set hax[1] = 12
  set hax[2] = 13
  set hax[3] = 328472
 
  set number = 2.146

  set wee[0] = gg_rct_Rectlol_1
  set wee[1] = gg_rct_Rectlol_2
endfunction

function Init_SetStuffs takes nothing returns nothing
//generic trigger stuff here (including that it runs at map init)
endfunction

Now, if I try to use hax[1] (or [2] or [3]) somewhere, it defaults to 0 (as if it hadn't been declared). I try to use wee[0] anywhere, I get null. Is this normal behavior? According to both Rising_Dusk and Pyrogasm, this is irregular. It also seems stupid I have to declare this stuff .03 seconds into the game (and if I have a lot of stuff it causes lag)

If you need a clearer explanation, I can try to provide one.
03-12-2008, 03:11 AM#2
Salbrismind
Quote:
Originally Posted by darkwulfv
Could it be possible that my WE is making my maps screw up? Here's my problem:

I am not allowed to declare or give anything a value at map init. It just doesn't work. The values come up null or 0, and it happens in more than 1 map. It happens in all of them. Here's a small example of what I try to do.

Collapse JASS:
globals
integer array hax
real number
rect array wee
endglobals

function SetStuffs takes nothing returns nothing
  set hax[1] = 12
  set hax[2] = 13
  set hax[3] = 328472
 
  set number = 2.146

  set wee[0] = gg_rct_Rectlol_1
  set wee[1] = gg_rct_Rectlol_2
endfunction

function Init_SetStuffs takes nothing returns nothing
//generic trigger stuff here (including that it runs at map init)
endfunction

Now, if I try to use hax[1] (or [2] or [3]) somewhere, it defaults to 0 (as if it hadn't been declared). I try to use wee[0] anywhere, I get null. Is this normal behavior? According to both Rising_Dusk and Pyrogasm, this is irregular. It also seems stupid I have to declare this stuff .03 seconds into the game (and if I have a lot of stuff it causes lag)

If you need a clearer explanation, I can try to provide one.

Does this only happen with numbers? How about units, timers, or other handles? For me personally the unit I set to a variable did not null. Is there a specific instance when this is occurring?: Battle.net or Custom Solo?

Also try to set something in gui and see what happens, cuz that what i'm using right now.
03-12-2008, 03:13 AM#3
darkwulfv
It happens with anything, so far as I've experienced. I have to create all my units after .03 seconds or more in order for them to be picked up by triggers and stuff.
03-12-2008, 03:47 AM#4
Rising_Dusk
I know why.
The "run at map initialization" runs the TRIGGER at map initialization. Because you cleared the inittrig, when it runs the trigger, nothing happens (Since it's never even set to a new trigger). What you should do is the following.

Collapse JASS:
globals
integer array hax
real number
rect array wee
endglobals

function InitTrig_SetStuffs takes nothing returns nothing
    set hax[1] = 12
    set hax[2] = 13
    set hax[3] = 328472
 
    set number = 2.146

    set wee[0] = gg_rct_Rectlol_1
    set wee[1] = gg_rct_Rectlol_2
endfunction
Assuming SetStuffs is the name of your trigger in the trigger editor.
03-12-2008, 04:03 AM#5
darkwulfv
Interesting! I'll give that a try some time. Thanks a lot.