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

[Solved] Fixing lag when spell casted the first time

Status
Not open for further replies.

Jampion

Code Reviewer
Level 15
Joined
Mar 25, 2016
Messages
1,327
I don't know what this spell does, but usually you can use the spell on map initialization on a dummy unit and then remove the dummy unit afterwards. Something like this:
Create dummy 1
Create dummy 2
add expiration timers of 1 second to every dummy.
add spell to dummy 1
order dummy 1 to use spell on dummy 2
 

Jampion

Code Reviewer
Level 15
Joined
Mar 25, 2016
Messages
1,327
yeah, but I don't know if it's possible here, because abilities cannot be cast on map init as far as I know. I will try to figure out what exactly is causing the lag.

Edit:

Create this trigger or put the actions in a trigger that runs at map initialization.

The ability Dummy Damage, which has 100 levels takes a long time to load. If you load it on map initialization there will be no lag when you use it.

  • Preload
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set TempLoc = (Point(0.00, 0.00))
      • Unit - Create 1 Footman for Neutral Passive at TempLoc facing Default building facing degrees
      • Custom script: call RemoveLocation (udg_TempLoc)
      • Unit - Add Dummy Damage to (Last created unit)
      • Unit - Remove (Last created unit) from the game
 
Last edited:
Status
Not open for further replies.
Top