• 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.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

[Trigger] Custom Missle Problem

Status
Not open for further replies.
Level 11
Joined
Sep 12, 2008
Messages
657
Hey, im helping a friend at his zombie shooting map..
and im kind of stuck with the missle system, i thought of using hashtables,
but i waned to use the index looping instead..
each time i use the spell, it creates the missle, and shoots it forward..
but when 1 missle ends, it removes all indexing.. (i've made a text to check it.)
and it just stops the whole code..
any help? :D

heres the code:


  • Shoot
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Shoot
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • CBS_Index[1] Equal to 0
        • Then - Actions
          • Trigger - Turn on Shoot Loop <gen>
        • Else - Actions
      • -------- ------------------------------------------------ --------
      • Set CBS_Index[1] = (CBS_Index[1] + 1)
      • Game - Display to (All players) the text: (String(CBS_Index[1]))
      • Set CBS_Index[2] = (CBS_Index[2] + 1)
      • Game - Display to (All players) the text: (String(CBS_Index[2]))
      • -------- ------------------------------------------------ --------
      • Set CBS_DummyType[CBS_Index[2]] = Bullet
      • Set CBS_Speed[CBS_Index[2]] = 600.00
      • Set CBS_DamageAllies[CBS_Index[2]] = False
      • Set CBS_Priority[CBS_Index[2]] = True
      • Set CBS_BloodDamage[CBS_Index[2]] = 35.00
      • Set CBS_KillTrees[CBS_Index[2]] = False
      • Set CBS_TreesKill[CBS_Index[2]] = True
      • Set CBS_MountainsKill[CBS_Index[2]] = True
      • Set CBS_DummyFacing[CBS_Index[2]] = (Facing of (Triggering unit))
      • Set CBS_DummyPoint[CBS_Index[2]] = (Position of (Triggering unit))
  • Shoot Loop
    • Events
      • Time - Every 0.05 seconds of game time
    • Conditions
    • Actions
      • For each (Integer CBS_Index[3]) from 1 to CBS_Index[2], do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • CBS_DummyUnit[CBS_Index[3]] Equal to No unit
            • Then - Actions
              • Unit - Create 1 CBS_DummyType[CBS_Index[3]] for Neutral Passive at CBS_DummyPoint[CBS_Index[3]] facing CBS_DummyFacing[CBS_Index[3]] degrees
              • Set CBS_DummyUnit[CBS_Index[3]] = (Last created unit)
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • CBS_SpeedCheck[CBS_Index[3]] Less than CBS_Speed[CBS_Index[3]]
            • Then - Actions
              • Set CBS_MovePoint = ((Position of CBS_DummyUnit[CBS_Index[3]]) offset by 3.00 towards CBS_DummyFacing[CBS_Index[3]] degrees)
              • Unit - Move CBS_DummyUnit[CBS_Index[3]] instantly to CBS_MovePoint
              • Set CBS_SpeedCheck[CBS_Index[3]] = (CBS_SpeedCheck[CBS_Index[3]] + 3.00)
            • Else - Actions
              • Unit - Kill CBS_DummyUnit[CBS_Index[3]]
              • Set CBS_Index[1] = (CBS_Index[1] - 1)
              • Game - Display to (All players) the text: (String(CBS_Index[1]))
              • Set CBS_DummyUnit[CBS_Index[3]] = No unit
              • Set CBS_SpeedCheck[CBS_Index[3]] = 0.00
              • Set CBS_Speed[CBS_Index[3]] = 0.00
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • CBS_Index[1] Equal to 0
            • Then - Actions
              • Set CBS_Index[2] = 0
              • Trigger - Turn off (This trigger)
            • Else - Actions


thanks in advance =]
 
  • Set CBS_Index[1] = (CBS_Index[1] - 1)
Set that action in the end of the the rest actions, under the "Set CBS_Speed[CBS_Index[3]] = 0.00" one.

P.S.:
  • Set CBS_MovePoint = ((Position of CBS_DummyUnit[CBS_Index[3]]) offset by 3.00 towards CBS_DummyFacing[CBS_Index[3]] degrees)
This one leaks, you need to store the Position of CBS_DummyUnit[].
 
Well... i need 2 diffrent points just for a pollar projection? ;p (w/e its called in gui..)

edit:

this code didnt work either.. still jumps straight to 0.



  • Shoot Loop
    • Events
      • Time - Every 0.05 seconds of game time
    • Conditions
    • Actions
      • For each (Integer CBS_Index[3]) from 1 to CBS_Index[2], do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • CBS_DummyUnit[CBS_Index[3]] Equal to No unit
            • Then - Actions
              • Unit - Create 1 CBS_DummyType[CBS_Index[3]] for Neutral Passive at CBS_DummyPoint[CBS_Index[3]] facing CBS_DummyFacing[CBS_Index[3]] degrees
              • Set CBS_DummyUnit[CBS_Index[3]] = (Last created unit)
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • CBS_SpeedCheck[CBS_Index[3]] Less than CBS_Speed[CBS_Index[3]]
            • Then - Actions
              • Set CBS_DeMovePoint[CBS_Index[3]] = (Position of CBS_DummyUnit[CBS_Index[3]])
              • Set CBS_MovePoint = (CBS_DeMovePoint[CBS_Index[3]] offset by 3.00 towards CBS_DummyFacing[CBS_Index[3]] degrees)
              • Unit - Move CBS_DummyUnit[CBS_Index[3]] instantly to CBS_MovePoint
              • Set CBS_SpeedCheck[CBS_Index[3]] = (CBS_SpeedCheck[CBS_Index[3]] + 3.00)
            • Else - Actions
              • Unit - Kill CBS_DummyUnit[CBS_Index[3]]
              • Set CBS_DummyUnit[CBS_Index[3]] = No unit
              • Set CBS_SpeedCheck[CBS_Index[3]] = 0.00
              • Set CBS_Speed[CBS_Index[3]] = 0.00
              • Set CBS_Index[1] = (CBS_Index[1] - 1)
              • Game - Display to (All players) the text: (String(CBS_Index[1]))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • CBS_Index[1] Equal to 0
            • Then - Actions
              • Set CBS_Index[2] = 0
              • Trigger - Turn off (This trigger)
            • Else - Actions
 
Status
Not open for further replies.
Back
Top