• 🏆 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] Troubles with missiles

Level 11
Joined
Aug 11, 2009
Messages
594
I am using the relativistic missile system and trying to experiment with it. Basically what I want it to do is shoot an ice missile that when reaching its destination explodes into 8 smaller ice missiles. The problem is only 1 of these 8 are created. I have tried some different variations but nothing has worked so I am out of ideas.

Tried using "MissilePosition" as Start and Finish but didnt work. Made only the "Tour3_IcePoint" variable as Start and Finish, didnt work either. So this was the last attempt with 2 point variables xD

  • CT13 Ice onFinish
    • Events
    • Conditions
    • Actions
      • Set VariableSet Tour3_TempPoint = MissilePosition
      • For each (Integer Tour3_Loop[3]) from 1 to 8, do (Actions)
        • Loop - Actions
          • Game - Display to (All players) the text: (String(Tour3_Loop[3]))
          • Set VariableSet Tour3_IcePoint = Tour3_TempPoint
          • Set VariableSet MissileStart = Tour3_IcePoint
          • Set VariableSet MissileStartZ = 50.00
          • Set VariableSet MissileFinish = (Tour3_IcePoint offset by 1000.00 towards (45.00 x (Real(Tour3_Loop[3]))) degrees.)
          • Set VariableSet MissileFinishZ = 50.00
          • Set VariableSet MissileModel = Abilities\Spells\Other\FrostBolt\FrostBoltMissile.mdl
          • Set VariableSet MissileSpeed = 600.00
          • Set VariableSet MissileSource = Tour_Boss[3]
          • Set VariableSet MissileOwner = (Owner of MissileSource)
          • Set VariableSet MissileCollision = 50.00
          • Set VariableSet Missile_onHit = CT13 Ice onHit <gen>
          • Set VariableSet Missile_onFinish = Missile Destroy onFinish <gen>
          • Trigger - Run MissileCreate <gen> (ignoring conditions)
      • Set VariableSet MissileDestroy = True
 
Last edited:

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,552
When you set Tour3_TempPoint = MissilePosition, you aren't creating a new location, you're simply tracking MissilePosition in another variable.

The Missile System is setup to remove memory leaks when you Run MissileCreate, so it's removing both MissileStart and Tour3_TempPoint (which are the same thing). Your issue is that Missiles 2 -> 8 in your For Loop were referencing that Removed Point as their starting point, and obviously that's going to be a problem since they can't be positioned at "nothing".

To fix this, try storing an offset of MissilePosition instead, since this will create a new location:
  • Set VariableSet Tour3_TempPoint = (MissilePosition offset by 0.00, 0.00)
Or create a new location using the coordinates of MissilePosition:
  • Custom script: set udg_Tour3_TempPoint = Location( GetLocationX(udg_MissilePosition), GetLocationY(udg_MissilePosition) )
You don't need Tour3_IcePoint at all.
 
Last edited:
Level 11
Joined
Aug 11, 2009
Messages
594
Thank you, that worked like a charm!

I think you told me that the system clears all leaks sometime before but obviously i misunderstood then xD

But now I get it and will remember for the future!
 
Top