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

[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