Rocket Launcer abillity (Kazugas spell), help needed

Furberg

Ultra Cool Member
Reaction score
45
Well i am modifying Kazugas spell, so it'll fit my map better (thanks again kazuga). But this problem has happend. I dont understand why this doesnt work. 2 triggers and the first work. But the second doesnt.

Code:
Rocket launcher
    Events
        Unit - A unit Is issued an order targeting a point
    Conditions
        (Unit-type of (Triggering unit)) Equal to Spaceship
    Actions
           If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                RocketLauncherCounter Greater than or equal to 900
            Then - Actions
                Set RocketLauncherCounter = 2
            Else - Actions
                Set RocketLauncherCounter = (RocketLauncherCounter + 1)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Ability being cast) Equal to Rocket launcher Unchoosable
            Then - Actions
                Set RocketLauncherRocketPoint = (Position of (Triggering unit))
                Set RocketLauncherRocketPoint2 = (Target point of ability being cast)
                Set RocketLauncherDirection[RocketLauncherCounter] = (Angle from RocketLauncherRocketPoint to RocketLauncherRocketPoint2)
                Custom script:   call RemoveLocation(udg_RocketLauncherRocketPoint)
                Custom script:   call RemoveLocation(udg_RocketLauncherRocketPoint2)
            Else - Actions
                Set RocketLauncherDirection[RocketLauncherCounter] = (Facing of (Triggering unit))
        Set RocketLauncherBoolean[RocketLauncherCounter] = True
        Set RocketLauncherCaster[RocketLauncherCounter] = (Triggering unit)
        Set RocketLauncherRocketPoint2 = (Position of (Triggering unit))
        Set RocketLauncherRocketPoint = (RocketLauncherRocketPoint2 offset by 50.00 towards RocketLauncherDirection[RocketLauncherCounter] degrees)
        Custom script:   call RemoveLocation(udg_RocketLauncherRocketPoint2)
        Unit - Create 1 Rocket launcher dummy for (Owner of (Triggering unit)) at RocketLauncherRocketPoint facing RocketLauncherDirection[RocketLauncherCounter] degrees

        Set RocketLauncherRocket[RocketLauncherCounter] = (Last created unit)
        Custom script:   call RemoveLocation(udg_RocketLauncherRocketPoint)
        Trigger - Add to Rocket Triggering <gen> the event (Unit - A unit comes within 100.00 of RocketLauncherRocket[RocketLauncherCounter])
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                RocketLauncherCounter Equal to 1
            Then - Actions
                Countdown Timer - Start RocketLauncherTimer as a Repeating timer that will expire in 0.05 seconds
            Else - Actions
        Wait 0.01 seconds

and

Code:
Rocket launcher Copy
    Events
        Time - Every 0.70 seconds of game time
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                RocketLauncherCounter Greater than or equal to 900
            Then - Actions
                Set RocketLauncherCounter = 2
            Else - Actions
                Set RocketLauncherCounter = (RocketLauncherCounter + 1)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Ability being cast) Equal to Rocket launcher Unchoosable
            Then - Actions
                Set RocketLauncherRocketPoint = (Position of (Triggering unit))
                Set RocketLauncherRocketPoint2 = (Target point of ability being cast)
                Set RocketLauncherDirection[RocketLauncherCounter] = (Angle from RocketLauncherRocketPoint to RocketLauncherRocketPoint2)
                Custom script:   call RemoveLocation(udg_RocketLauncherRocketPoint)
                Custom script:   call RemoveLocation(udg_RocketLauncherRocketPoint2)
            Else - Actions
                Set RocketLauncherDirection[RocketLauncherCounter] = (Facing of (Triggering unit))
        Set RocketLauncherBoolean[RocketLauncherCounter] = True
        Set RocketLauncherCaster[RocketLauncherCounter] = (Random unit from (Units of type Space Invader))
        Set RocketLauncherRocketPoint2 = (Position of (Triggering unit))
        Set RocketLauncherRocketPoint = (RocketLauncherRocketPoint2 offset by 50.00 towards RocketLauncherDirection[RocketLauncherCounter] degrees)
        Custom script:   call RemoveLocation(udg_RocketLauncherRocketPoint2)
        Unit - Create 1 Rocket launcher dummy 2 for (Owner of (Triggering unit)) at RocketLauncherRocketPoint facing RocketLauncherDirection[RocketLauncherCounter] degrees
        Set RocketLauncherRocket[RocketLauncherCounter] = (Last created unit)
        Custom script:   call RemoveLocation(udg_RocketLauncherRocketPoint)
        Trigger - Add to Rocket Triggering <gen> the event (Unit - A unit comes within 100.00 of RocketLauncherRocket[RocketLauncherCounter])
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                RocketLauncherCounter Equal to 1
            Then - Actions
                Countdown Timer - Start RocketLauncherTimer as a Repeating timer that will expire in 0.05 seconds
            Else - Actions
 

manofsteel

New Member
Reaction score
36
Shouldn`t there be a loop in the second trigger and what is this for in the second trigger?:
Code:
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                RocketLauncherCounter Greater than or equal to 900
            Then - Actions
                Set RocketLauncherCounter = 2
            Else - Actions
                Set RocketLauncherCounter = (RocketLauncherCounter + 1)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Ability being cast) Equal to Rocket launcher Unchoosable
            Then - Actions
                Set RocketLauncherRocketPoint = (Position of (Triggering unit))
                Set RocketLauncherRocketPoint2 = (Target point of ability being cast)
                Set RocketLauncherDirection[RocketLauncherCounter] = (Angle from RocketLauncherRocketPoint to RocketLauncherRocketPoint2)
                Custom script:   call RemoveLocation(udg_RocketLauncherRocketPoint)
                Custom script:   call RemoveLocation(udg_RocketLauncherRocketPoint2)
            Else - Actions
 

Furberg

Ultra Cool Member
Reaction score
45
Code:
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                RocketLauncherCounter Greater than or equal to 900
            Then - Actions
                Set RocketLauncherCounter = 2
            Else - Actions
                Set RocketLauncherCounter = (RocketLauncherCounter + 1)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Ability being cast) Equal to Rocket launcher Unchoosable
            Then - Actions
                Set RocketLauncherRocketPoint = (Position of (Triggering unit))
                Set RocketLauncherRocketPoint2 = (Target point of ability being cast)
                Set RocketLauncherDirection[RocketLauncherCounter] = (Angle from RocketLauncherRocketPoint to RocketLauncherRocketPoint2)
                Custom script:   call RemoveLocation(udg_RocketLauncherRocketPoint)
                Custom script:   call RemoveLocation(udg_RocketLauncherRocketPoint2)
            Else - Actions

Thats also in first trigger..
 

Larcenist

REP: Respect, Envy, Prosperity?
Reaction score
211
Why even modify the triggers? Just keep them and create 2 dummy units to cast the spells as they are now.

I.e:

Code:
Events:
A unit is ordered a point order.

Conditions:
Triggering Unit equal to Spaceship.

Actions.
set TempLoc1 = Position of triggering unit
set TempLoc2 = Issued point order
set AngleVariable = Angle between TempLoc1 and TempLoc2
set TempLocArray[1] = TempLoc1 offset by 50 towards (AngleVariable + 90) degrees
set TempLocArray[2] = TempLoc1 offset by 50 towards (AngleVariable - 90) degrees
For each integer A 1 to 2 do actions
loop
Create one Dummy at TempLoc1 facing <facing> degrees
Add Rocket Launcher to last created unit
Order last created unit to <whatever order string  rocket launcher has> TempLocArray[Integer A]
Add a 1 second generic timer to last created unit

Then you remove leaks etc as you wish.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top