• 🏆 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!

Index within an index

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

I have a made a spell and thought the best way to make it was by having two indexes, one within the other.

So basically it generates a gun above the caster that shoots nearby enemies, the gun can vary massively in how it works and what it goes (manufacturer, gun type, element).

So when it fires a bullet that bullet becomes indexed within the gun itself, rather than having a full "bullet" index as I'd have to copy over many of the variables which seems a waste of space.

Anyway I tried using this ability multiplayer and it started to bug out as some bullets would just stop moving entirely, some moved double speed etc.

I'm assuming this is to do with how I've indexed the bullets and how they are de-indexed.

Are there any tutorials and/or tips of how to index within an index as I've never done it before and it works fine with 1 player!

If you need to look at the triggers I'll post them.

Thanks!
 
Level 13
Joined
Oct 16, 2010
Messages
731
Cool thanks, there's 6 triggers overall but only 2 of them deal with the indexing and de-indexing. Have posted them all anyway just incase.

  • GotD Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Weapon of the Day
    • Actions
      • Trigger - Run Challenges The D <gen> (checking conditions)
      • For each (Integer GotD_LoopInt) from 1 to GotD_MaxIndex, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Casting unit) Equal to GotD_CasterUnit[GotD_LoopInt]
            • Then - Actions
              • -------- REMOVE PROJECTILES --------
              • For each (Integer GotD2_LoopInt[GotD_LoopInt]) from 1 to GotD2_MaxIndex[GotD_LoopInt], do (Actions)
                • Loop - Actions
                  • Unit - Kill GotD2_Dummy[GotD2_LoopInt[GotD_LoopInt]]
              • Set GotD2_MaxIndex[GotD_LoopInt] = 0
              • Set GotD_Accuracy[GotD_LoopInt] = GotD_Accuracy[GotD_MaxIndex]
              • Set GotD_CasterUnit[GotD_LoopInt] = GotD_CasterUnit[GotD_MaxIndex]
              • Set GotD_ClipCurrent[GotD_LoopInt] = GotD_ClipCurrent[GotD_MaxIndex]
              • Set GotD_ClipFull[GotD_LoopInt] = GotD_ClipFull[GotD_LoopInt]
              • Set GotD_Damage[GotD_LoopInt] = GotD_Damage[GotD_MaxIndex]
              • Unit - Remove GotD_DummyUnit[GotD_LoopInt] from the game
              • Set GotD_DummyUnit[GotD_LoopInt] = GotD_DummyUnit[GotD_MaxIndex]
              • Set GotD_Element[GotD_LoopInt] = GotD_Element[GotD_MaxIndex]
              • Set GotD_FireRateCurrent[GotD_LoopInt] = GotD_FireRateCurrent[GotD_MaxIndex]
              • Set GotD_FireRateFull[GotD_LoopInt] = GotD_FireRateFull[GotD_MaxIndex]
              • Set GotD_FullAmmo[GotD_LoopInt] = GotD_FullAmmo[GotD_MaxIndex]
              • Set GotD_GunType[GotD_LoopInt] = GotD_GunType[GotD_MaxIndex]
              • Set GotD_Manufacturer[GotD_LoopInt] = GotD_Manufacturer[GotD_MaxIndex]
              • Set GotD_Projectile[GotD_LoopInt] = GotD_Projectile[GotD_MaxIndex]
              • Set GotD_Range[GotD_LoopInt] = GotD_Range[GotD_MaxIndex]
              • Set GotD_ReloadCurrent[GotD_LoopInt] = GotD_ReloadCurrent[GotD_MaxIndex]
              • Set GotD_ReloadFull[GotD_LoopInt] = GotD_ReloadFull[GotD_MaxIndex]
              • Set GotD_TargetUnit[GotD_LoopInt] = GotD_TargetUnit[GotD_MaxIndex]
              • Floating Text - Destroy GotD_Text[GotD_LoopInt]
              • Set GotD_Text[GotD_LoopInt] = GotD_Text[GotD_MaxIndex]
              • For each (Integer GotD2_LoopInt[GotD_MaxIndex]) from 1 to GotD2_MaxIndex[GotD_MaxIndex], do (Actions)
                • Loop - Actions
                  • Set GotD2_Dummy[GotD2_LoopInt[GotD_MaxIndex]] = GotD_DummyUnit[GotD2_LoopInt[GotD_LoopInt]]
                  • Set GotD2_Dmg[GotD2_LoopInt[GotD_MaxIndex]] = GotD2_Dmg[GotD2_LoopInt[Grenade_LoopInt]]
              • Set GotD2_MaxIndex[GotD_LoopInt] = GotD2_MaxIndex[GotD_MaxIndex]
              • -------- END --------
              • Set GotD_MaxIndex = (GotD_MaxIndex - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • GotD_MaxIndex Equal to 0
                • Then - Actions
                  • Trigger - Turn off GotD Loop <gen>
                • Else - Actions
                  • Set GotD_LoopInt = (GotD_LoopInt - 1)
            • Else - Actions
      • -------- HERE WE GO --------
      • Set TempUnit = (Casting unit)
      • Set GotD_MaxIndex = (GotD_MaxIndex + 1)
      • Set GotD_CasterUnit[GotD_MaxIndex] = TempUnit
      • Set GotD_Damage[GotD_MaxIndex] = ((40.00 + (30.00 x (Real((Level of Weapon of the Day for TempUnit))))) + ((Real((Strength of TempUnit (Include bonuses)))) x 0.02))
      • Set GotD_ClipFull[GotD_MaxIndex] = ((12 + (2 x (Level of Weapon of the Day for TempUnit))) + ((Intelligence of TempUnit (Include bonuses)) / 50))
      • Set GotD_FireRateFull[GotD_MaxIndex] = (1.05 - (0.05 x (Real((Level of Weapon of the Day for TempUnit)))))
      • Set GotD_FullAmmo[GotD_MaxIndex] = ((22 + (6 x (Level of Weapon of the Day for TempUnit))) + ((Intelligence of TempUnit (Include bonuses)) / 20))
      • Set GotD_ReloadFull[GotD_MaxIndex] = (4.10 - (0.10 x (Real((Level of Weapon of the Day for TempUnit)))))
      • Set GotD_Range[GotD_MaxIndex] = ((575.00 + (25.00 x (Real((Level of Weapon of the Day for TempUnit))))) + ((Real((Intelligence of TempUnit (Include bonuses)))) x 0.50))
      • Set GotD_Accuracy[GotD_MaxIndex] = (26.50 - (1.50 x (Real((Level of Weapon of the Day for TempUnit)))))
      • Set GotD_TargetUnit[GotD_MaxIndex] = No unit
      • Floating Text - Create floating text that reads GUN above TempUnit with Z offset 0.00, using font size 8.50, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
      • Set GotD_Text[GotD_MaxIndex] = (Last created floating text)
      • Set TempPoint = (Position of TempUnit)
      • -------- RANDOMIZE TYPE, MANUFAC AND ELEMENT --------
      • Trigger - Run GotD Random Type <gen> (checking conditions)
      • Trigger - Run GotD Random Man <gen> (checking conditions)
      • Trigger - Run GotD Random Element <gen> (checking conditions)
      • -------- Tell me what I've got --------
      • Floating Text - Create floating text that reads (GotD_Element[GotD_MaxIndex] + ( + (GotD_Manufacturer[GotD_MaxIndex] + ( + GotD_GunType[GotD_MaxIndex])))) at TempPoint with Z offset 0.00, using font size 12.00, color ((Random real number between 0.00 and 100.00)%, (Random real number between 0.00 and 100.00)%, (Random real number between 0.00 and 100.00)%), and 0.00% transparency
      • Floating Text - Show (Last created floating text) for (All players)
      • Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
      • Floating Text - Change (Last created floating text): Disable permanence
      • Floating Text - Change the lifespan of (Last created floating text) to 5.00 seconds
      • Floating Text - Change the fading age of (Last created floating text) to 4.00 seconds
      • Custom script: call RemoveLocation(udg_TempPoint)
      • -------- MOVING ON --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • GotD_FullAmmo[GotD_MaxIndex] Greater than or equal to GotD_ClipFull[GotD_MaxIndex]
        • Then - Actions
          • Set GotD_ClipCurrent[GotD_MaxIndex] = GotD_ClipFull[GotD_MaxIndex]
        • Else - Actions
          • Set GotD_ClipCurrent[GotD_MaxIndex] = GotD_FullAmmo[GotD_MaxIndex]
      • Set GotD_FireRateCurrent[GotD_MaxIndex] = 0.00
      • Set GotD_ReloadCurrent[GotD_MaxIndex] = 0.00
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • GotD_MaxIndex Equal to 1
        • Then - Actions
          • Trigger - Turn on GotD Loop <gen>
        • Else - Actions
  • GotD Random Type
    • Events
    • Conditions
    • Actions
      • Set TempInt = (Random integer number between 1 and 7)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • TempInt Equal to 1
        • Then - Actions
          • -------- Assault Rifle --------
          • Unit - Create 1 WotD Assault Rifle for (Owner of TempUnit) at TempPoint facing Default building facing degrees
          • Set GotD_DummyUnit[GotD_MaxIndex] = (Last created unit)
          • Set GotD_GunType[GotD_MaxIndex] = Assault Rifle
          • -------- Stats --------
          • Set GotD_Damage[GotD_MaxIndex] = (GotD_Damage[GotD_MaxIndex] x 1.10)
          • Set GotD_Range[GotD_MaxIndex] = (GotD_Range[GotD_MaxIndex] x 1.25)
          • Set GotD_FireRateFull[GotD_MaxIndex] = (GotD_FireRateFull[GotD_MaxIndex] / 0.61)
          • Set GotD_ReloadFull[GotD_MaxIndex] = (GotD_ReloadFull[GotD_MaxIndex] / 0.95)
          • Set GotD_ClipFull[GotD_MaxIndex] = (Integer(((Real(GotD_ClipFull[GotD_MaxIndex])) x 1.20)))
          • Set GotD_Accuracy[GotD_MaxIndex] = (GotD_Accuracy[GotD_MaxIndex] / 1.15)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • TempInt Equal to 2
            • Then - Actions
              • -------- Laser --------
              • Unit - Create 1 WotD Laser for (Owner of TempUnit) at TempPoint facing Default building facing degrees
              • Set GotD_DummyUnit[GotD_MaxIndex] = (Last created unit)
              • Set GotD_GunType[GotD_MaxIndex] = Laser
              • -------- Stats --------
              • Set GotD_Damage[GotD_MaxIndex] = (GotD_Damage[GotD_MaxIndex] x 0.35)
              • Set GotD_Range[GotD_MaxIndex] = (GotD_Range[GotD_MaxIndex] x 1.20)
              • Set GotD_FireRateFull[GotD_MaxIndex] = (GotD_FireRateFull[GotD_MaxIndex] / 2.50)
              • Set GotD_ReloadFull[GotD_MaxIndex] = (GotD_ReloadFull[GotD_MaxIndex] / 1.08)
              • Set GotD_ClipFull[GotD_MaxIndex] = (Integer(((Real(GotD_ClipFull[GotD_MaxIndex])) x 1.20)))
              • Set GotD_Accuracy[GotD_MaxIndex] = (GotD_Accuracy[GotD_MaxIndex] / 0.70)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • TempInt Equal to 3
                • Then - Actions
                  • -------- Pistol --------
                  • Unit - Create 1 WotD Pistol for (Owner of TempUnit) at TempPoint facing Default building facing degrees
                  • Set GotD_DummyUnit[GotD_MaxIndex] = (Last created unit)
                  • Set GotD_GunType[GotD_MaxIndex] = Pistol
                  • -------- Stats --------
                  • Set GotD_Damage[GotD_MaxIndex] = (GotD_Damage[GotD_MaxIndex] x 0.90)
                  • Set GotD_Range[GotD_MaxIndex] = (GotD_Range[GotD_MaxIndex] x 1.20)
                  • Set GotD_FireRateFull[GotD_MaxIndex] = (GotD_FireRateFull[GotD_MaxIndex] / 1.30)
                  • Set GotD_ReloadFull[GotD_MaxIndex] = (GotD_ReloadFull[GotD_MaxIndex] / 1.40)
                  • Set GotD_ClipFull[GotD_MaxIndex] = (Integer(((Real(GotD_ClipFull[GotD_MaxIndex])) x 0.40)))
                  • Set GotD_Accuracy[GotD_MaxIndex] = (GotD_Accuracy[GotD_MaxIndex] / 1.40)
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • TempInt Equal to 4
                    • Then - Actions
                      • -------- Rocket Launcher --------
                      • Unit - Create 1 WotD Rocket Launcher for (Owner of TempUnit) at TempPoint facing Default building facing degrees
                      • Set GotD_DummyUnit[GotD_MaxIndex] = (Last created unit)
                      • Set GotD_GunType[GotD_MaxIndex] = Rocket Launcher
                      • -------- Stats --------
                      • Set GotD_Damage[GotD_MaxIndex] = (GotD_Damage[GotD_MaxIndex] x 15.60)
                      • Set GotD_Range[GotD_MaxIndex] = (GotD_Range[GotD_MaxIndex] x 1.50)
                      • Set GotD_FireRateFull[GotD_MaxIndex] = (GotD_FireRateFull[GotD_MaxIndex] / 0.40)
                      • Set GotD_ReloadFull[GotD_MaxIndex] = (GotD_ReloadFull[GotD_MaxIndex] / 0.40)
                      • Set GotD_ClipFull[GotD_MaxIndex] = (Integer(((Real(GotD_ClipFull[GotD_MaxIndex])) x 0.30)))
                      • Set GotD_Accuracy[GotD_MaxIndex] = (GotD_Accuracy[GotD_MaxIndex] / 0.80)
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • TempInt Equal to 5
                        • Then - Actions
                          • -------- SMG --------
                          • Unit - Create 1 WotD SMG for (Owner of TempUnit) at TempPoint facing Default building facing degrees
                          • Set GotD_DummyUnit[GotD_MaxIndex] = (Last created unit)
                          • Set GotD_GunType[GotD_MaxIndex] = SMG
                          • -------- Stats --------
                          • Set GotD_Damage[GotD_MaxIndex] = (GotD_Damage[GotD_MaxIndex] x 0.77)
                          • Set GotD_Range[GotD_MaxIndex] = (GotD_Range[GotD_MaxIndex] x 0.80)
                          • Set GotD_FireRateFull[GotD_MaxIndex] = (GotD_FireRateFull[GotD_MaxIndex] / 2.01)
                          • Set GotD_ReloadFull[GotD_MaxIndex] = (GotD_ReloadFull[GotD_MaxIndex] / 1.20)
                          • Set GotD_ClipFull[GotD_MaxIndex] = (Integer(((Real(GotD_ClipFull[GotD_MaxIndex])) x 0.82)))
                          • Set GotD_Accuracy[GotD_MaxIndex] = (GotD_Accuracy[GotD_MaxIndex] / 0.90)
                        • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • TempInt Equal to 6
                            • Then - Actions
                              • -------- Shotgun --------
                              • Unit - Create 1 WotD Shotgun for (Owner of TempUnit) at TempPoint facing Default building facing degrees
                              • Set GotD_DummyUnit[GotD_MaxIndex] = (Last created unit)
                              • Set GotD_GunType[GotD_MaxIndex] = Shotgun
                              • -------- Stats --------
                              • Set GotD_Damage[GotD_MaxIndex] = (GotD_Damage[GotD_MaxIndex] x 14.20)
                              • Set GotD_Range[GotD_MaxIndex] = (GotD_Range[GotD_MaxIndex] x 0.40)
                              • Set GotD_FireRateFull[GotD_MaxIndex] = (GotD_FireRateFull[GotD_MaxIndex] / 0.60)
                              • Set GotD_ReloadFull[GotD_MaxIndex] = (GotD_ReloadFull[GotD_MaxIndex] / 0.70)
                              • Set GotD_ClipFull[GotD_MaxIndex] = (Integer(((Real(GotD_ClipFull[GotD_MaxIndex])) x 0.70)))
                              • Set GotD_Accuracy[GotD_MaxIndex] = (GotD_Accuracy[GotD_MaxIndex] / 0.57)
                            • Else - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • TempInt Equal to 7
                                • Then - Actions
                                  • -------- Sniper --------
                                  • Unit - Create 1 WotD Sniper for (Owner of TempUnit) at TempPoint facing Default building facing degrees
                                  • Set GotD_DummyUnit[GotD_MaxIndex] = (Last created unit)
                                  • Set GotD_GunType[GotD_MaxIndex] = Sniper
                                  • -------- Stats --------
                                  • Set GotD_Damage[GotD_MaxIndex] = (GotD_Damage[GotD_MaxIndex] x 2.20)
                                  • Set GotD_Range[GotD_MaxIndex] = (GotD_Range[GotD_MaxIndex] x 2.00)
                                  • Set GotD_FireRateFull[GotD_MaxIndex] = (GotD_FireRateFull[GotD_MaxIndex] / 0.50)
                                  • Set GotD_ReloadFull[GotD_MaxIndex] = (GotD_ReloadFull[GotD_MaxIndex] / 0.50)
                                  • Set GotD_ClipFull[GotD_MaxIndex] = (Integer(((Real(GotD_ClipFull[GotD_MaxIndex])) x 0.50)))
                                  • Set GotD_Accuracy[GotD_MaxIndex] = (GotD_Accuracy[GotD_MaxIndex] / 2.00)
                                • Else - Actions
GotD Random Man
Events
Conditions
Actions
Set TempInt = (Random integer number between 1 and 11)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
TempInt Equal to 1
Then - Actions
-------- Hyperion --------
Set GotD_Manufacturer[GotD_MaxIndex] = Hyperion
Animation - Change GotD_DummyUnit[GotD_MaxIndex]'s vertex coloring to (100.00%, 50.00%, 100.00%) with 0.00% transparency
-------- Stats --------
Set GotD_Damage[GotD_MaxIndex] = (GotD_Damage[GotD_MaxIndex] x 0.65)
Set GotD_Range[GotD_MaxIndex] = (GotD_Range[GotD_MaxIndex] x 0.79)
Set GotD_FireRateFull[GotD_MaxIndex] = (GotD_FireRateFull[GotD_MaxIndex] / 1.30)
Set GotD_ReloadFull[GotD_MaxIndex] = (GotD_ReloadFull[GotD_MaxIndex] / 1.09)
Set GotD_ClipFull[GotD_MaxIndex] = (Integer(((Real(GotD_ClipFull[GotD_MaxIndex])) x 0.65)))
Set GotD_Accuracy[GotD_MaxIndex] = (GotD_Accuracy[GotD_MaxIndex] / 2.00)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
TempInt Equal to 2
Then - Actions
-------- Bandit --------
Set GotD_Manufacturer[GotD_MaxIndex] = Bandit
Animation - Change GotD_DummyUnit[GotD_MaxIndex]'s vertex coloring to (100.00%, 40.00%, 40.00%) with 0.00% transparency
-------- Stats --------
Set GotD_Damage[GotD_MaxIndex] = (GotD_Damage[GotD_MaxIndex] x 1.93)
Set GotD_Range[GotD_MaxIndex] = (GotD_Range[GotD_MaxIndex] x 0.95)
Set GotD_FireRateFull[GotD_MaxIndex] = (GotD_FireRateFull[GotD_MaxIndex] / 0.80)
Set GotD_ReloadFull[GotD_MaxIndex] = (GotD_ReloadFull[GotD_MaxIndex] / 0.50)
Set GotD_ClipFull[GotD_MaxIndex] = (Integer(((Real(GotD_ClipFull[GotD_MaxIndex])) x 2.50)))
Set GotD_Accuracy[GotD_MaxIndex] = (GotD_Accuracy[GotD_MaxIndex] / 0.60)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
TempInt Equal to 3
Then - Actions
-------- Maliwan --------
Set GotD_Manufacturer[GotD_MaxIndex] = Maliwan
Animation - Change GotD_DummyUnit[GotD_MaxIndex]'s vertex coloring to (60.00%, 100.00%, 60.00%) with 0.00% transparency
-------- Stats --------
Set GotD_Damage[GotD_MaxIndex] = (GotD_Damage[GotD_MaxIndex] x 0.78)
Set GotD_Range[GotD_MaxIndex] = (GotD_Range[GotD_MaxIndex] x 1.05)
Set GotD_FireRateFull[GotD_MaxIndex] = (GotD_FireRateFull[GotD_MaxIndex] / 1.20)
Set GotD_ReloadFull[GotD_MaxIndex] = (GotD_ReloadFull[GotD_MaxIndex] / 0.90)
Set GotD_ClipFull[GotD_MaxIndex] = (Integer(((Real(GotD_ClipFull[GotD_MaxIndex])) x 0.85)))
Set GotD_Accuracy[GotD_MaxIndex] = (GotD_Accuracy[GotD_MaxIndex] / 1.20)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
TempInt Equal to 4
Then - Actions
-------- Tediore --------
Set GotD_Manufacturer[GotD_MaxIndex] = Tediore
Animation - Change GotD_DummyUnit[GotD_MaxIndex]'s vertex coloring to (60.00%, 80.00%, 100.00%) with 0.00% transparency
-------- Stats --------
Set GotD_Damage[GotD_MaxIndex] = (GotD_Damage[GotD_MaxIndex] x 0.60)
Set GotD_Range[GotD_MaxIndex] = (GotD_Range[GotD_MaxIndex] x 0.84)
Set GotD_FireRateFull[GotD_MaxIndex] = (GotD_FireRateFull[GotD_MaxIndex] / 1.50)
Set GotD_ReloadFull[GotD_MaxIndex] = (GotD_ReloadFull[GotD_MaxIndex] / 1.80)
Set GotD_ClipFull[GotD_MaxIndex] = (Integer(((Real(GotD_ClipFull[GotD_MaxIndex])) x 0.60)))
Set GotD_Accuracy[GotD_MaxIndex] = (GotD_Accuracy[GotD_MaxIndex] / 1.10)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
TempInt Equal to 5
GotD_GunType[GotD_MaxIndex] Not equal to Laser
Then - Actions
-------- Jacobs --------
Set GotD_Manufacturer[GotD_MaxIndex] = Jacobs
Animation - Change GotD_DummyUnit[GotD_MaxIndex]'s vertex coloring to (50.00%, 50.00%, 50.00%) with 0.00% transparency
-------- Stats --------
Set GotD_Damage[GotD_MaxIndex] = (GotD_Damage[GotD_MaxIndex] x 2.49)
Set GotD_Range[GotD_MaxIndex] = (GotD_Range[GotD_MaxIndex] x 1.50)
Set GotD_FireRateFull[GotD_MaxIndex] = (GotD_FireRateFull[GotD_MaxIndex] / 0.56)
Set GotD_ReloadFull[GotD_MaxIndex] = (GotD_ReloadFull[GotD_MaxIndex] / 0.55)
Set GotD_ClipFull[GotD_MaxIndex] = (Integer(((Real(GotD_ClipFull[GotD_MaxIndex])) x 0.64)))
Set GotD_Accuracy[GotD_MaxIndex] = (GotD_Accuracy[GotD_MaxIndex] / 1.50)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
TempInt Equal to 6
GotD_GunType[GotD_MaxIndex] Not equal to Laser
Then - Actions
-------- Torgue --------
Set GotD_Manufacturer[GotD_MaxIndex] = Torgue
Animation - Change GotD_DummyUnit[GotD_MaxIndex]'s vertex coloring to (100.00%, 80.00%, 30.00%) with 0.00% transparency
-------- Stats --------
Set GotD_Damage[GotD_MaxIndex] = (GotD_Damage[GotD_MaxIndex] x 1.63)
Set GotD_Range[GotD_MaxIndex] = (GotD_Range[GotD_MaxIndex] x 0.80)
Set GotD_FireRateFull[GotD_MaxIndex] = (GotD_FireRateFull[GotD_MaxIndex] / 0.90)
Set GotD_ReloadFull[GotD_MaxIndex] = (GotD_ReloadFull[GotD_MaxIndex] / 0.90)
Set GotD_ClipFull[GotD_MaxIndex] = (Integer(((Real(GotD_ClipFull[GotD_MaxIndex])) x 0.90)))
Set GotD_Accuracy[GotD_MaxIndex] = (GotD_Accuracy[GotD_MaxIndex] / 1.00)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
TempInt Equal to 7
Then - Actions
-------- Vladof --------
Set GotD_Manufacturer[GotD_MaxIndex] = Vladof
Animation - Change GotD_DummyUnit[GotD_MaxIndex]'s vertex coloring to (80.00%, 30.00%, 30.00%) with 0.00% transparency
-------- Stats --------
Set GotD_Damage[GotD_MaxIndex] = (GotD_Damage[GotD_MaxIndex] x 1.20)
Set GotD_Range[GotD_MaxIndex] = (GotD_Range[GotD_MaxIndex] x 1.00)
Set GotD_FireRateFull[GotD_MaxIndex] = (GotD_FireRateFull[GotD_MaxIndex] / 1.25)
Set GotD_ReloadFull[GotD_MaxIndex] = (GotD_ReloadFull[GotD_MaxIndex] / 0.92)
Set GotD_ClipFull[GotD_MaxIndex] = (Integer(((Real(GotD_ClipFull[GotD_MaxIndex])) x 0.94)))
Set GotD_Accuracy[GotD_MaxIndex] = (GotD_Accuracy[GotD_MaxIndex] / 0.85)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
TempInt Equal to 8
Then - Actions
-------- Dahl --------
Set GotD_Manufacturer[GotD_MaxIndex] = Dahl
Animation - Change GotD_DummyUnit[GotD_MaxIndex]'s vertex coloring to (80.00%, 80.00%, 100.00%) with 0.00% transparency
-------- Stats --------
Set GotD_Damage[GotD_MaxIndex] = (GotD_Damage[GotD_MaxIndex] x 1.03)
Set GotD_Range[GotD_MaxIndex] = (GotD_Range[GotD_MaxIndex] x 1.00)
Set GotD_FireRateFull[GotD_MaxIndex] = (GotD_FireRateFull[GotD_MaxIndex] / 0.85)
Set GotD_ReloadFull[GotD_MaxIndex] = (GotD_ReloadFull[GotD_MaxIndex] / 0.94)
Set GotD_ClipFull[GotD_MaxIndex] = (Integer(((Real(GotD_ClipFull[GotD_MaxIndex])) x 0.92)))
Set GotD_Accuracy[GotD_MaxIndex] = (GotD_Accuracy[GotD_MaxIndex] / 1.25)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
TempInt Equal to 9
(Random integer number between 1 and 3) Equal to 1
Then - Actions
-------- ATLAS --------
Set GotD_Manufacturer[GotD_MaxIndex] = ATLAS
Animation - Change GotD_DummyUnit[GotD_MaxIndex]'s vertex coloring to (0.00%, 100.00%, 100.00%) with 0.00% transparency
-------- Stats --------
Set GotD_Damage[GotD_MaxIndex] = (GotD_Damage[GotD_MaxIndex] x 1.20)
Set GotD_Range[GotD_MaxIndex] = (GotD_Range[GotD_MaxIndex] x 1.00)
Set GotD_FireRateFull[GotD_MaxIndex] = (GotD_FireRateFull[GotD_MaxIndex] / 1.09)
Set GotD_ReloadFull[GotD_MaxIndex] = (GotD_ReloadFull[GotD_MaxIndex] / 1.00)
Set GotD_ClipFull[GotD_MaxIndex] = (Integer(((Real(GotD_ClipFull[GotD_MaxIndex])) x 1.00)))
Set GotD_Accuracy[GotD_MaxIndex] = (GotD_Accuracy[GotD_MaxIndex] / 1.15)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
TempInt Equal to 10
(Random integer number between 1 and 2) Equal to 1
Then - Actions
-------- ETEC --------
Set GotD_Manufacturer[GotD_MaxIndex] = ETEC
Animation - Change GotD_DummyUnit[GotD_MaxIndex]'s vertex coloring to (80.00%, 50.00%, 80.00%) with 0.00% transparency
-------- Stats --------
Set GotD_Damage[GotD_MaxIndex] = (GotD_Damage[GotD_MaxIndex] x 0.68)
Set GotD_Range[GotD_MaxIndex] = (GotD_Range[GotD_MaxIndex] x 1.00)
Set GotD_FireRateFull[GotD_MaxIndex] = (GotD_FireRateFull[GotD_MaxIndex] / 1.15)
Set GotD_ReloadFull[GotD_MaxIndex] = (GotD_ReloadFull[GotD_MaxIndex] / 0.80)
Set GotD_ClipFull[GotD_MaxIndex] = (Integer(((Real(GotD_ClipFull[GotD_MaxIndex])) x 2.00)))
Set GotD_Accuracy[GotD_MaxIndex] = (GotD_Accuracy[GotD_MaxIndex] / 1.00)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
TempInt Equal to 11
Then - Actions
-------- S&S --------
Set GotD_Manufacturer[GotD_MaxIndex] = S&S
Animation - Change GotD_DummyUnit[GotD_MaxIndex]'s vertex coloring to (80.00%, 50.00%, 80.00%) with 0.00% transparency
-------- Stats --------
Set GotD_Damage[GotD_MaxIndex] = (GotD_Damage[GotD_MaxIndex] x 2.00)
Set GotD_Range[GotD_MaxIndex] = (GotD_Range[GotD_MaxIndex] x 0.95)
Set GotD_FireRateFull[GotD_MaxIndex] = (GotD_FireRateFull[GotD_MaxIndex] / 1.19)
Set GotD_ReloadFull[GotD_MaxIndex] = (GotD_ReloadFull[GotD_MaxIndex] / 0.81)
Set GotD_ClipFull[GotD_MaxIndex] = (Integer(((Real(GotD_ClipFull[GotD_MaxIndex])) x 1.00)))
Set GotD_Accuracy[GotD_MaxIndex] = (GotD_Accuracy[GotD_MaxIndex] / 0.60)
Else - Actions
Trigger - Run (This trigger) (checking conditions)


GotD Random Element
Events
Conditions
Actions
Set TempInt = (Random integer number between 1 and 6)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
TempInt Equal to 1
GotD_GunType[GotD_MaxIndex] Not equal to Rocket Launcher
GotD_GunType[GotD_MaxIndex] Not equal to Laser
GotD_Manufacturer[GotD_MaxIndex] Not equal to Maliwan
GotD_Manufacturer[GotD_MaxIndex] Not equal to Torgue
Then - Actions
-------- Non-Elemental --------
Set GotD_Element[GotD_MaxIndex] = Non-Elemental
Floating Text - Change the color of GotD_Text[GotD_MaxIndex] to (80.00%, 80.00%, 80.00%) with 0.00% transparency
-------- Stats --------
Set GotD_Damage[GotD_MaxIndex] = (GotD_Damage[GotD_MaxIndex] x 1.11)
Set GotD_Range[GotD_MaxIndex] = (GotD_Range[GotD_MaxIndex] x 1.04)
Set GotD_FireRateFull[GotD_MaxIndex] = (GotD_FireRateFull[GotD_MaxIndex] / 1.00)
Set GotD_ReloadFull[GotD_MaxIndex] = (GotD_ReloadFull[GotD_MaxIndex] / 1.00)
Set GotD_ClipFull[GotD_MaxIndex] = (Integer(((Real(GotD_ClipFull[GotD_MaxIndex])) x 1.00)))
Set GotD_Accuracy[GotD_MaxIndex] = (GotD_Accuracy[GotD_MaxIndex] / 1.00)
-------- Projectile --------
Set GotD_Projectile[GotD_MaxIndex] = WotD Bullet (Non-Elemental)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
TempInt Equal to 2
GotD_GunType[GotD_MaxIndex] Not equal to Laser
GotD_Manufacturer[GotD_MaxIndex] Not equal to Maliwan
Or - Any (Conditions) are true
Conditions
GotD_Manufacturer[GotD_MaxIndex] Not equal to Jacobs
And - All (Conditions) are true
Conditions
GotD_Manufacturer[GotD_MaxIndex] Equal to Jacobs
GotD_GunType[GotD_MaxIndex] Equal to Rocket Launcher
Or - Any (Conditions) are true
Conditions
GotD_Manufacturer[GotD_MaxIndex] Not equal to ETEC
And - All (Conditions) are true
Conditions
GotD_Manufacturer[GotD_MaxIndex] Equal to ETEC
GotD_GunType[GotD_MaxIndex] Equal to Rocket Launcher
Then - Actions
-------- Explosive --------
Set GotD_Element[GotD_MaxIndex] = Explosive
Floating Text - Change the color of GotD_Text[GotD_MaxIndex] to (80.00%, 80.00%, 30.00%) with 0.00% transparency
-------- Stats --------
Set GotD_Damage[GotD_MaxIndex] = (GotD_Damage[GotD_MaxIndex] x 1.35)
Set GotD_Range[GotD_MaxIndex] = (GotD_Range[GotD_MaxIndex] x 1.00)
Set GotD_FireRateFull[GotD_MaxIndex] = (GotD_FireRateFull[GotD_MaxIndex] / 0.78)
Set GotD_ReloadFull[GotD_MaxIndex] = (GotD_ReloadFull[GotD_MaxIndex] / 0.88)
Set GotD_ClipFull[GotD_MaxIndex] = (Integer(((Real(GotD_ClipFull[GotD_MaxIndex])) x 0.95)))
Set GotD_Accuracy[GotD_MaxIndex] = (GotD_Accuracy[GotD_MaxIndex] / 0.85)
-------- Projectile --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
GotD_GunType[GotD_MaxIndex] Equal to Rocket Launcher
Then - Actions
Set GotD_Projectile[GotD_MaxIndex] = WotD Rocket (Explosive)
Else - Actions
Set GotD_Projectile[GotD_MaxIndex] = WotD Bullet (Explosive)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
TempInt Equal to 3
GotD_Manufacturer[GotD_MaxIndex] Not equal to Jacobs
GotD_Manufacturer[GotD_MaxIndex] Not equal to Torgue
Then - Actions
-------- Incendiary --------
Set GotD_Element[GotD_MaxIndex] = Incendiary
Floating Text - Change the color of GotD_Text[GotD_MaxIndex] to (80.00%, 30.00%, 30.00%) with 0.00% transparency
-------- Stats --------
Set GotD_Damage[GotD_MaxIndex] = (GotD_Damage[GotD_MaxIndex] x 1.00)
Set GotD_Range[GotD_MaxIndex] = (GotD_Range[GotD_MaxIndex] x 0.95)
Set GotD_FireRateFull[GotD_MaxIndex] = (GotD_FireRateFull[GotD_MaxIndex] / 1.11)
Set GotD_ReloadFull[GotD_MaxIndex] = (GotD_ReloadFull[GotD_MaxIndex] / 0.90)
Set GotD_ClipFull[GotD_MaxIndex] = (Integer(((Real(GotD_ClipFull[GotD_MaxIndex])) x 1.00)))
Set GotD_Accuracy[GotD_MaxIndex] = (GotD_Accuracy[GotD_MaxIndex] / 1.00)
-------- Projectile --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
GotD_GunType[GotD_MaxIndex] Equal to Rocket Launcher
Then - Actions
Set GotD_Projectile[GotD_MaxIndex] = WotD Rocket (Incendiary)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
GotD_GunType[GotD_MaxIndex] Equal to Laser
Then - Actions
Set GotD_Projectile[GotD_MaxIndex] = WotD Laser (Incendiary)
Else - Actions
Set GotD_Projectile[GotD_MaxIndex] = WotD Bullet (Incendiary)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
TempInt Equal to 4
GotD_Manufacturer[GotD_MaxIndex] Not equal to Jacobs
GotD_Manufacturer[GotD_MaxIndex] Not equal to Torgue
Then - Actions
-------- Shock --------
Set GotD_Element[GotD_MaxIndex] = Shock
Floating Text - Change the color of GotD_Text[GotD_MaxIndex] to (30.00%, 30.00%, 80.00%) with 0.00% transparency
-------- Stats --------
Set GotD_Damage[GotD_MaxIndex] = (GotD_Damage[GotD_MaxIndex] x 0.82)
Set GotD_Range[GotD_MaxIndex] = (GotD_Range[GotD_MaxIndex] x 1.05)
Set GotD_FireRateFull[GotD_MaxIndex] = (GotD_FireRateFull[GotD_MaxIndex] / 1.00)
Set GotD_ReloadFull[GotD_MaxIndex] = (GotD_ReloadFull[GotD_MaxIndex] / 1.00)
Set GotD_ClipFull[GotD_MaxIndex] = (Integer(((Real(GotD_ClipFull[GotD_MaxIndex])) x 1.00)))
Set GotD_Accuracy[GotD_MaxIndex] = (GotD_Accuracy[GotD_MaxIndex] / 1.10)
-------- Projectile --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
GotD_GunType[GotD_MaxIndex] Equal to Rocket Launcher
Then - Actions
Set GotD_Projectile[GotD_MaxIndex] = WotD Rocket (Shock)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
GotD_GunType[GotD_MaxIndex] Equal to Laser
Then - Actions
Set GotD_Projectile[GotD_MaxIndex] = WotD Laser (Shock)
Else - Actions
Set GotD_Projectile[GotD_MaxIndex] = WotD Bullet (Shock)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
TempInt Equal to 5
GotD_Manufacturer[GotD_MaxIndex] Not equal to Jacobs
GotD_Manufacturer[GotD_MaxIndex] Not equal to Torgue
Then - Actions
-------- Corrosive --------
Set GotD_Element[GotD_MaxIndex] = Corrosive
Floating Text - Change the color of GotD_Text[GotD_MaxIndex] to (30.00%, 80.00%, 30.00%) with 0.00% transparency
-------- Stats --------
Set GotD_Damage[GotD_MaxIndex] = (GotD_Damage[GotD_MaxIndex] x 1.11)
Set GotD_Range[GotD_MaxIndex] = (GotD_Range[GotD_MaxIndex] x 1.00)
Set GotD_FireRateFull[GotD_MaxIndex] = (GotD_FireRateFull[GotD_MaxIndex] / 0.90)
Set GotD_ReloadFull[GotD_MaxIndex] = (GotD_ReloadFull[GotD_MaxIndex] / 0.90)
Set GotD_ClipFull[GotD_MaxIndex] = (Integer(((Real(GotD_ClipFull[GotD_MaxIndex])) x 1.00)))
Set GotD_Accuracy[GotD_MaxIndex] = (GotD_Accuracy[GotD_MaxIndex] / 1.00)
-------- Projectile --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
GotD_GunType[GotD_MaxIndex] Equal to Rocket Launcher
Then - Actions
Set GotD_Projectile[GotD_MaxIndex] = WotD Rocket (Corrosive)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
GotD_GunType[GotD_MaxIndex] Equal to Laser
Then - Actions
Set GotD_Projectile[GotD_MaxIndex] = WotD Laser (Corrosive)
Else - Actions
Set GotD_Projectile[GotD_MaxIndex] = WotD Bullet (Corrosive)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
TempInt Equal to 6
GotD_Manufacturer[GotD_MaxIndex] Not equal to Jacobs
GotD_Manufacturer[GotD_MaxIndex] Not equal to Torgue
Then - Actions
-------- Cryo --------
Set GotD_Element[GotD_MaxIndex] = Cryo
Floating Text - Change the color of GotD_Text[GotD_MaxIndex] to (30.00%, 80.00%, 80.00%) with 0.00% transparency
-------- Stats --------
Set GotD_Damage[GotD_MaxIndex] = (GotD_Damage[GotD_MaxIndex] x 1.00)
Set GotD_Range[GotD_MaxIndex] = (GotD_Range[GotD_MaxIndex] x 1.05)
Set GotD_FireRateFull[GotD_MaxIndex] = (GotD_FireRateFull[GotD_MaxIndex] / 1.00)
Set GotD_ReloadFull[GotD_MaxIndex] = (GotD_ReloadFull[GotD_MaxIndex] / 1.00)
Set GotD_ClipFull[GotD_MaxIndex] = (Integer(((Real(GotD_ClipFull[GotD_MaxIndex])) x 0.90)))
Set GotD_Accuracy[GotD_MaxIndex] = (GotD_Accuracy[GotD_MaxIndex] / 1.00)
-------- Projectile --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
GotD_GunType[GotD_MaxIndex] Equal to Rocket Launcher
Then - Actions
Set GotD_Projectile[GotD_MaxIndex] = WotD Rocket (Cryo)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
GotD_GunType[GotD_MaxIndex] Equal to Laser
Then - Actions
Set GotD_Projectile[GotD_MaxIndex] = WotD Laser (Cryo)
Else - Actions
Set GotD_Projectile[GotD_MaxIndex] = WotD Bullet (Cryo)
Else - Actions
Trigger - Run (This trigger) (checking conditions)


GotD Loop
Events
Time - Every 0.03 seconds of game time
Conditions
Actions
For each (Integer GotD_LoopInt) from 1 to GotD_MaxIndex, do (Actions)
Loop - Actions
Set TempPoint = (Position of GotD_CasterUnit[GotD_LoopInt])
Unit - Move GotD_DummyUnit[GotD_LoopInt] instantly to TempPoint
Custom script: call RemoveLocation(udg_TempPoint)
-------- FIRE/RELOAD --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
GotD_FireRateCurrent[GotD_LoopInt] Greater than 0.00
Then - Actions
-------- IF BANDIT 5% bonus fire rate per missing bullet in clip --------
Set TempReal = 0.03
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
GotD_Manufacturer[GotD_LoopInt] Equal to Bandit
Then - Actions
Set TempReal = (TempReal x (1.00 + (0.05 x (Real((GotD_ClipFull[GotD_LoopInt] - GotD_ClipCurrent[GotD_LoopInt]))))))
Else - Actions
Set GotD_FireRateCurrent[GotD_LoopInt] = (GotD_FireRateCurrent[GotD_LoopInt] - TempReal)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(GotD_CasterUnit[GotD_LoopInt] is alive) Equal to True
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
GotD_FullAmmo[GotD_LoopInt] Greater than 0
Then - Actions
-------- If gun has ammo - fire --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
GotD_ClipCurrent[GotD_LoopInt] Greater than 0
Then - Actions
-------- If fire rate 0 then fire and put to max --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
GotD_FireRateCurrent[GotD_LoopInt] Less than or equal to 0.00
Then - Actions
Set Spell_CasterPoint = (Position of GotD_CasterUnit[GotD_LoopInt])
Set Spell_TargetPoint = (Position of GotD_TargetUnit[GotD_LoopInt])
-------- If target out of range or dead remove target --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Or - Any (Conditions) are true
Conditions
(Distance between Spell_CasterPoint and Spell_TargetPoint) Greater than GotD_Range[GotD_LoopInt]
(GotD_TargetUnit[GotD_LoopInt] is dead) Equal to True
Then - Actions
Set GotD_TargetUnit[GotD_LoopInt] = No unit
Custom script: call RemoveLocation(udg_Spell_TargetPoint)
Else - Actions
-------- If no target find target --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
GotD_TargetUnit[GotD_LoopInt] Equal to No unit
Then - Actions
Set Spell_UnitGroup = (Units within GotD_Range[GotD_LoopInt] of Spell_CasterPoint matching ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of GotD_CasterUnit[GotD_LoopInt])) Equal to True)))
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Number of units in Spell_UnitGroup) Greater than or equal to 1
Then - Actions
Set GotD_TargetUnit[GotD_LoopInt] = (Random unit from Spell_UnitGroup)
Else - Actions
Custom script: call DestroyGroup(udg_Spell_UnitGroup)
Else - Actions
-------- If there is a target SHOOOT it --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
GotD_TargetUnit[GotD_LoopInt] Not equal to No unit
Then - Actions
Unit - Make GotD_DummyUnit[GotD_LoopInt] face GotD_TargetUnit[GotD_LoopInt] over 0.00 seconds
Set GotD_FireRateCurrent[GotD_LoopInt] = GotD_FireRateFull[GotD_LoopInt]
Set Spell_TargetPoint = (Position of GotD_TargetUnit[GotD_LoopInt])
-------- If Dahl run 3 times (burst) --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
GotD_Manufacturer[GotD_LoopInt] Equal to Dahl
Then - Actions
Set TempInt = 3
Else - Actions
Set TempInt = 1
For each (Integer A) from 1 to TempInt, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
GotD_ClipCurrent[GotD_LoopInt] Greater than or equal to 1
Then - Actions
-------- If shotgun fire 5 shells in varying directions --------
-------- Otherwise fire one projectile --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
GotD_GunType[GotD_LoopInt] Equal to Shotgun
Then - Actions
Set TempReal = (TempReal + 90.00)
For each (Integer B) from 1 to 5, do (Actions)
Loop - Actions
-------- TempReal = Angle of projectile --------
-------- IF HYPERION 5% bonus accuracy per missing bullet in clip --------
Set TempReal = GotD_Accuracy[GotD_LoopInt]
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
GotD_Manufacturer[GotD_LoopInt] Equal to Hyperion
Then - Actions
Set TempReal = (TempReal / (1.00 + (0.05 x (Real((GotD_ClipFull[GotD_LoopInt] - GotD_ClipCurrent[GotD_LoopInt]))))))
Else - Actions
Set TempReal = ((Facing of GotD_DummyUnit[GotD_LoopInt]) + (Random real number between (TempReal x -1.00) and TempReal))
Set GotD2_MaxIndex[GotD_LoopInt] = (GotD2_MaxIndex[GotD_LoopInt] + 1)
-------- Create projectile --------
Unit - Create 1 GotD_Projectile[GotD_LoopInt] for (Owner of GotD_CasterUnit[GotD_LoopInt]) at Spell_CasterPoint facing TempReal degrees
Set GotD2_Dummy[GotD2_MaxIndex[GotD_LoopInt]] = (Last created unit)
Set GotD2_Dmg[GotD2_MaxIndex[GotD_LoopInt]] = (GotD_Damage[GotD_LoopInt] / 5.00)
-------- IF JACOBS 10% bonus damage per missing bullet in clip --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
GotD_Manufacturer[GotD_LoopInt] Equal to Jacobs
Then - Actions
Set GotD2_Dmg[GotD2_MaxIndex[GotD_LoopInt]] = (GotD2_Dmg[GotD2_MaxIndex[GotD_LoopInt]] x (1.00 + (0.10 x (Real((GotD_ClipFull[GotD_LoopInt] - GotD_ClipCurrent[GotD_LoopInt]))))))
Else - Actions
Else - Actions
-------- TempReal = Angle of projectile --------
-------- IF HYPERION 5% bonus accuracy per missing bullet in clip --------
Set TempReal = GotD_Accuracy[GotD_LoopInt]
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
GotD_Manufacturer[GotD_LoopInt] Equal to Hyperion
Then - Actions
Set TempReal = (TempReal / (1.00 + (0.05 x (Real((GotD_ClipFull[GotD_LoopInt] - GotD_ClipCurrent[GotD_LoopInt]))))))
Else - Actions
Set TempReal = ((Facing of GotD_DummyUnit[GotD_LoopInt]) + (Random real number between (TempReal x -1.00) and TempReal))
Set GotD2_MaxIndex[GotD_LoopInt] = (GotD2_MaxIndex[GotD_LoopInt] + 1)
-------- Create projectile --------
Unit - Create 1 GotD_Projectile[GotD_LoopInt] for (Owner of GotD_CasterUnit[GotD_LoopInt]) at Spell_CasterPoint facing TempReal degrees
Set GotD2_Dummy[GotD2_MaxIndex[GotD_LoopInt]] = (Last created unit)
Set GotD2_Dmg[GotD2_MaxIndex[GotD_LoopInt]] = GotD_Damage[GotD_LoopInt]
-------- IF JACOBS 10% bonus damage per missing bullet in clip --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
GotD_Manufacturer[GotD_LoopInt] Equal to Jacobs
Then - Actions
Set GotD2_Dmg[GotD2_MaxIndex[GotD_LoopInt]] = (GotD2_Dmg[GotD2_MaxIndex[GotD_LoopInt]] x (1.00 + (0.10 x (Real((GotD_ClipFull[GotD_LoopInt] - GotD_ClipCurrent[GotD_LoopInt]))))))
Else - Actions
-------- USE AMMO --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
GotD_Manufacturer[GotD_LoopInt] Equal to Vladof
(Random integer number between 1 and 5) Equal to 1
Then - Actions
-------- FREE AMMO --------
Else - Actions
Set GotD_ClipCurrent[GotD_LoopInt] = (GotD_ClipCurrent[GotD_LoopInt] - 1)
Set GotD_FullAmmo[GotD_LoopInt] = (GotD_FullAmmo[GotD_LoopInt] - 1)
Else - Actions
Custom script: call RemoveLocation(udg_Spell_TargetPoint)
Else - Actions
Custom script: call RemoveLocation(udg_Spell_CasterPoint)
Floating Text - Change text of GotD_Text[GotD_LoopInt] to ((String(GotD_ClipCurrent[GotD_LoopInt])) + (/ + ((String(GotD_ClipFull[GotD_LoopInt])) + (|n + (String(GotD_FullAmmo[GotD_LoopInt])))))) using font size 8.50
Else - Actions
Else - Actions
-------- If no ammo in clip - start reload --------
-------- If reloading Current Clip = -1 --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
GotD_ReloadCurrent[GotD_LoopInt] Less than or equal to 0.00
GotD_ClipCurrent[GotD_LoopInt] Not equal to -1
Then - Actions
Floating Text - Change text of GotD_Text[GotD_LoopInt] to RELOADING using font size 8.50
Set GotD_ReloadCurrent[GotD_LoopInt] = GotD_ReloadFull[GotD_LoopInt]
Set GotD_ClipCurrent[GotD_LoopInt] = -1
Else - Actions
Set GotD_ReloadCurrent[GotD_LoopInt] = (GotD_ReloadCurrent[GotD_LoopInt] - 0.03)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
GotD_ReloadCurrent[GotD_LoopInt] Less than or equal to 0.00
Then - Actions
Set GotD_ClipCurrent[GotD_LoopInt] = 0
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
GotD_FullAmmo[GotD_LoopInt] Greater than or equal to GotD_ClipFull[GotD_LoopInt]
Then - Actions
Set GotD_ClipCurrent[GotD_LoopInt] = GotD_ClipFull[GotD_LoopInt]
Else - Actions
Set GotD_ClipCurrent[GotD_LoopInt] = GotD_FullAmmo[GotD_LoopInt]
Else - Actions
Else - Actions
Floating Text - Change text of GotD_Text[GotD_LoopInt] to EMPTY using font size 8.50
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
GotD_TargetUnit[GotD_LoopInt] Not equal to No unit
Then - Actions
Unit - Make GotD_DummyUnit[GotD_LoopInt] face GotD_TargetUnit[GotD_LoopInt] over 0.00 seconds
Else - Actions
Unit - Make GotD_DummyUnit[GotD_LoopInt] face (Facing of GotD_CasterUnit[GotD_LoopInt]) over 0.00 seconds
Else - Actions
Floating Text - Change text of GotD_Text[GotD_LoopInt] to DEAD using font size 8.50
Set GotD_FullAmmo[GotD_LoopInt] = 0
Floating Text - Change the position of GotD_Text[GotD_LoopInt] to GotD_CasterUnit[GotD_LoopInt] with Z offset 0.00
-------- MOVE BULLETS --------
For each (Integer GotD2_LoopInt[GotD_LoopInt]) from 1 to GotD2_MaxIndex[GotD_LoopInt], do (Actions)
Loop - Actions
-------- TempReal = Speed of missile --------
Set TempReal = 30.00
-------- Slow down if Torgue --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
GotD_Manufacturer[GotD_LoopInt] Equal to Torgue
Then - Actions
Set TempReal = (TempReal / 1.50)
Else - Actions
-------- Slow down if Rocket Launcher --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
GotD_GunType[GotD_LoopInt] Equal to Rocket Launcher
Then - Actions
Set TempReal = (TempReal / 1.50)
Else - Actions
-------- Speed up if Laser --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
GotD_GunType[GotD_LoopInt] Equal to Laser
Then - Actions
Set TempReal = (TempReal x 2.00)
Else - Actions
-------- SPEED SET --------
-------- Position of missile --------
Set Spell_CasterPoint = (Position of GotD2_Dummy[GotD2_LoopInt[GotD_LoopInt]])
-------- Intended new position --------
Set Spell_TargetPoint = (Spell_CasterPoint offset by TempReal towards (Facing of GotD2_Dummy[GotD2_LoopInt[GotD_LoopInt]]) degrees)
-------- Nearby enemies --------
Set TempUnitGroup = (Units within 100.00 of Spell_TargetPoint matching ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of GotD_CasterUnit[GotD_LoopInt])) Equal to True)))
-------- If enemy nearby or wall hit explode --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Or - Any (Conditions) are true
Conditions
(Terrain pathing at Spell_TargetPoint of type Walkability is off) Equal to True
(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
Or - Any (Conditions) are true
Conditions
GotD_GunType[GotD_LoopInt] Equal to Rocket Launcher
GotD_Element[GotD_LoopInt] Equal to Explosive
Then - Actions
-------- TempReal = AoE --------
Set TempReal = 0.00
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
GotD_GunType[GotD_LoopInt] Equal to Rocket Launcher
Then - Actions
Set TempReal = (TempReal + 300.00)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
GotD_Element[GotD_LoopInt] Equal to Explosive
Then - Actions
Set TempReal = (TempReal + 150.00)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
GotD_Manufacturer[GotD_LoopInt] Equal to Torgue
Then - Actions
Set TempReal = (TempReal x 1.50)
Else - Actions
Set Spell_UnitGroup = (Units within TempReal of Spell_TargetPoint matching ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of GotD_CasterUnit[GotD_LoopInt])) Equal to True)))
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Number of units in Spell_UnitGroup) Greater than or equal to 1
Then - Actions
Unit Group - Pick every unit in Spell_UnitGroup and do (Actions)
Loop - Actions
Set Spell_TargetUnit = (Picked unit)
Trigger - Run GotD Deal Damage <gen> (checking conditions)
Else - Actions
Custom script: call DestroyGroup(udg_Spell_UnitGroup)
Else - 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
Set Spell_TargetUnit = (Random unit from TempUnitGroup)
Trigger - Run GotD Deal Damage <gen> (checking conditions)
Else - Actions
-------- Kill and Deindex --------
Unit - Kill GotD2_Dummy[GotD2_LoopInt[GotD_LoopInt]]
Set GotD2_Dummy[GotD2_LoopInt[GotD_LoopInt]] = GotD2_Dummy[GotD2_MaxIndex[GotD_LoopInt]]
Set GotD2_MaxIndex[GotD_LoopInt] = (GotD2_MaxIndex[GotD_LoopInt] - 1)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
GotD2_MaxIndex[GotD_LoopInt] Not equal to 0
Then - Actions
Set GotD2_LoopInt[GotD_LoopInt] = (GotD2_LoopInt[GotD_LoopInt] - 1)
Else - Actions
Else - Actions
Unit - Move GotD2_Dummy[GotD2_LoopInt[GotD_LoopInt]] instantly to Spell_TargetPoint
Custom script: call RemoveLocation(udg_Spell_CasterPoint)
Custom script: call RemoveLocation(udg_Spell_TargetPoint)
Custom script: call DestroyGroup(udg_TempUnitGroup)
-------- DEINDEX if no spare ammo and no projectiles moving --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
GotD2_MaxIndex[GotD_LoopInt] Equal to 0
GotD_FullAmmo[GotD_LoopInt] Equal to 0
Then - Actions
Set GotD_Accuracy[GotD_LoopInt] = GotD_Accuracy[GotD_MaxIndex]
Set GotD_CasterUnit[GotD_LoopInt] = GotD_CasterUnit[GotD_MaxIndex]
Set GotD_ClipCurrent[GotD_LoopInt] = GotD_ClipCurrent[GotD_MaxIndex]
Set GotD_ClipFull[GotD_LoopInt] = GotD_ClipFull[GotD_LoopInt]
Set GotD_Damage[GotD_LoopInt] = GotD_Damage[GotD_MaxIndex]
Unit - Remove GotD_DummyUnit[GotD_LoopInt] from the game
Set GotD_DummyUnit[GotD_LoopInt] = GotD_DummyUnit[GotD_MaxIndex]
Set GotD_Element[GotD_LoopInt] = GotD_Element[GotD_MaxIndex]
Set GotD_FireRateCurrent[GotD_LoopInt] = GotD_FireRateCurrent[GotD_MaxIndex]
Set GotD_FireRateFull[GotD_LoopInt] = GotD_FireRateFull[GotD_MaxIndex]
Set GotD_FullAmmo[GotD_LoopInt] = GotD_FullAmmo[GotD_MaxIndex]
Set GotD_GunType[GotD_LoopInt] = GotD_GunType[GotD_MaxIndex]
Set GotD_Manufacturer[GotD_LoopInt] = GotD_Manufacturer[GotD_MaxIndex]
Set GotD_Projectile[GotD_LoopInt] = GotD_Projectile[GotD_MaxIndex]
Set GotD_Range[GotD_LoopInt] = GotD_Range[GotD_MaxIndex]
Set GotD_ReloadCurrent[GotD_LoopInt] = GotD_ReloadCurrent[GotD_MaxIndex]
Set GotD_ReloadFull[GotD_LoopInt] = GotD_ReloadFull[GotD_MaxIndex]
Set GotD_TargetUnit[GotD_LoopInt] = GotD_TargetUnit[GotD_MaxIndex]
Floating Text - Destroy GotD_Text[GotD_LoopInt]
Set GotD_Text[GotD_LoopInt] = GotD_Text[GotD_MaxIndex]
For each (Integer GotD2_LoopInt[GotD_MaxIndex]) from 1 to GotD2_MaxIndex[GotD_MaxIndex], do (Actions)
Loop - Actions
Set GotD2_Dummy[GotD2_LoopInt[GotD_MaxIndex]] = GotD_DummyUnit[GotD2_LoopInt[GotD_LoopInt]]
Set GotD2_Dmg[GotD2_LoopInt[GotD_MaxIndex]] = GotD2_Dmg[GotD2_LoopInt[Grenade_LoopInt]]
Set GotD2_MaxIndex[GotD_LoopInt] = GotD2_MaxIndex[GotD_MaxIndex]
-------- END --------
Set GotD_MaxIndex = (GotD_MaxIndex - 1)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
GotD_MaxIndex Equal to 0
Then - Actions
Trigger - Turn off (This trigger)
Else - Actions
Set GotD_LoopInt = (GotD_LoopInt - 1)
Else - Actions


  • GotD Deal Damage
    • Events
    • Conditions
    • Actions
      • Set Spell_Damage = GotD2_Dmg[GotD2_LoopInt[GotD_LoopInt]]
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • GotD_Manufacturer[GotD_LoopInt] Equal to Maliwan
        • Then - Actions
          • Set TempReal = 2.00
        • Else - Actions
          • Set TempReal = 1.50
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • GotD_Element[GotD_LoopInt] Equal to Explosive
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Spell_TargetUnit is A ground unit) Equal to True
            • Then - Actions
              • Set Spell_Damage = (Spell_Damage x TempReal)
            • Else - Actions
              • Set Spell_Damage = (Spell_Damage / TempReal)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • GotD_Element[GotD_LoopInt] Equal to Shock
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Spell_TargetUnit is A flying unit) Equal to True
                • Then - Actions
                  • Set Spell_Damage = (Spell_Damage x TempReal)
                • Else - Actions
                  • Set Spell_Damage = (Spell_Damage / TempReal)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • GotD_Element[GotD_LoopInt] Equal to Corrosive
                • Then - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Spell_TargetUnit is Mechanical) Equal to True
                    • Then - Actions
                      • Set Spell_Damage = (Spell_Damage x TempReal)
                    • Else - Actions
                      • Set Spell_Damage = (Spell_Damage / TempReal)
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • GotD_Element[GotD_LoopInt] Equal to Incendiary
                    • Then - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Spell_TargetUnit is Mechanical) Equal to False
                        • Then - Actions
                          • Set Spell_Damage = (Spell_Damage x TempReal)
                        • Else - Actions
                          • Set Spell_Damage = (Spell_Damage / TempReal)
                    • Else - Actions
      • Unit - Cause GotD_CasterUnit[GotD_LoopInt] to damage Spell_TargetUnit, dealing Spell_Damage damage of attack type Spells and damage type Universal

NOTE: In the cast you'll notice that there's a big part of de-indexing before anything else. This removes a gun from the casters head if they already have one active and removes all bullets from that gun,
 
Last edited:

Bribe

Code Moderator
Level 50
Joined
Sep 26, 2009
Messages
9,464
I can tell you right away that the indexing of GotD Cast is problematic. If you ever think you need to set more than 1 or 2 variables when you remove an item from the list, you'll find there is an easier solution.

Rather than storing 20 objects to the list index, store the list index as one of those objects. This is covered in the Dynamic Indexing tutorial. The method you are using now is similar to Paladon's and it is extremely tedious to build and edit. Dynamic Indexing will make your life much easier.
 
Level 13
Joined
Oct 16, 2010
Messages
731
Hi,

I've just had a look at your thing and I think I understand it, of what I can tell what you do is what I'm trying to do with my bullets. However implementing your system would mean that I'd have 3 layers to the index? (if that makes sense).

The generic index worked with a single player so if I can I'd rather not change that as I myself understand how it works (it'd take a while to get to grips with yours, maybe on the next spell).

My problem is purely on dealing with the second part (the bullets) as they still break sometimes, is there anything in there which you can see which could be my problem? (All of this will be in GotD Loop at the bottom and when a bullet is fired)
 
Status
Not open for further replies.
Top