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

[vJASS] Preload function, what is it exactly?

Status
Not open for further replies.
Level 19
Joined
Oct 12, 2007
Messages
1,821
Hey there.

I have 2 spells in my map that have some problems the first time(s) when I cast them in my map.

The first spell creates a dummy unit that will summon a cloud using the Dragonhawk's cloud spell. The cloud model is a custom model.

The second spell also uses a custom (sfx) model that will appear on the target on impact. It's just a normal Holy Light spell with a different model.

Both those spells cause a little lagspike the first time I cast them, and the 2nd spell stays a little laggy everytime I cast it however the first time it's much worse.

Someone told me about a Preload function for in the code. Is there someone that could describe what that is exactly, and how to use it?

Thanks in advance,
 
Preload the path in an initialization function and it should fix the problem.
JASS:
call Preload("effect\\path.mdl")
Just put in the path of the effect you are using.

It will load it on on init so that it doesn't have the weird lag spike later on. To remove the lag from first loading the ability, however, you have to create a unit on initialization and give them the ability. Check this out:
http://www.wc3c.net/showthread.php?t=105279
 
Status
Not open for further replies.
Top