Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Comradeship v1.03 [Deuterium]

Submitted by Deuterium
This bundle is marked as approved. It works and satisfies the submission rules.
Spell Description
The Hero creates a bond between him and an ally unit. This bond grows
stronger as the two units get closer to each other, thus amplifying their
damage. If the units get very distant from one another, the bond breaks.

Spell Attributes
- GUI
- MUI
- Documentation on how to adjust and import provided
- As user friendly as possible

Changelog
v1.00
- Released

v1.01
- Removed the minor lag.
- Changed special effects.
- Decreased the refresh rate of the periodic timer from 0.20s to 0.03s.
- Fixed a problem concerning leaks removal (credits to Rmx for pointing that out).
- Fixed a minor mistake concerning MUI Indexing (credits to Rmx for pointing that out).
- Slightly adjusted tooltips.
- Slightly adjusted documentation.
- Added a preload trigger.

v1.02
- Removed all leaks (credits to Dark_Dragon for pointing the leaks out).
- Fixed a bug concerning MUI (credits to Rmx for fixing that).
- Changed special effects (credits to -BerZeKeR- for advising the special effect models).

v1.03
- Increased efficiency.
- Adjusted a little Custom Script mistake.

Triggers
Comradeship Preload
  • Comradeship Preload
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Custom script: call DestroyGroup(udg_CO_Debug)
      • Custom script: set udg_CO_Debug = null
      • Game - Preload Abilities\Weapons\FaerieDragonMissile\FaerieDragonMissile.mdl
      • Game - Preload Abilities\Weapons\IllidanMissile\IllidanMissile.mdl
      • Game - Preload Abilities\Spells\Undead\AbsorbMana\AbsorbManaBirthMissile.mdl
      • Set CO_CenterLoc[0] = (Center of (Playable map area))
      • -------- SFXDummy1_CO --------
      • Unit - Create 1 SFXDummy1_CO for Player 1 (Red) at CO_CenterLoc[0] facing Default building facing degrees
      • Unit - Remove (Last created unit) from the game
      • -------- SFXDummy2_CO --------
      • Unit - Create 1 SFXDummy2_CO for Player 1 (Red) at CO_CenterLoc[0] facing Default building facing degrees
      • Unit - Remove (Last created unit) from the game
      • -------- SFXDummy3_CO --------
      • Unit - Create 1 SFXDummy3_CO for Player 1 (Red) at CO_CenterLoc[0] facing Default building facing degrees
      • Unit - Remove (Last created unit) from the game
      • Special Effect - Create a special effect at CO_CenterLoc[0] using Abilities\Weapons\FaerieDragonMissile\FaerieDragonMissile.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect at CO_CenterLoc[0] using Abilities\Weapons\IllidanMissile\IllidanMissile.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect at CO_CenterLoc[0] using Abilities\Spells\Undead\AbsorbMana\AbsorbManaBirthMissile.mdl
      • Special Effect - Destroy (Last created special effect)
      • Custom script: call RemoveLocation(udg_CO_CenterLoc[0])

Comradeship Main
  • Comradeship Main
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Comradeship
    • Actions
      • -------- -------------------------------------------------------------------------------------------------------------- --------
      • -------- Basic Index Check --------
      • -------- -------------------------------------------------------------------------------------------------------------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • CO_Index[1] Equal to 0
        • Then - Actions
          • Trigger - Turn on Comradeship Loop <gen>
        • Else - Actions
      • -------- -------------------------------------------------------------------------------------------------------------- --------
      • -------- Indexing --------
      • -------- -------------------------------------------------------------------------------------------------------------- --------
      • Set CO_Index[1] = (CO_Index[1] + 1)
      • Set CO_Index[2] = (CO_Index[2] + 1)
      • Set CO_Off[CO_Index[2]] = True
      • -------- -------------------------------------------------------------------------------------------------------------- --------
      • -------- These are some variables for the user to adjust --------
      • -------- -------------------------------------------------------------------------------------------------------------- --------
      • -------- Defines the maximum range at which the spell has an effect --------
      • Set CO_MaxDistance[CO_Index[2]] = 1000.00
      • -------- Defines the time that the spell lasts --------
      • Set CO_SpellLastingTime[CO_Index[2]] = 30.00
      • -------- Defines the motion speed of the special effects --------
      • Set CO_SFXSpeed[CO_Index[2]] = 7.00
      • -------- -------------------------------------------------------------------------------------------------------------- --------
      • -------- Sets Triggering and Targetting unit into variables --------
      • -------- -------------------------------------------------------------------------------------------------------------- --------
      • Set CO_TrigUnit[CO_Index[2]] = (Triggering unit)
      • Set CO_TargUnit[CO_Index[2]] = (Target unit of ability being cast)
      • -------- -------------------------------------------------------------------------------------------------------------- --------
      • -------- Creating Debug group --------
      • -------- -------------------------------------------------------------------------------------------------------------- --------
      • Custom script: if udg_CO_Debug == null then
      • Custom script: set udg_CO_Debug = CreateGroup()
      • Custom script: endif
      • -------- -------------------------------------------------------------------------------------------------------------- --------
      • -------- Adding the damage to both units --------
      • -------- -------------------------------------------------------------------------------------------------------------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (CO_TargUnit[CO_Index[2]] is in CO_Debug) Equal to False
          • (CO_TrigUnit[CO_Index[2]] is in CO_Debug) Equal to False
        • Then - Actions
          • Unit Group - Add CO_TrigUnit[CO_Index[2]] to CO_Debug
          • Unit Group - Add CO_TargUnit[CO_Index[2]] to CO_Debug
          • Unit - Add Comradeship Damage to CO_TrigUnit[CO_Index[2]]
          • Unit - Add Comradeship Damage to CO_TargUnit[CO_Index[2]]
        • Else - Actions
      • -------- -------------------------------------------------------------------------------------------------------------- --------
      • -------- Adding Special Effects to the weapons of the units --------
      • -------- -------------------------------------------------------------------------------------------------------------- --------
      • Special Effect - Create a special effect attached to the weapon of (Triggering unit) using Abilities\Weapons\IllidanMissile\IllidanMissile.mdl
      • Set CO_SFXTrig1[CO_Index[2]] = (Last created special effect)
      • Special Effect - Create a special effect attached to the weapon of (Triggering unit) using Abilities\Spells\Undead\AbsorbMana\AbsorbManaBirthMissile.mdl
      • Set CO_SFXTrig2[CO_Index[2]] = (Last created special effect)
      • Special Effect - Create a special effect attached to the weapon of (Target unit of ability being cast) using Abilities\Weapons\FaerieDragonMissile\FaerieDragonMissile.mdl
      • Set CO_SFXTarg1[CO_Index[2]] = (Last created special effect)
      • Special Effect - Create a special effect attached to the weapon of (Target unit of ability being cast) using Abilities\Weapons\FaerieDragonMissile\FaerieDragonMissile.mdl
      • Set CO_SFXTarg2[CO_Index[2]] = (Last created special effect)
      • -------- -------------------------------------------------------------------------------------------------------------- --------
      • -------- These variables set the positions of both, the Triggering Unit and the Target Unit --------
      • -------- -------------------------------------------------------------------------------------------------------------- --------
      • Set CO_TrigUnitLoc[CO_Index[2]] = (Position of CO_TrigUnit[CO_Index[2]])
      • Set CO_TargUnitLoc[CO_Index[2]] = (Position of CO_TargUnit[CO_Index[2]])
      • -------- -------------------------------------------------------------------------------------------------------------- --------
      • -------- Sets the X's and Y's of the positions of both units --------
      • -------- -------------------------------------------------------------------------------------------------------------- --------
      • Set CO_TrigUnitX[CO_Index[2]] = (X of CO_TrigUnitLoc[CO_Index[2]])
      • Set CO_TrigUnitY[CO_Index[2]] = (Y of CO_TrigUnitLoc[CO_Index[2]])
      • Set CO_TargUnitX[CO_Index[2]] = (X of CO_TargUnitLoc[CO_Index[2]])
      • Set CO_TargUnitY[CO_Index[2]] = (Y of CO_TargUnitLoc[CO_Index[2]])
      • -------- -------------------------------------------------------------------------------------------------------------- --------
      • -------- Simple "vector-midpoint" formula --------
      • -------- -------------------------------------------------------------------------------------------------------------- --------
      • Set CO_CenterLoc[CO_Index[2]] = (Point(((CO_TrigUnitX[CO_Index[2]] + CO_TargUnitX[CO_Index[2]]) / 2.00), ((CO_TrigUnitY[CO_Index[2]] + CO_TargUnitY[CO_Index[2]]) / 2.00)))
      • -------- -------------------------------------------------------------------------------------------------------------- --------
      • -------- Creates special effect units (loop is not used in order to set each to a differet, yet indexed, variable) --------
      • -------- -------------------------------------------------------------------------------------------------------------- --------
      • -------- SFXDummy1_CO --------
      • Unit - Create 1 SFXDummy1_CO for (Owner of (Triggering unit)) at CO_CenterLoc[CO_Index[2]] facing 150.00 degrees
      • Set CO_SFXDummy1[CO_Index[2]] = (Last created unit)
      • Unit - Create 1 SFXDummy1_CO for (Owner of (Triggering unit)) at CO_CenterLoc[CO_Index[2]] facing 270.00 degrees
      • Set CO_SFXDummy3[CO_Index[2]] = (Last created unit)
      • Unit - Create 1 SFXDummy1_CO for (Owner of (Triggering unit)) at CO_CenterLoc[CO_Index[2]] facing 30.00 degrees
      • Set CO_SFXDummy5[CO_Index[2]] = (Last created unit)
      • -------- SFXDummy2_CO --------
      • Unit - Create 1 SFXDummy2_CO for (Owner of (Triggering unit)) at CO_CenterLoc[CO_Index[2]] facing 210.00 degrees
      • Set CO_SFXDummy2[CO_Index[2]] = (Last created unit)
      • Unit - Create 1 SFXDummy2_CO for (Owner of (Triggering unit)) at CO_CenterLoc[CO_Index[2]] facing 330.00 degrees
      • Set CO_SFXDummy4[CO_Index[2]] = (Last created unit)
      • Unit - Create 1 SFXDummy2_CO for (Owner of (Triggering unit)) at CO_CenterLoc[CO_Index[2]] facing 90.00 degrees
      • Set CO_SFXDummy6[CO_Index[2]] = (Last created unit)
      • -------- SFXDummy3_CO --------
      • Unit - Create 1 SFXDummy3_CO for (Owner of (Triggering unit)) at CO_CenterLoc[CO_Index[2]] facing 210.00 degrees
      • Set CO_SFXDummy7[CO_Index[2]] = (Last created unit)
      • Unit - Create 1 SFXDummy3_CO for (Owner of (Triggering unit)) at CO_CenterLoc[CO_Index[2]] facing 330.00 degrees
      • Set CO_SFXDummy8[CO_Index[2]] = (Last created unit)
      • Unit - Create 1 SFXDummy3_CO for (Owner of (Triggering unit)) at CO_CenterLoc[CO_Index[2]] facing 90.00 degrees
      • Set CO_SFXDummy9[CO_Index[2]] = (Last created unit)
      • -------- -------------------------------------------------------------------------------------------------------------- --------
      • -------- Removing leaks --------
      • -------- -------------------------------------------------------------------------------------------------------------- --------
      • Custom script: call RemoveLocation(udg_CO_TrigUnitLoc[udg_CO_Index[2]])
      • Custom script: call RemoveLocation(udg_CO_TargUnitLoc[udg_CO_Index[2]])
      • Custom script: call RemoveLocation(udg_CO_CenterLoc[udg_CO_Index[2]])

Comradeship Loop
  • Comradeship Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer CO_Index[3]) from 1 to CO_Index[2], do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • CO_Off[CO_Index[3]] Equal to True
            • Then - Actions
              • -------- -------------------------------------------------------------------------------------------------------------- --------
              • -------- This variable acts like the Wait action --------
              • -------- -------------------------------------------------------------------------------------------------------------- --------
              • Set CO_WaitCounter[CO_Index[3]] = (CO_WaitCounter[CO_Index[3]] + 0.03)
              • -------- -------------------------------------------------------------------------------------------------------------- --------
              • -------- A counter to later determine the position of each special effect dummy --------
              • -------- -------------------------------------------------------------------------------------------------------------- --------
              • Set CO_EffectOffsetCounter[CO_Index[3]] = (CO_EffectOffsetCounter[CO_Index[3]] + CO_SFXSpeed[CO_Index[3]])
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • CO_EffectOffsetCounter[CO_Index[3]] Greater than or equal to 360.00
                • Then - Actions
                  • Set CO_EffectOffsetCounter[CO_Index[3]] = 0.00
                • Else - Actions
              • -------- -------------------------------------------------------------------------------------------------------------- --------
              • -------- These variables set the positions of both, the Triggering Unit and the Target Unit --------
              • -------- -------------------------------------------------------------------------------------------------------------- --------
              • Set CO_TrigUnitLoc[CO_Index[3]] = (Position of CO_TrigUnit[CO_Index[3]])
              • Set CO_TargUnitLoc[CO_Index[3]] = (Position of CO_TargUnit[CO_Index[3]])
              • -------- -------------------------------------------------------------------------------------------------------------- --------
              • -------- Mathematical equation to define four sections of the circle to be used to determine the damage of the units depending on the distance --------
              • -------- -------------------------------------------------------------------------------------------------------------- --------
              • Set CO_DmgLevelIteger[CO_Index[3]] = ((Integer(CO_MaxDistance[CO_Index[3]])) / (Integer((Distance between CO_TrigUnitLoc[CO_Index[3]] and CO_TargUnitLoc[CO_Index[3]]))))
              • -------- -------------------------------------------------------------------------------------------------------------- --------
              • -------- If/Then function to be sure the Integer doesn't go over 4 in order not to mix up with the damage of the other levels --------
              • -------- -------------------------------------------------------------------------------------------------------------- --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • CO_DmgLevelIteger[CO_Index[3]] Greater than 4
                • Then - Actions
                  • Set CO_DmgLevelIteger[CO_Index[3]] = 4
                • Else - Actions
              • -------- -------------------------------------------------------------------------------------------------------------- --------
              • -------- Sets the additional unit by setting the level of Comradeship Damage --------
              • -------- -------------------------------------------------------------------------------------------------------------- --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (CO_TrigUnit[CO_Index[3]] is in CO_Debug) Equal to False
                  • (CO_TargUnit[CO_Index[3]] is in CO_Debug) Equal to False
                • Then - Actions
                  • Unit Group - Add CO_TrigUnit[CO_Index[3]] to CO_Debug
                  • Unit Group - Add CO_TargUnit[CO_Index[3]] to CO_Debug
                  • Unit - Add Comradeship Damage to CO_TrigUnit[CO_Index[3]]
                  • Unit - Add Comradeship Damage to CO_TargUnit[CO_Index[3]]
                • Else - Actions
              • Set CO_DmgLevelDetermining[CO_Index[3]] = (CO_DmgLevelIteger[CO_Index[3]] + (((Level of Comradeship for CO_TrigUnit[CO_Index[3]]) - 1) x 4))
              • Unit - Set level of Comradeship Damage for CO_TrigUnit[CO_Index[3]] to CO_DmgLevelDetermining[CO_Index[3]]
              • Unit - Set level of Comradeship Damage for CO_TargUnit[CO_Index[3]] to CO_DmgLevelDetermining[CO_Index[3]]
              • -------- -------------------------------------------------------------------------------------------------------------- --------
              • -------- Sets the X's and Y's of the positions of both units --------
              • -------- -------------------------------------------------------------------------------------------------------------- --------
              • Set CO_TrigUnitX[CO_Index[3]] = (X of CO_TrigUnitLoc[CO_Index[3]])
              • Set CO_TargUnitX[CO_Index[3]] = (X of CO_TargUnitLoc[CO_Index[3]])
              • Set CO_TrigUnitY[CO_Index[3]] = (Y of CO_TrigUnitLoc[CO_Index[3]])
              • Set CO_TargUnitY[CO_Index[3]] = (Y of CO_TargUnitLoc[CO_Index[3]])
              • -------- -------------------------------------------------------------------------------------------------------------- --------
              • -------- Simple "vector-midpoint" formula --------
              • -------- -------------------------------------------------------------------------------------------------------------- --------
              • Set CO_CenterLoc[CO_Index[3]] = (Point(((CO_TrigUnitX[CO_Index[3]] + CO_TargUnitX[CO_Index[3]]) / 2.00), ((CO_TrigUnitY[CO_Index[3]] + CO_TargUnitY[CO_Index[3]]) / 2.00)))
              • -------- -------------------------------------------------------------------------------------------------------------- --------
              • -------- Setting points for circular motion into variables --------
              • -------- -------------------------------------------------------------------------------------------------------------- --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • CO_WaitCounter[CO_Index[3]] Greater than or equal to 1.98
                • Then - Actions
                  • Set CO_PolProj1[CO_Index[3]] = (CO_CenterLoc[CO_Index[3]] offset by (CO_MaxDistance[CO_Index[3]] / 2.00) towards (CO_EffectOffsetCounter[CO_Index[3]] + 60.00) degrees)
                  • Set CO_PolProj2[CO_Index[3]] = (CO_CenterLoc[CO_Index[3]] offset by (CO_MaxDistance[CO_Index[3]] / 2.00) towards (CO_EffectOffsetCounter[CO_Index[3]] + 120.00) degrees)
                  • Set CO_PolProj3[CO_Index[3]] = (CO_CenterLoc[CO_Index[3]] offset by (CO_MaxDistance[CO_Index[3]] / 2.00) towards (CO_EffectOffsetCounter[CO_Index[3]] + 180.00) degrees)
                  • Set CO_PolProj4[CO_Index[3]] = (CO_CenterLoc[CO_Index[3]] offset by (CO_MaxDistance[CO_Index[3]] / 2.00) towards (CO_EffectOffsetCounter[CO_Index[3]] + 240.00) degrees)
                  • Set CO_PolProj5[CO_Index[3]] = (CO_CenterLoc[CO_Index[3]] offset by (CO_MaxDistance[CO_Index[3]] / 2.00) towards (CO_EffectOffsetCounter[CO_Index[3]] + 300.00) degrees)
                  • Set CO_PolProj6[CO_Index[3]] = (CO_CenterLoc[CO_Index[3]] offset by (CO_MaxDistance[CO_Index[3]] / 2.00) towards (CO_EffectOffsetCounter[CO_Index[3]] + 360.00) degrees)
                • Else - Actions
                  • Set CO_SFXAlgeo[CO_Index[3]] = (CO_WaitCounter[CO_Index[3]] / 1.98)
                  • Set CO_PolProj1[CO_Index[3]] = (CO_CenterLoc[CO_Index[3]] offset by ((CO_MaxDistance[CO_Index[3]] / 2.00) x CO_SFXAlgeo[CO_Index[3]]) towards (CO_EffectOffsetCounter[CO_Index[3]] + 60.00) degrees)
                  • Set CO_PolProj2[CO_Index[3]] = (CO_CenterLoc[CO_Index[3]] offset by ((CO_MaxDistance[CO_Index[3]] / 2.00) x CO_SFXAlgeo[CO_Index[3]]) towards (CO_EffectOffsetCounter[CO_Index[3]] + 120.00) degrees)
                  • Set CO_PolProj3[CO_Index[3]] = (CO_CenterLoc[CO_Index[3]] offset by ((CO_MaxDistance[CO_Index[3]] / 2.00) x CO_SFXAlgeo[CO_Index[3]]) towards (CO_EffectOffsetCounter[CO_Index[3]] + 180.00) degrees)
                  • Set CO_PolProj4[CO_Index[3]] = (CO_CenterLoc[CO_Index[3]] offset by ((CO_MaxDistance[CO_Index[3]] / 2.00) x CO_SFXAlgeo[CO_Index[3]]) towards (CO_EffectOffsetCounter[CO_Index[3]] + 240.00) degrees)
                  • Set CO_PolProj5[CO_Index[3]] = (CO_CenterLoc[CO_Index[3]] offset by ((CO_MaxDistance[CO_Index[3]] / 2.00) x CO_SFXAlgeo[CO_Index[3]]) towards (CO_EffectOffsetCounter[CO_Index[3]] + 300.00) degrees)
                  • Set CO_PolProj6[CO_Index[3]] = (CO_CenterLoc[CO_Index[3]] offset by ((CO_MaxDistance[CO_Index[3]] / 2.00) x CO_SFXAlgeo[CO_Index[3]]) towards (CO_EffectOffsetCounter[CO_Index[3]] + 360.00) degrees)
              • -------- -------------------------------------------------------------------------------------------------------------- --------
              • -------- Checks the distance between both units, the value of CO_WaitCounter, and if any of the two units are dead or not --------
              • -------- and if any of the Conditions apply Special Effects are destroyed, and additional damage and leaks removed --------
              • -------- -------------------------------------------------------------------------------------------------------------- --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Or - Any (Conditions) are true
                    • Conditions
                      • (Distance between CO_TrigUnitLoc[CO_Index[3]] and CO_TargUnitLoc[CO_Index[3]]) Greater than CO_MaxDistance[CO_Index[3]]
                      • CO_WaitCounter[CO_Index[3]] Greater than or equal to CO_SpellLastingTime[CO_Index[3]]
                      • (CO_TrigUnit[CO_Index[3]] is dead) Equal to True
                      • (CO_TargUnit[CO_Index[3]] is dead) Equal to True
                • Then - Actions
                  • Set CO_Off[CO_Index[3]] = False
                  • -------- -------------------------------------------------------------------------------------------------------------- --------
                  • -------- Removing extra damage --------
                  • -------- -------------------------------------------------------------------------------------------------------------- --------
                  • Unit - Remove Comradeship Damage from CO_TrigUnit[CO_Index[3]]
                  • Unit - Remove Comradeship Damage from CO_TargUnit[CO_Index[3]]
                  • Unit Group - Remove CO_TrigUnit[CO_Index[3]] from CO_Debug
                  • Unit Group - Remove CO_TargUnit[CO_Index[3]] from CO_Debug
                  • -------- -------------------------------------------------------------------------------------------------------------- --------
                  • -------- Removing special effect dummies --------
                  • -------- -------------------------------------------------------------------------------------------------------------- --------
                  • Unit - Add a 0.01 second Generic expiration timer to CO_SFXDummy1[CO_Index[3]]
                  • Unit - Add a 0.01 second Generic expiration timer to CO_SFXDummy2[CO_Index[3]]
                  • Unit - Add a 0.01 second Generic expiration timer to CO_SFXDummy3[CO_Index[3]]
                  • Unit - Add a 0.01 second Generic expiration timer to CO_SFXDummy4[CO_Index[3]]
                  • Unit - Add a 0.01 second Generic expiration timer to CO_SFXDummy5[CO_Index[3]]
                  • Unit - Add a 0.01 second Generic expiration timer to CO_SFXDummy6[CO_Index[3]]
                  • Unit - Add a 0.01 second Generic expiration timer to CO_SFXDummy7[CO_Index[3]]
                  • Unit - Add a 0.01 second Generic expiration timer to CO_SFXDummy8[CO_Index[3]]
                  • Unit - Add a 0.01 second Generic expiration timer to CO_SFXDummy9[CO_Index[3]]
                  • -------- -------------------------------------------------------------------------------------------------------------- --------
                  • -------- Removing weapons' effects --------
                  • -------- -------------------------------------------------------------------------------------------------------------- --------
                  • Special Effect - Destroy CO_SFXTrig1[CO_Index[3]]
                  • Special Effect - Destroy CO_SFXTrig2[CO_Index[3]]
                  • Special Effect - Destroy CO_SFXTarg1[CO_Index[3]]
                  • Special Effect - Destroy CO_SFXTarg2[CO_Index[3]]
                  • -------- -------------------------------------------------------------------------------------------------------------- --------
                  • -------- Reseting Counters --------
                  • -------- -------------------------------------------------------------------------------------------------------------- --------
                  • Set CO_WaitCounter[CO_Index[3]] = 0.00
                  • Set CO_EffectOffsetCounter[CO_Index[3]] = 0.00
                  • -------- -------------------------------------------------------------------------------------------------------------- --------
                  • -------- Reducing CO_Index[1] because one spell instance has ended --------
                  • -------- -------------------------------------------------------------------------------------------------------------- --------
                  • Set CO_Index[1] = (CO_Index[1] - 1)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • CO_Index[1] Equal to 0
                    • Then - Actions
                      • -------- -------------------------------------------------------------------------------------------------------------- --------
                      • -------- Destroying Debug group --------
                      • -------- -------------------------------------------------------------------------------------------------------------- --------
                      • Custom script: call DestroyGroup(udg_CO_Debug)
                      • Custom script: set udg_CO_Debug = null
                      • -------- -------------------------------------------------------------------------------------------------------------- --------
                      • -------- Resetting CO_Index[2] to 0 because no active spells are running then turning the trigger off --------
                      • Set CO_Index[2] = 0
                      • -------- -------------------------------------------------------------------------------------------------------------- --------
                      • Trigger - Turn off (This trigger)
                    • Else - Actions
                • Else - Actions
                  • -------- -------------------------------------------------------------------------------------------------------------- --------
                  • -------- Setting the special effect dummies in a circular motion --------
                  • -------- -------------------------------------------------------------------------------------------------------------- --------
                  • Unit - Move CO_SFXDummy1[CO_Index[3]] instantly to CO_PolProj1[CO_Index[3]], facing (CO_EffectOffsetCounter[CO_Index[3]] + 150.00) degrees
                  • Unit - Move CO_SFXDummy2[CO_Index[3]] instantly to CO_PolProj2[CO_Index[3]], facing (CO_EffectOffsetCounter[CO_Index[3]] + 210.00) degrees
                  • Unit - Move CO_SFXDummy3[CO_Index[3]] instantly to CO_PolProj3[CO_Index[3]], facing (CO_EffectOffsetCounter[CO_Index[3]] + 270.00) degrees
                  • Unit - Move CO_SFXDummy4[CO_Index[3]] instantly to CO_PolProj4[CO_Index[3]], facing (CO_EffectOffsetCounter[CO_Index[3]] + 330.00) degrees
                  • Unit - Move CO_SFXDummy5[CO_Index[3]] instantly to CO_PolProj5[CO_Index[3]], facing (CO_EffectOffsetCounter[CO_Index[3]] + 30.00) degrees
                  • Unit - Move CO_SFXDummy6[CO_Index[3]] instantly to CO_PolProj6[CO_Index[3]], facing (CO_EffectOffsetCounter[CO_Index[3]] + 90.00) degrees
                  • -------- - --------
                  • Unit - Move CO_SFXDummy7[CO_Index[3]] instantly to CO_PolProj2[CO_Index[3]], facing (CO_EffectOffsetCounter[CO_Index[3]] + 210.00) degrees
                  • Unit - Move CO_SFXDummy8[CO_Index[3]] instantly to CO_PolProj4[CO_Index[3]], facing (CO_EffectOffsetCounter[CO_Index[3]] + 330.00) degrees
                  • Unit - Move CO_SFXDummy9[CO_Index[3]] instantly to CO_PolProj6[CO_Index[3]], facing (CO_EffectOffsetCounter[CO_Index[3]] + 90.00) degrees
              • -------- -------------------------------------------------------------------------------------------------------------- --------
              • -------- Removing leaks --------
              • -------- -------------------------------------------------------------------------------------------------------------- --------
              • Custom script: call RemoveLocation(udg_CO_TrigUnitLoc[udg_CO_Index[3]])
              • Custom script: call RemoveLocation(udg_CO_TargUnitLoc[udg_CO_Index[3]])
              • Custom script: call RemoveLocation(udg_CO_CenterLoc[udg_CO_Index[3]])
              • Custom script: call RemoveLocation(udg_CO_PolProj1[udg_CO_Index[3]])
              • Custom script: call RemoveLocation(udg_CO_PolProj2[udg_CO_Index[3]])
              • Custom script: call RemoveLocation(udg_CO_PolProj3[udg_CO_Index[3]])
              • Custom script: call RemoveLocation(udg_CO_PolProj4[udg_CO_Index[3]])
              • Custom script: call RemoveLocation(udg_CO_PolProj5[udg_CO_Index[3]])
              • Custom script: call RemoveLocation(udg_CO_PolProj6[udg_CO_Index[3]])
            • Else - Actions

Credits to
Rmx
- pin-pointing unremoved point leaks
- pin-pointing a mistake concerning Indexing
- fixing a bug

Dark_Dragon
- pin-pointing unremoved leaks
- advising on how-to-improve

-BerZeKeR-
- picking more creative special effect models

Credit is appreciated but unnecessary.

Keywords:
Comradeship, Deuterium, Bonus, Damage, Simple, Leakless, MUI, GUI
Contents

Comradeship v1.03 (Map)

Reviews
Moderator
22:50, 6th Jun 2009 hvo-busterkomo: A fairly advanced GUI spell. The scripting and effect both look fine, approved.
  1. Deuterium

    Deuterium

    Joined:
    Mar 17, 2009
    Messages:
    1,301
    Resources:
    2
    Spells:
    1
    Tutorials:
    1
    Resources:
    2
    Well, the idea of the circle wasn't only eye candy. The circle act as a boundary to the maximum distance allowed before having the bond broken. That's why the idea of two spinning axes might not be suitable.

    I fixed the leaks, and decreased the minor lag a bit (not updated yet).

    However, to make it more efficient, I would like to know if anyone has any advice on what special effects would be suitable for this spell! :D

    I was thinking of using a dummy with an aura model to act as the boundary circle, but that would become annoying to adjust (trial-and-error Scaling Value) and wouldn't be nice special effect.

    Thanks!

    EDIT:
    Updated!
     
    Last edited: May 23, 2009
  2. -Berz-

    -Berz-

    Joined:
    Mar 5, 2008
    Messages:
    3,204
    Resources:
    123
    Icons:
    111
    Packs:
    1
    Skins:
    1
    Spells:
    10
    Resources:
    123
    Wow, nice idea.

    User friendly, that's good =)

    Could use some better special effects, i have an idea that would look good but that would ruin the idea of "comradeship" (green + purple effects, evul ;..;)

    It's really good for RPG maps, lots of teamwork and sth, and this spell would get handy =)
     
  3. Deuterium

    Deuterium

    Joined:
    Mar 17, 2009
    Messages:
    1,301
    Resources:
    2
    Spells:
    1
    Tutorials:
    1
    Resources:
    2
    Well, if you've got an idea that's worth working on, I'll definetly like to hear it :)
    It was a really hard job picking special effects that are nice and not annoying in the same time :p
    And I barely know what each special effect looks like in-game, so I'm usually picking the special effects through trial-and-error rather than having something in mind and doing it :s

    Exactly! You know how I do care about whether spells get handy or not ;)
     
  4. -Berz-

    -Berz-

    Joined:
    Mar 5, 2008
    Messages:
    3,204
    Resources:
    123
    Icons:
    111
    Packs:
    1
    Skins:
    1
    Spells:
    10
    Resources:
    123
    Try something small and "light" like half visible, try to apply vertex coloring to dummies.

    I would go with something blue/light yellow, or combination blue+red(if you have 6 dummies, every second dummy is blue others would be red).

    Dunno just a couple of ideas :p
     
  5. Rmx

    Rmx

    Joined:
    Aug 27, 2007
    Messages:
    1,088
    Resources:
    18
    Icons:
    3
    Spells:
    15
    Resources:
    18
    Fixed

    EDIT :

    The Spell bugs ... so I fixed it :p ...... had to help coz ur from lebanon..

    Have fun with the new fixed one LOOL ...
     

    Attached Files:

    Last edited: May 24, 2009
  6. Deuterium

    Deuterium

    Joined:
    Mar 17, 2009
    Messages:
    1,301
    Resources:
    2
    Spells:
    1
    Tutorials:
    1
    Resources:
    2
    Nice ideasss there :) haha... I'm gonna see what I can do about it ;) any special effect model in mind??

    Thanks :) but before I update it, shouldn't the group be destroyed before turning off the periodic trigger? wouldn't it leak otherwise?
    And question, I can't understand what this does:
    • Set CO_Off[CO_Index[2]] = True
     
  7. Rmx

    Rmx

    Joined:
    Aug 27, 2007
    Messages:
    1,088
    Resources:
    18
    Icons:
    3
    Spells:
    15
    Resources:
    18
    No u shouldn't destroy that group coz it didn't Create it ... or set it ...
    I had a long chat me and Dark_Dragon about it loool..

    Also it will not leak like i told u it is SET or Create :p


    About Set CO_Off[CO_Index[2]] = True

    Well look in Comandership Loop... at first ... and see when it turns off ..
    The Loop will do nothing ... it like to prevent bugs :)


    Glad to help .. now it is FULLY MUI without any bugs ..
     
  8. -Berz-

    -Berz-

    Joined:
    Mar 5, 2008
    Messages:
    3,204
    Resources:
    123
    Icons:
    111
    Packs:
    1
    Skins:
    1
    Spells:
    10
    Resources:
    123
    Hmm, Faerie Dragon, IlidanEvil(green) + AbsorbMana(blue) together, and then you attach one effect on caster and the second one on the target =)

    Or maybe try out SpiritLink/AvatarOfVengeance

    i would really like to see that green+blue one with vertex coloring, I think it would look sweet :D
     
  9. Dark_Dragon

    Dark_Dragon

    Joined:
    Jul 19, 2007
    Messages:
    602
    Resources:
    8
    Tools:
    1
    Spells:
    7
    Resources:
    8
    lol xD was not long at all ;)
    anyway i checked ur spell as u wanted Deuterium + i checked Rmx one...

    k thats what i wanted to tell u it was not MUI until Rmx added that boolean (true / false) thing...

    this is coz you always loop to max possible counter but i suggest u to decrease counter and use actaually one one. however that would require some 'smart swap algorithms' so ill leave u at this as is coz its cool ;)

    k Rmx now its my turn to blame u for not founding leaks xD

    • Unit - Create 1 SFXDummy_CO for (Owner of (Triggering unit)) at (CO_CenterLoc[CO_Index[2]] offset by (CO_MaxDistance[CO_Index[2]] / 2.00) towards 60.00 degrees) facing 150.00 degrees


    ... already 6 point leaks
    this is in main trigger

    ... but forget 6 leaks xD
    this is in loop trigger
    • Unit - Move CO_SFXDummy1[CO_Index[3]] instantly to (CO_CenterLoc[CO_Index[3]] offset by (CO_MaxDistance[CO_Index[3]] / 2.00) towards (CO_EffectOffsetCounter[CO_Index[3]] + 60.00) degrees), facing (CO_EffectOffsetCounter[CO_Index[3]] + 150.00) degrees


    :O thats too much
    so lets see how much points does he leak per cast:

    the spell lasts 30 secs.

    so its: 6*(30/0.03+1) =
    = 6 *(100+1)
    = 606 //

    :O thats way tooo much xD
    so as u can see everyone makes mistakes but must say gj on making it fully MUI for Deuterium since this is his first spell lol! and its quite good ;)

    so Deuterium ill suggest u to use Rmx version and fix this leaks i pointed + if u really want u can do that what -BZK- said, then it'll be great :D

    EDIT: Actually to explain groups!
    what GUI does when u create global 'Unit Group' variable is that it generates function which is executed on map init before everything else and it sets that variables to this:

    Code (vJASS):

    set udg_MyGroupVar = CreateGroup()
     


    the creategroup is the only way to create group. when you set the group vars GUI does not have CreateGroup but it has advanced functions which use CreateGroup functions such as Pick every unit matching... or any of this will generate a new group. so if you are not changing the group but only removing and adding units there is no need to remove that group since you did not lost sight of it and you will again use it. but points well once you use them you cant move them and use again so thats why we remove the points. groups dont need to be destroyed if you will use it again (the same one).

    Hope it helps!

    Greets all!
    ~Dark Dragon
     
  10. Rmx

    Rmx

    Joined:
    Aug 27, 2007
    Messages:
    1,088
    Resources:
    18
    Icons:
    3
    Spells:
    15
    Resources:
    18
    Well didn't say that it does not contain leaks :p...... LOOOOL....

    But still i wasn't checking for leaks i was making it 100% MUI LOOl ...
     
  11. Aspard

    Aspard

    Joined:
    Jul 2, 2008
    Messages:
    595
    Resources:
    1
    Spells:
    1
    Resources:
    1
    Why do you always write LOOOL after each sentence? :D

    Back to topic:
    About special effects, why not using whisps? :)
     
  12. Deuterium

    Deuterium

    Joined:
    Mar 17, 2009
    Messages:
    1,301
    Resources:
    2
    Spells:
    1
    Tutorials:
    1
    Resources:
    2
    Now i understand how this functions :)

    Are you talking about the WaitCounter and the EffectOffsetCounter? and haha don't worry, im good at algorithms ;) but I just need to understand what u mean by this :p

    I totally forgot about Polar projections leaking two points... gotta fix that :p

    I'll be giving his ideas a try tonight and update it :)

    Umm yes i get your point. I just thought it'll be more efficient if the group was removed when not in use and then created when needed, but i guess it would barely make any difference right...

    Haha! LOL? ;)

    I'll give that a try too...


    Thank you all guys for you efforts and help :)
    As I always say: Appreciated!
     
  13. Dark_Dragon

    Dark_Dragon

    Joined:
    Jul 19, 2007
    Messages:
    602
    Resources:
    8
    Tools:
    1
    Spells:
    7
    Resources:
    8
    lool :D well i just said it leaks and was ofc kidding! like the hell ill blame u, it was my mistake to say it was MUI and leakless :O

    no no i was just talking that when spell is casted multiple times and if some ends you should decrease that max counter, the same u do with current spell casts counter :)

    but as said is not needed coz it rockzzzz this way toooo !!! :D

    np its ur first spell!

    well since its ur spell do what u want, its already cool but might be even more if u try that effects -BZK- suggested

    :O lol thats actually called 'dynamic object works' and thats my fav and ofc best way of coding spells. but anyway if paladon did not work on that, then well maybe its k for u not to try. but do what u want :D

    np and greets all!
    ~Dark Dragon
     
  14. Deuterium

    Deuterium

    Joined:
    Mar 17, 2009
    Messages:
    1,301
    Resources:
    2
    Spells:
    1
    Tutorials:
    1
    Resources:
    2
    UPDATED! Hopefully flawless now :D

    I'll leave that for later... I'm happy enough that I finally came to understand how the indexing system functions :) so until I make a new spell using some dynamic system like the one you're talking about, I wont adjust this...
    you understand what i mean eh? :)

    Anyways, I took BerZeKeR's advice and adjusted the special effects to what he said... I'm still at a confusion of which of the two are better (Phoenix or the Green/Blue/White) but decided to post this one...

    I hope there's nothing more to fix! Believe me, I already didn't like GUI, now i came to hate it! but as i said, I won't be going fully going into vJass until I'm good with GUI :D

    EDIT:
    DarkDragon i have one question to know whether I gotta fix that or not...
    In Jass, let's say I wanted to create the group, I'd insert:
    Code (vJASS):
    if udg_CO_Debug == null then
        set udg_CO_Debug = CreateGroup()
            endif

    That would be done in order not to create the group if it's already created, right?
    Because when I do it in my spell, once the last instance of the spell ends, it give the message in-game about double-freeing the group...
     
    Last edited: May 24, 2009
  15. Rmx

    Rmx

    Joined:
    Aug 27, 2007
    Messages:
    1,088
    Resources:
    18
    Icons:
    3
    Spells:
    15
    Resources:
    18
    Well i cheked it out ......... one flaw ... try not to remove the units add an EXPIRATION time like 0.01 seconds to them.... they will create their death effect when they expire...
    Then also remove the Special effects ... coz when they expire they will create those effects ...

    This will help ur Trigger speed better :p
     
  16. Dark_Dragon

    Dark_Dragon

    Joined:
    Jul 19, 2007
    Messages:
    602
    Resources:
    8
    Tools:
    1
    Spells:
    7
    Resources:
    8
    wooot nice effects!
    thats when u listen to -BZK- :) he is quite creative
    and np thats good coding really.

    well the problem in jass is that when u destroy the group that variable which was pointing to group is not cleared. thats why we null them in order to free them coz if they are not! then that "if then else" you posted will never trigger coz even if group is destroyed its not cleared... which means its not null

    so you have to do that this way:

    Code (vJASS):

    call DestroyGroup(<whichGroup>)
    set <whichGroup> = null // -> note this is a must

    // and now
    if <whichGroup> == null then
        set <whichGroup> = CreateGroup()
    endif
     


    thats the correct way of doing it ;)

    hope it helps!
    ~Dark Dragon
     
  17. Deuterium

    Deuterium

    Joined:
    Mar 17, 2009
    Messages:
    1,301
    Resources:
    2
    Spells:
    1
    Tutorials:
    1
    Resources:
    2
    Well I'll sure do fix that ;) but not before a few days from now... I'm a bit exhausted of triggering :p

    Yupp BZK's idea with my spiral touch ended up being amazingg ;)

    Yupp I totally understand :D that would make the trigger a bit "custom script-y" but that's only for the sake of better efficiency! ;)
     
  18. -Berz-

    -Berz-

    Joined:
    Mar 5, 2008
    Messages:
    3,204
    Resources:
    123
    Icons:
    111
    Packs:
    1
    Skins:
    1
    Spells:
    10
    Resources:
    123
    So you used the effects =)

    Looks nice, still dunno if it works with projectile models, try to apply transparency(vertex coloring) to about 50-70, that would make dummies less visible and it would look even better :D
     
  19. Deuterium

    Deuterium

    Joined:
    Mar 17, 2009
    Messages:
    1,301
    Resources:
    2
    Spells:
    1
    Tutorials:
    1
    Resources:
    2
    Yup used them and added the spiral, & VOILA! Oh & added you to the credits ;D
    Anyways, vertex coloring isn't an option because only the missile would change color but the projectile particles won't...
     
  20. LebaneseSoul

    LebaneseSoul

    Joined:
    May 6, 2009
    Messages:
    16
    Resources:
    0
    Resources:
    0
    keep it up!