HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Preloading Abilities

06-30-2006, 09:41 PM#1
Rising_Dusk
For starters, I backsearched both the trigger forum and this one and got a little bit of information on preloading abilities, but I want to confirm it and ask the best way to do it.

From a couple other threads I gathered that if you have a preplaced unit in the editor, give all of a map's abilities to that unit, then remove that unit that it will preload the abilities to get rid of the "first cast lag".

I'm just wondering if that is the correct method to do it, if there is a more efficient/better way to do it, or if that is completely wrong and I have no idea what I am talking about.

Any help would be appreciated.
06-30-2006, 09:46 PM#2
Captain Griffen
From common.j:

Collapse JASS:
native Preload          takes string filename returns nothing
native PreloadEnd       takes real timeout returns nothing

native PreloadStart     takes nothing returns nothing
native PreloadRefresh   takes nothing returns nothing
native PreloadEndEx     takes nothing returns nothing

native PreloadGenClear  takes nothing returns nothing
native PreloadGenStart  takes nothing returns nothing
native PreloadGenEnd    takes string filename returns nothing
native Preloader        takes string filename returns nothing
06-30-2006, 09:47 PM#3
shadow1500
those preload filenames, not abilities.
best way: have a preplaced unit in the editor, give all of a map's abilities to that unit, then remove that unit
06-30-2006, 09:50 PM#4
Rising_Dusk
So give a pre-placed unit all of the map's abilities at map init, then remove the unit.

That is the best method, eh?
And it also removes ALL first cast lag?
06-30-2006, 09:52 PM#5
Captain Griffen
Sort of. It merely moves the 'lag' to map start up, ie: during the loading screen. Loading times a bit longer, but avoids lag spikes on first use of ability (as it is already loaded).
06-30-2006, 09:52 PM#6
shadow1500
if you have laggy special effects you can preload them with those funcs:
Collapse JASS:
call Preload("MyModels\\SomeReallyLaggyModle.mdx")
06-30-2006, 09:54 PM#7
Rising_Dusk
Ok thanks guys.
I'll give it a try and see how it works.

Also, one quick, last question.
Preloading abilities like this also works for abilities that are entirely jass'd, right?
As in the ability itself does nothing, but the trigger for it does everything.
Assuming the ability trigger is leakless and lagless in itself, this method will also eliminate first cast lag from those spells as well?
06-30-2006, 09:56 PM#8
shadow1500
If youre creating special effects then u need to preload them (see my post)
putting dummy units on map init should also clear their lag.
06-30-2006, 09:58 PM#9
Rising_Dusk
Ah perfect.
Thanks much for the help.