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

[Trigger] Preloading Help :]

Status
Not open for further replies.
Level 10
Joined
May 27, 2009
Messages
494
i want just a little help about this trigger. I want to simplify it and maybe clean it.

And can I also ask, Do I need only to add all the abilities in a dummy unit or add all the abilities in a dummy then preload it? Thanks

I really need this trigger to become clean xD:

JASS:
    call PreloadAbility('A002')
    call PreloadAbility('A003')
    call PreloadAbility('A005')
    call PreloadAbility('A006')
    call RemoveUnit(udg_DummyPreload)
    //Preloading

this is just a sample. But i need to preload lots of abilities so i need a smaller and takes smaller lag thanks
:grin:
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
Where is PreloadAbility coming from? There is a library called xepreload that includes a function for this called XE_PreloadAbility.

To answer your question, preloading an ability means that the ability has been added to a unit that the game must load, for example a preplaced unit. If you are using JNGP then you would be able to create a unit within an initialization function and add the necessary abilities in that function. Either way I suggest you look into xepreload it may alleviate some of the pressure :D
 
Level 10
Joined
May 27, 2009
Messages
494
is that OK if I add the ability even if the unit is already placed at the map then removed it after?.

yeah I try xe preload but i need a cleaner one or the most shorter code... if there are no shorter code. raaa... I gonna go CnP xD

can I also ask if Looping in this is possible???
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
I'm not sure if there is a shorter way, but xepreload isn't slow or anything... the concept behind preloading abilities is pretty static, there isn't a lot of room for inefficient code because it's so straight-forward.

Just to be clear, are you looking for a way of not having to type that but still preloading all of your necessary abilities?
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
Yes, adding the abilities at map initialization to a specific unit will cause them to be preloaded, and after map initialization you would be able to remove them from the unit (but use a 0.00-second timer). This is already what xepreload does. It has a dummy unit that it creates at map initialization, and then the XE_PreloadAbility function to add the ability to the dummy unit so that the game preloads it at map initialization.
 
Level 10
Joined
May 27, 2009
Messages
494
Does I need to add the abilities via the trigger or could I do it even if the abilities are already into the unit itself already...

Their too many @_@

or any code / looping code that uploads/adds the ability. I think it could be done using ability IDs but how ? O,o?
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
If you know the raw-code of the ability then you can add as many abilities to your unit as you want by holding shift then clicking enter with the Abilities field highlighted. It will require you to enter the ability raw-code but there won't be a limit to how many that you can enter.

If this unit is preplaced on the map with all of the abilities that you want to be preloaded then they will be preloaded as soon as the game starts.
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
I'm not sure if abilities are preloaded inside spell books. You can check whether or not the ability is preloaded by whether or not there is a lag on the first cast. There will be a noticeable difference I believe.
 
Level 10
Joined
May 27, 2009
Messages
494
last question xD

If I try to add the ability to the unit by default (the ability is already there on the unit by itself). You said that it would preload once the game starts. Does it will increase the loading phase? or lags at Map Init or 0.00 time second.

And also, could I make it customizable and preload it during a cinematic phase?? O,o?
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
The abilities are all preloaded at the same time, at map initialization. If you're preloading effects and stuff with the Preload() function then you can do it whenever you want. In terms of ability preloading though, it can only be done at map initialization (at which specific point I do not know).
 
Level 10
Joined
May 27, 2009
Messages
494
daa i think they are preloaded at the 99% stage or before the text "PRESS ANY KEY TO CONTINUE" is showned. I tried it up by using the action Player - Force UI Key and it works like DotA's (sry to mention xD) and disables the pressing of the key that usually players never pressed xD

but thanks for everything

this is like a 101 xD

All I need to do is . just... add all the abilities up xD And find out a little faster way to do them

+rep sir!!
 
Level 13
Joined
May 11, 2008
Messages
1,198
is that OK if I add the ability even if the unit is already placed at the map then removed it after?.

can I also ask if Looping in this is possible???

yeah, that's fine. just don't try to add an ability to the unit if it's been removed.
idk what you mean about looping, though.

you keep saying there are too many abilities...

how are there so many? you only need to preload the triggered abilities...
for each one, you do something like making a trigger for them and making an action for the trigger, right? well, since the trigger is made at map initialization, why not preload the ability at that time?
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
SanKakU said:
for each one, you do something like making a trigger for them and making an action for the trigger, right? well, since the trigger is made at map initialization, why not preload the ability at that time?

How many times does it have to be stated that you cannot choose when to preload abilities? It doesn't matter whether you preload the ability in a completely separate function that is dedicated to preloading or in the same function as the spell event is initialized.
 
Level 13
Joined
May 11, 2008
Messages
1,198
How many times does it have to be stated that you cannot choose when to preload abilities? It doesn't matter whether you preload the ability in a completely separate function that is dedicated to preloading or in the same function as the spell event is initialized.

that's not true. heroes' abilities are preloaded either at map initialization, or when you pick the hero. you can choose whether you want to preload abilities for all the heroes, or just the ones that will get played for the game.
What the heck is the point in preloading abilities? I understand preloading strings! This doesn't make any sense.

what do you mean behind preloading strings?
 
Status
Not open for further replies.
Top