HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Using The preload function

01-13-2004, 12:22 AM#1
weaaddar
While trying to find an easy way to add my code to maps (aparently C-N-Ping alot of text causes worldedit to crash on some people). I figured Preloading wouldn't be a bad idea. Does anyone know if you can iniatiate globals in a preload file? That way I can make it even more readable if so required.
01-13-2004, 03:45 AM#2
dataangel
Um, like holy crap, why didn't I think of that.

On second thought, if you preloaded the file even if war3 recognizes it, it's doubtful that WE will, so it'll be a pain to save :P

Can you just put call functions out in the middle of nowhere in the .j? If so it'd still be useful as a built-in #include feature.
01-13-2004, 12:38 PM#3
KaTTaNa
I believe that preloading only reduces the time it takes to show certain buttons. In melee it loads all the icons for the race you are playing; I think it's to reduce lag.
01-13-2004, 12:45 PM#4
weaaddar
well my idea is set the preloaded funcs in blizz.j (so editor knows them) and just import the preload file for my map.
01-13-2004, 08:36 PM#5
Starcraftfreak
Quote:
Originally posted by KaTTaNa
I believe that preloading only reduces the time it takes to show certain buttons. In melee it loads all the icons for the race you are playing; I think it's to reduce lag.

I think it's used to load texture and model data during map init into the memory, so that there is no big graphical lag at the beginning of the game. Otherwise it would load them, with the in-game interface loaded, which would probably cause intensive lags at the beginning of a game (just think of other games). I think Blizzard solved that problem quite good.

@weaaddar: It seems that you have to test it yourself.
01-13-2004, 11:22 PM#6
dataangel
Eh, you don't need to preload it to use a custom blizzard.j. Just import it and yer done.
01-13-2004, 11:43 PM#7
weaaddar
Err no you don't get me Dataangel. Blizzard.j adds alot of kb to your map.
If you add the functions blizzard.j the worldedit will be fine with them. I then tell it to load my PLD and it should work fine but I don't know if the PLD is really like import in java.
01-14-2004, 06:59 AM#8
PitzerMike
i tried that some months ago but pld files only execute preload commands
01-14-2004, 07:04 PM#9
weaaddar
oh...thanks though.
01-14-2004, 07:48 PM#10
Starcraftfreak
Quote:
Originally posted by PitzerMike
i tried that some months ago but pld files only execute preload commands

The "library" stuff would have been too cool...
01-15-2004, 04:46 AM#11
dataangel
Can't the pld file execute a preload command preloading a .j file? Wonder if that would have any effect.
01-15-2004, 07:59 PM#12
Starcraftfreak
Quote:
Originally posted by dataangel
Can't the pld file execute a preload command preloading a .j file? Wonder if that would have any effect.

I don't think that the functions behaviour depends on the file extension. I think you can try to give it any type, it will always try to execute preload calls.
Though I haven't tested that.