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

Indexing Problem

Status
Not open for further replies.
Level 13
Joined
Oct 16, 2010
Messages
737
Hi

I've been making my first indexing system. It's basically meant to allow me to have custom spells with missiles.

It's functions are that it will hit cliffs and rocks, has the option to make it hit units and the plan is that it will have the option to do damage to any unit it passes. This is where my problem is.

Where it is meant to check if there are nearby enemies that haven't been previously damaged it ends up dealing damage to 1 enemy and then the entire missile just dissapears. No idea how or why. I've put in a comment to show where-abouts I think the error is.

  • Move Dummies
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer Index_LoopInteger) from 1 to Index_Max, do (Actions)
        • Loop - Actions
          • Set TempPoint = (Position of Index_Dummy[Index_LoopInteger])
          • -------- If environment is in way --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Terrain pathing at TempPoint of type Walkability is off) Equal to True
            • Then - Actions
              • -------- Kill dummy --------
              • Unit - Kill Index_Dummy[Index_LoopInteger]
              • Trigger - Run Overwrite Index <gen> (checking conditions)
            • Else - Actions
              • -------- Detect if target nearby --------
              • -------- Collide Area --------
              • Set TempUnitGroup = (Units within 50.00 of TempPoint matching ((((Matching unit) is alive) Equal to True) and ((((Matching unit) is A structure) Equal to False) and (((Owner of (Matching unit)) is an enemy of (Owner of Index_Caster[Index_LoopInteger])) Equal to True))))
              • -------- If collision on then damage + kill --------
              • -------- If not damage and continue --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Index_UnitCollision[Index_LoopInteger] Equal to True
                • Then - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Number of units in TempUnitGroup) Greater than or equal to 1
                    • Then - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • Index_AOE[Index_LoopInteger] Equal to 0.00
                        • Then - Actions
                          • Set Damage_TargetUnit = (Random unit from TempUnitGroup)
                          • Trigger - Run Set Variables of DMG <gen> (checking conditions)
                          • Unit - Cause Index_Caster[Index_LoopInteger] to damage Damage_TargetUnit, dealing Damage_Final damage of attack type Chaos and damage type Universal
                          • Trigger - Run Add Status Effects <gen> (checking conditions)
                          • -------- Kill dummy --------
                          • Unit - Kill Index_Dummy[Index_LoopInteger]
                          • Trigger - Run Overwrite Index <gen> (checking conditions)
                        • Else - Actions
                          • Set TempUnitGroup = (Units within Index_AOE[Index_LoopInteger] of TempPoint matching ((((Matching unit) is alive) Equal to True) and ((((Matching unit) is A structure) Equal to False) and ((((Owner of (Matching unit)) is an enemy of (Owner of Index_Caster[Index_LoopInteger])) Eq
                          • Unit Group - Pick every unit in TempUnitGroup and do (Actions)
                            • Loop - Actions
                              • Set Damage_TargetUnit = (Picked unit)
                              • Trigger - Run Set Variables of DMG <gen> (checking conditions)
                              • Unit - Cause Index_Caster[Index_LoopInteger] to damage Damage_TargetUnit, dealing Damage_Final damage of attack type Chaos and damage type Universal
                              • Trigger - Run Add Status Effects <gen> (checking conditions)
                              • Unit Group - Add Damage_TargetUnit to Index_DamagedGroup[Index_LoopInteger]
                    • Else - Actions
                      • -------- If distance less than 0 then stop --------
                      • -------- otherwise move --------
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • Index_Distance[Index_LoopInteger] Less than or equal to 0.00
                        • Then - Actions
                          • -------- Kill dummy --------
                          • Unit - Kill Index_Dummy[Index_LoopInteger]
                          • Trigger - Run Overwrite Index <gen> (checking conditions)
                        • Else - Actions
                          • Unit - Move Index_Dummy[Index_LoopInteger] instantly to (TempPoint offset by 25.00 towards (Facing of Index_Dummy[Index_LoopInteger]) degrees)
                          • Set Index_Distance[Index_LoopInteger] = (Index_Distance[Index_LoopInteger] - 25.00)
                • Else - Actions
                  • -------- SOMEWHERE HERE IS THE PROBLEM --------
                  • -------- Collision is off so DMG to nearby enemies --------
                  • Set TempUnitGroup = (Units within Index_AOE[Index_LoopInteger] of TempPoint matching ((((Matching unit) is alive) Equal to True) and ((((Matching unit) is A structure) Equal to False) and (((Owner of (Matching unit)) is an enemy of (Owner of Index_Caster[Index_LoopInteger])) Equ
                  • Unit Group - Pick every unit in TempUnitGroup and do (Actions)
                    • Loop - Actions
                      • Set Damage_TargetUnit = (Picked unit)
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Damage_TargetUnit is in Index_DamagedGroup[Index_LoopInteger]) Equal to False
                        • Then - Actions
                          • Trigger - Run Set Variables of DMG <gen> (checking conditions)
                          • Unit - Cause Index_Caster[Index_LoopInteger] to damage Damage_TargetUnit, dealing Damage_Final damage of attack type Chaos and damage type Universal
                          • Trigger - Run Add Status Effects <gen> (checking conditions)
                          • Unit Group - Add Damage_TargetUnit to Index_DamagedGroup[Index_LoopInteger]
                          • Game - Display to (All players) the text: 1
                        • Else - Actions
                  • -------- If distance less than 0 then stop --------
                  • -------- otherwise move --------
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Index_Distance[Index_LoopInteger] Less than or equal to 0.00
                    • Then - Actions
                      • -------- Kill dummy --------
                      • Unit - Kill Index_Dummy[Index_LoopInteger]
                      • Trigger - Run Overwrite Index <gen> (checking conditions)
                    • Else - Actions
                      • Unit - Move Index_Dummy[Index_LoopInteger] instantly to (TempPoint offset by 25.00 towards (Facing of Index_Dummy[Index_LoopInteger]) degrees)
                      • Set Index_Distance[Index_LoopInteger] = (Index_Distance[Index_LoopInteger] - 25.00)
          • Custom script: call RemoveLocation(udg_TempPoint)
          • Custom script: call DestroyGroup(udg_TempUnitGroup)

EDIT: I've been playing around with things and it seems that the Damage part of when the missile hurts nearby enemies while moving is what is breaking it. -.-
 
Last edited:
Status
Not open for further replies.
Top