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

Spell problem

Status
Not open for further replies.
Level 7
Joined
Feb 18, 2007
Messages
216
So here's my missile spells used by submarine unit:
  • Target
    • Events
      • Unit - A unit Spawns a summoned unit
    • Conditions
      • (Unit-type of (Summoned unit)) Equal to MissileTargeting
    • Actions
      • Set Target[targetnumber] = (Last created unit)
      • Set targetnumber = (targetnumber + 1)
  • Launch1
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Launch Missiles
    • Actions
      • Countdown Timer - Start SubMissileTimer as a One-shot timer that will expire in 60.00 seconds
      • Countdown Timer - Create a timer window for (Last started timer) with title Launch
      • Set SubMissileWindow = (Last created timer window)
  • Launch2
    • Events
      • Time - SubMissileTimer expires
    • Conditions
    • Actions
      • Countdown Timer - Destroy SubMissileWindow
      • For each (Integer A) from 1 to 3, do (Actions)
        • Loop - Actions
          • Unit - Create 1 Dummy for Player 1 (Red) at (Position of SubmarineMissileDummy 0028 <gen>) facing Default building facing degrees
          • Unit - Add a 5.00 second Generic expiration timer to (Last created unit)
          • Unit - Add SubMissileDummy to (Last created unit)
          • Unit - Order (Last created unit) to Neutral Tinker - Cluster Rockets (Position of Target[(Integer A)])
      • Wait 1.00 seconds
      • For each (Integer A) from 1 to 3, do (Actions)
        • Loop - Actions
          • Special Effect - Create a special effect at (Position of Target[(Integer A)]) using Objects\Spawnmodels\Other\NeutralBuildingExplosion\NeutralBuildingExplosion.mdl
Value of "targetnumber" variable is 1. You can set 3 different targets to missiles. So problem is that dummies wont cast cluster rockets based spell to targets. I tried to change casting target to center of playable map area and it worked... So problem is probably on variable. Anyone have an idea how to fix that?
 
Try this:

  • For each (Integer A) from 1 to 3, do (Actions)
    • Loop - Actions
      • Set TempPoint1 = Position of SubmarineMissileDummy 0028 <gen>
      • Set TempPoint2 = Position of Target[(Integer A)]
      • Unit - Create 1 Dummy for Player 1 (Red) at TempPoint1 facing Default building facing degrees
      • Unit - Add a 5.00 second Generic expiration timer to (Last created unit)
      • Unit - Add SubMissileDummy to (Last created unit)
      • Unit - Order (Last created unit) to Neutral Tinker - Cluster Rockets TempPoint2
      • Custom Script: call RemoveLocation blah blah
Otherwise I have no idea what could be wrong.
 
Level 7
Joined
Feb 18, 2007
Messages
216
edge[d1];274744 said:
don't keep units in targets array, as you are doing now. keep targeting locations. units may not be alive or in range after 60s (and quite likely, they wont be)...
Those "target" units have invulnerability and locust, and they can't move anywhere. They're spawned with "spawn tentacle" based ability which has unlimited cast range. And pyritie, that didn't work but thanks anyway.:sad:

EDIT: Just noticed the problem... Line Set Target[targetnumber] = (Last created unit) Should be (Last SUMMONED unit) I am stupid.
 
Last edited:
Status
Not open for further replies.
Top