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

[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