• 💀 Happy Halloween! 💀 It's time to vote for the best terrain! Check out the entries to Hive's HD Terrain Contest #2 - Vampire Folklore.❗️Poll closes on November 14, 2023. 🔗Click here to cast your vote!
  • 🏆 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!
  • 🏆 HD Level Design Contest #1 is OPEN! Contestants must create a maze with at least one entry point, and at least one exit point. The map should be made in HD mode, and should not be openable in SD. Only custom models from Hive's HD model and texture sections are allowed. The only exceptions are DNC models and omnilights. This is mainly a visual and design oriented contest, not technical. The UI and video walkthrough rules are there to give everyone an equal shot at victory by standardizing how viewers see the terrain. 🔗Click here to enter!

[Help]Preload

Status
Not open for further replies.
Level 11
Joined
Aug 1, 2009
Messages
714
It is right to preload a unit by
  • Preloading Units
    • Events
    • Conditions
    • Actions
      • Set CP = (Center of Center of the BattleField <gen>)
      • Unit - Create 1 Holy Footman for Neutral Hostile at CP facing Default building facing degrees
      • Unit - Remove (Last created unit) from the game
      • Custom script: call RemoveLocation (udg_CP)
??
 
Level 26
Joined
Aug 18, 2009
Messages
4,097
Of course you can preload it this way. If you would not remove the unit, it would be the same as using it for gameplay, whereas you would identify it as what you want to get rid of (the performance drop).

This loads the unit type's associated data for the first time but I am not sure whether it handles non-primitive things such as the soundset or the attack missile graphic before actually playing/using them.
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
I think if you're making this trigger for a game, I advice you to blacken the game-screen first and cover it up by listing up whole Credits (Creator's Name, Model Credits, bla bla (this is to cover up the lag actually)).
It is wise to do that, it tends to trick the players, and it worked most of the time :)

If you're trying to preload a lot of units at once, I suggest you do the method above
But if it's just 2-3 units, that's okay I think

Another way is preloading it on Loading Screen (making your Loading Time increase, but it preloads handles and objects so when you start the game with a new unit data, the game won't be lagged)

I think WaterKnight used to this JASS command of preloading it on Loading Screen, is it ?
 
Level 26
Joined
Aug 18, 2009
Messages
4,097
Remember that removing units in anyway (even by natural decay) causes a small leak.

This will certainly keep me from preloading them once.

I think WaterKnight used to this JASS command of preloading it on Loading Screen, is it ?

You can do it like above on map initialization too. Maybe you refer to the function native Preload takes string filename returns nothing but this only lets you preload paths like of models or textures and it is kind of inconvenient to preload every little thing this way.

My current project prepares ingame. The loading screen does not allow every function and this way I can observe stuff better how it progresses, what needs how much time for example.
 
Level 11
Joined
Aug 1, 2009
Messages
714
images

:Thinking Hard with my Head:
You're replies are too much complicated to me...
Can someone give me the triggers I need?
 
Status
Not open for further replies.
Top