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

How to preload dummies 'Exactly'!

Status
Not open for further replies.
Hello guys,

I've been told that in order to preload a spell, to avoid lag when the custom spell gets used the first time, you have to place the dummy in the map via WE and in the map initialization trigger you should add the custom spell that the dummy uses to the dummy (no need for the dummy to cast the spell). Then, you can remove the dummy from the game.

This what i did.
  • Initialisation Map
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Unit - Add DummySpell1 to Dummy 0071 <gen>
      • Unit - Add DummySpell2 to Dummy 0071 <gen>
      • Unit - Remove Dummy 0071 <gen> from the game
Is this the correct way? Cuz i still get lags and fps drops when the Custom spell is used.

This my custom spell.

  • DP Config
    • Events
      • Time - Elapsed game time is 0.01 seconds
    • Conditions
    • Actions
      • -------- Dummy unit type --------
      • Set DP_Dummy = Dummy
      • -------- Ability that triggers the whole spell --------
      • Set DP_Ability = HeroSpell
      • -------- Ability that the dummy uses --------
      • Set DP_DBuffAbil = DummySpell
  • DP Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to DP_Ability
    • Actions
      • Set TempPointDP = (Position of (Casting unit))
      • Unit - Create 1 DP_Dummy for Neutral Passive at TempPointDP facing Default building facing degrees
      • Set TempDummyDP = (Last created unit)
      • Unit - Add DP_DBuffAbil to TempDummyDP
      • Unit - Order TempDummyDP to Neutral Fire Lord - Soul Burn (Casting unit)
      • Unit - Add a 1.00 second Generic expiration timer to TempDummyDP
      • Custom script: call RemoveLocation (udg_TempPointDP)
Are my triggers fine? Sometimes i even notice some fps drops even after multiple casts of the spell.


Another thing, is it Okay that i'm using the same type of dummy for multiple custom spells? (not the same variable in the triggers but the same unit type)

Please let me know what you think guys and if there's something that i should correct.

Thank you.
 
Level 45
Joined
Feb 27, 2007
Messages
5,578
I've been told that in order to preload a spell, to avoid lag when the custom spell gets used the first time, you have to place the dummy in the map via WE and in the map initialization trigger you should add the custom spell that the dummy uses to the dummy (no need for the dummy to cast the spell). Then, you can remove the dummy from the game.
First there is no reason to have the unit pre-placed in the WE; you can simply create it with triggers, add the spells, and add an expiration timer like you normally do with dummies. There are three types of spell-related first-cast lag, and the solution you have mentioned here addresses one of them by preloading the ability. You have not yet preloaded the special effect model(s) and any associated audio files, which cause(s) additional lag when first loaded. You can use the Preload native for both SFX and sounds, for example: call Preload("Objects\\Spawnmodels\\Naga\\NagaDeath\\NagaDeath.mdl") or call Preload("Sound\\Ambient\\DoodadEffects\\SargerasRoar.wav" ). The other way is to Create and immediately destroy a special effect with the model path you want to preload.

Alternatively you can just make a dummy cast the ability on another dummy at map init.
Another thing, is it Okay that i'm using the same type of dummy for multiple custom spells? (not the same variable in the triggers but the same unit type)
In general you should only need 1 type of dummy unit for your map for all purposes. Multiple is okay but you probably aren't gaining anything by having them.
Are my triggers fine? Sometimes i even notice some fps drops even after multiple casts of the spell.
I don't see anything in that trigger that would cause a problem. You could be leaking things in other triggers though.
 
Status
Not open for further replies.
Top