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

[vJASS] Need help with Call Preload Jass codes

Status
Not open for further replies.
Level 6
Joined
Jun 19, 2010
Messages
143
I am trying to get used to Jass codes fast. JassNewGen provides me a lots of native functions in a drop-down list.

JASS:
//...other functions
function
//...other commands
call Preload("Abilities\\Spells\\Other\\Stampede\\StampedeMissileDeath.mdl")
//...other commands
endfunction

OR simply
JASS:
call Preload("Abilities\\Spells\\Human\\Thunderclap\\ThunderClapCaster.mdl")

I can get this out from
JASS:
native Preload takes string filename returns nothing
I am asking about Call Preload(ability.mdl) because I am not sure what does it use for?, and does it work with ONLY ability/effect type models or any models?. I never know that function from my GUI Knowledge of 7 years and I am new to Jass. . Is there any book, ebook, tutorials or something that guides me on the meanings of native orders, like. call preload uses for & in which cases should I use it, call Preloader, call PreloadStart, etc. Besides, there are quite many Preload like orders as prefix-, see in the function list, and a lot of others orders I don't know them. Though I can read some Jass script and understand common orders by relating them to the ones would be used in GUI.
Thanks for your helps.
 
Level 26
Joined
Aug 18, 2009
Messages
4,097
Where have you read anything about abilities? Models do not have a classification like "effect type". You probably mean the arrangement Blizzard has done in the editor but this is no actual property of the model file.

The preload functions are not commonly used, therefore little is known, do not even know if they work properly etc.

Afaik:
JASS:
native Preload takes string filename returns nothing
loads the resource on the path, this can be models, 2d arts, sounds, probably even scripts or whatever

JASS:
native Preloader takes string filename returns nothing
calls a .pld file, which contains paths that should be preloaded, so just a batch

Wilder guesses:

JASS:
native PreloadStart takes nothing returns nothing
stacks following preload lines, not executing them immediately

JASS:
native PreloadEnd takes real timeout returns nothing
executes the collected preload lines, maybe it's temporally limited or starts after timeout

JASS:
native PreloadEndEx takes nothing returns nothing
executes the collected preload lines

The Gen natives generate a preload file like I stated on Preloader, would be like this:

JASS:
PreloadGenStart()
Preload("path1")
Preload("path2")
Preload("path3")
...
PreloadGenEnd("pathWhereFileShouldBeCreated")

The default directory is Warcraft III\Logs

There is some dangerous exploit with this.

JASS:
native PreloadRefresh takes nothing returns nothing

dunno

Three of the preload functions are available in GUI in Game category.

But if you should really use these functions is another story. You often do not have the paths automatically retrieved and afaik when you load a model for example, it does not load the assigned textures with it. So that's all very inconvenient. Better preload your models via DestroyEffect(AddSpecialEffect(path, 0., 0.)) or by creating object editor objects they are stored in.
 
Level 6
Joined
Jun 19, 2010
Messages
143
Thanks for your reply
let's me correct the question.
Does that work with ONLY ability/effect type mdx/mdl or any mdx/mdl?

Besides, Is there any book, ebook, tutorials or something that guides me on the meanings of native orders? Many call orders/functions from function list are out of my scope. I am using vJassNewGen 5.0d, any chance Jasscraft or other Jass tool could provide tooltip (guiding me what a function uses for) on every function when I do a reference. It could be a bit help when writing Jass script.
 
Level 26
Joined
Aug 18, 2009
Messages
4,097
let's me correct the question.
Does that work with ONLY ability/effect type mdx/mdl or any mdx/mdl?

Let me repeat my answer.
There is no difference between ability/effect models and any other model.

Besides, Is there any book, ebook, tutorials or something that guides me on the meanings of native orders? Many call orders/functions from function list are out of my scope. I am using vJassNewGen 5.0d, any chance Jasscraft or other Jass tool could provide tooltip (guiding me what a function uses for) on every function when I do a reference. It could be a bit help when writing Jass script.

I do not know of any complete list covering all the native functions and constants. Most are understandable by their name and arguments they take. Also, there are so many quirks and such that people did not even discover everything.
 
Status
Not open for further replies.
Top