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

Loops and things not working

Status
Not open for further replies.
Level 5
Joined
Feb 8, 2015
Messages
93
Hello Hive!

Once more I need help with a trigger - a rather extensive one this time.

The trigger comes in 2 parts (3 really, but 1 of them should be fixable once I get the rest working):

The first part of the trigger creates 4 "Spire of Enmity" units around the position of a Boss Unit. For this I use a loop with "Integer A" - and there are 4 units spawned around the Boss alright, so that part might be fine.
This should also create 4 lightning effects between the Boss and each pillar - but they all stack on top of one another.

The second part is a trigger that moves the Spires (and Lightning effects) in circles around the Boss. However, this actually places all the Spires right on top of each other, but they do move alright.

I cannot for the life of me see where I went wrong, can anyone here spot where the problem is?
Help much appreciated

  • Spires of Enmity Initiate
    • Events
    • Conditions
    • Actions
      • -------- Saves the location of the BossU (who should be at the center of the Arena, BP = Boss point) --------
      • Set SoE_BP = (Position of BossU)
      • -------- Sets four locations, and creates the four pillars around the Boss (using a loop of 1-4) --------
      • For each (Integer A) from 1 to 4, do (Actions)
        • Loop - Actions
          • -------- Calculates the angle (first south, then clockwise towards east) for the offset point. The formula is (360 - IntegerA x 90) --------
          • Set SoE_Angle = (360.00 - (90.00 x (Real((Integer A)))))
          • -------- Sets a offset point towards the angle (Boss' location + 700 range towards _Angle) --------
          • Set SoE_Loc[(Integer A)] = (SoE_BP offset by 700.00 towards SoE_Angle degrees)
          • -------- Creates a Spire of Enmity at the location --------
          • Unit - Create 1 Spire of Enmity for Player 12 (Brown) at SoE_Loc[(Integer A)] facing Default building facing degrees
          • -------- Saves the newly created spire as SoE_SpireU[Integer A] - meaning the first created is [1], the second [2] and so on... --------
          • Set SoE_SpireU[(Integer A)] = (Last created unit)
          • -------- Creates a lightning effect between the Boss' location (Tempp1) and each Spire (one at a time) --------
          • Lightning - Create a Finger of Death lightning effect from source SoE_BP to target SoE_Loc[(Integer A)]
          • -------- Saves the lightning effect with the index [Integer A] - it is moved in the MoveLoop Trigger --------
          • Set SoE_L[(Integer A)] = (Last created lightning effect)
          • -------- Removes the location used (The [bj_forLoopAIndex] makes it so that [1], [2], [3], and [4] are destroyed) --------
          • Custom script: call RemoveLocation(udg_SoE_Loc[bj_forLoopAIndex])
      • -------- Turns on the MoveLoop trigger and the LaunchLoop triggers (the launchloop is only activated on Hard/Suicide mode) --------
      • Trigger - Turn on Spires of Enmity MoveLoop <gen>
      • -------- Cleans up this trigger by removing the location variable Tempp1 --------
      • Custom script: call RemoveLocation(udg_SoE_Tempp1)

  • Spires of Enmity MoveLoop
    • Events
      • Time - Every 0.05 seconds of game time
    • Conditions
    • Actions
      • -------- ------------------------------------------------------ --------
      • -------- Sets a new location for the Spires to be moved to - This is done much like in "Initiate", but the angle is calculated differently --------
      • -------- ------------------------------------------------------ --------
      • -------- Saves the location of the BossU (who should be at the center of the Arena) --------
      • Set SoE_BP = (Position of BossU)
      • -------- Sets four locations, and moves the four pillars around the Boss (using a loop of 1-4) --------
      • -------- Note that I use Tempi here instead of IntegerA, because the Lightning custom script cannot be too long! --------
      • For each (Integer SoE_i) from 1 to 4, do (Actions)
        • Loop - Actions
          • -------- Calculates the angle for the new Spire locaton (calculates current angle between Boss and spire, and retracts a bit --------
          • Set SoE_Angle = ((Angle from SoE_BP to SoE_Loc[SoE_i]) - 2.00)
          • -------- Sets a new offset point towards the angle (Boss' location + 700 range towards _Angle) --------
          • Set SoE_Loc[SoE_i] = (SoE_BP offset by 700.00 towards SoE_Angle degrees)
          • -------- Moves the looping Spire to the new location --------
          • Custom script: call SetUnitX(udg_SoE_SpireU[udg_SoE_i], GetLocationX(udg_SoE_Loc[udg_SoE_i]))
          • Custom script: call SetUnitY(udg_SoE_SpireU[udg_SoE_i], GetLocationY(udg_SoE_Loc[udg_SoE_i]))
          • -------- Moves the corresponding lightning effect --------
          • Custom script: call MoveLightningEx(udg_SoE_L[udg_SoE_i], true , GetLocationX(udg_SoE_Loc[udg_SoE_i]), GetLocationY(udg_SoE_Loc[udg_SoE_i]), GetLocationZ(udg_SoE_Loc[udg_SoE_i]) + 120, GetLocationX(udg_SoE_BP), GetLocationY(udg_SoE_BP), GetLocationZ(udg_SoE_BP) + 200)
          • -------- Removes the location used (The [bj_forLoopAIndex] makes it so that [1], [2], [3], and [4] are destroyed) --------
          • Custom script: call RemoveLocation(udg_SoE_Loc[udg_SoE_i])
      • -------- ------------------------------------------------------ --------
      • -------- Deals the Lightning Effects damage by setting points down a line --------
      • -------- ------------------------------------------------------ --------
      • -------- Sets the distance between each "Damage point" - similar to "Deathclock" from Phase 4 --------
      • Set SoE_Ldist = 46.60
      • -------- Sets the damage dealt by the Lightning (Note that this runs every 0.05 seconds, so the damage might seem very small) --------
      • Set SoE_LDamage = 2.50
      • -------- Loops through all 4 Spires --------
      • For each (Integer A) from 1 to 4, do (Actions)
        • Loop - Actions
          • -------- NOTE: The loop through the 4 Spries uses "IntegerA" while the loop to create the Damage Points uses "IntegerB" --------
          • -------- Gets the location of the Spires, using simply the location of the units (The units are stored in the SpireU unit array in "Initate") --------
          • Set SoE_Loc[(Integer A)] = (Position of SoE_SpireU[(Integer A)])
          • -------- Calculates the angle from the SpireLoc[IntegerA] to the BP --------
          • Set SoE_LAngle = (Angle from SoE_Loc[(Integer A)] to SoE_BP)
          • -------- Runs a loop to place the "Damage Points" and deal damage around them (Note that 15 x 46.6 circa equals 700 range) --------
          • For each (Integer B) from 1 to 15, do (Actions)
            • Loop - Actions
              • -------- Sets an offset point from the BossPosition (_BP) which is LDist x IntegerA towards the angle from SpireLoc to BP --------
              • Set SoE_LTempp = (SoE_Loc[(Integer A)] offset by (SoE_DistProj x (Real((Integer B)))) towards SoE_LAngle degrees)
              • -------- Sets a Unit group around the Lightning - this will only hit the Player Characters --------
              • Set SoE_Lug = (Units within 50.00 of SoE_LTempp matching ((((Matching unit) is alive) Equal to True) and (((Unit-type of (Matching unit)) Equal to Dragonknight) or ((Unit-type of (Matching unit)) Equal to Cleric))))
              • -------- Deals the damage to the Units in the group --------
              • Unit Group - Pick every unit in SoE_Lug and do (Actions)
                • Loop - Actions
                  • -------- Saves the picked unit in a variable --------
                  • Set SoE_LPicked = (Picked unit)
                  • -------- Saves the location of the picked unit (for effects) --------
                  • Set SoE_LPickedLoc = (Position of SoE_LPicked)
                  • -------- Creates a dummy at the location, this is an "immolation" effect --------
                  • Unit - Create 1 Dummy Immolation Effect for Neutral Passive at SoE_LPickedLoc facing Default building facing degrees
                  • -------- Adds a short expiration to the dummy --------
                  • Unit - Add a 0.50 second Generic expiration timer to (Last created unit)
                  • -------- Deals the damage to the picked unit --------
                  • Unit - Cause SoE_Tempu to damage SoE_LPicked, dealing SoE_LDamage damage of attack type Magic and damage type Fire
                  • -------- Destroys the point variable we used to the picked unit's location --------
                  • Custom script: call RemoveLocation(udg_SoE_LPickedLoc)
              • -------- Destroys the Unit group and the temporary points --------
              • Custom script: call DestroyGroup(udg_SoE_Lug)
              • Custom script: call RemoveLocation(udg_SoE_LTempp)
              • Custom script: call RemoveLocation(udg_SoE_Loc[bj_forLoopAIndex])
Really lost in this trigger.
I added in comments to explain the trigger's actions. If any additional clarification is needed, just ask me.
 
Level 5
Joined
Feb 8, 2015
Messages
93
That explains a really frustrating thing that was happening with me when I was concatenating strings in custom script. It got so frustrating because I couldn't figure out what was causing the crash. Now I can rest easier.

Well glad my failiures at least served to help someone else :ogre_haosis:

In other news; still have no clue what is going on with my trigger. Can on one see what would make all the "Spires of Enmity" stand still + cluster on top of eachother?

EDIT: Now lightning effects refuse to show as well... What have I done?
 
Level 5
Joined
Feb 8, 2015
Messages
93
Thx Bribe! That fixed the issue of the Spires moving about. However it seems the lightning effects have gone missing - still looking for the reason behind that.
+rep btw.

EDIT1: Okay, now I've found that something about Hard Mode (Which enables the third part I mentioned earlier) is what messes with the Lightning Effects. The Lightning Effects only display with "Difficulty_i = 2 or greater" - I.e. when the "Launch" trigger is also active, along with the final part of the Move Trigger (see Trigger 2 and 3 below)
The triggers, at the moment, looks like this:

  • Spires of Enmity Initiate
    • Events
    • Conditions
    • Actions
      • -------- Saves the location of the BossU (who should be at the center of the Arena, BP = Boss point) --------
      • Set SoE_BP = (Position of BossU)
      • -------- Sets four locations, and creates the four pillars around the Boss (using a loop of 1-4) --------
      • For each (Integer A) from 1 to 4, do (Actions)
        • Loop - Actions
          • -------- Calculates the angle (first south, then clockwise towards east) for the offset point. The formula is (360 - IntegerA x 90) --------
          • Set SoE_Angle = (360.00 - (90.00 x (Real((Integer A)))))
          • -------- Sets a offset point towards the angle (Boss' location + 700 range towards _Angle) --------
          • Set SoE_Loc[(Integer A)] = (SoE_BP offset by 700.00 towards SoE_Angle degrees)
          • -------- Creates a Spire of Enmity at the location --------
          • Unit - Create 1 Spire of Enmity for Player 12 (Brown) at SoE_Loc[(Integer A)] facing Default building facing degrees
          • -------- Saves the newly created spire as SoE_SpireU[Integer A] - meaning the first created is [1], the second [2] and so on... --------
          • Set SoE_SpireU[(Integer A)] = (Last created unit)
          • -------- Creates a lightning effect between the Boss' location (Tempp1) and each Spire (one at a time) --------
          • Lightning - Create a Finger of Death lightning effect from source SoE_BP to target SoE_Loc[(Integer A)]
          • -------- Saves the lightning effect with the index [Integer A] - it is moved in the MoveLoop Trigger --------
          • Set SoE_L[(Integer A)] = (Last created lightning effect)
          • -------- Removes the location used (The [bj_forLoopAIndex] makes it so that [1], [2], [3], and [4] are destroyed) --------
          • Custom script: call RemoveLocation(udg_SoE_Loc[bj_forLoopAIndex])
      • -------- Turns on the MoveLoop trigger and the LaunchLoop triggers (the launchloop is only activated on Hard/Suicide mode) --------
      • Trigger - Turn on Spires of Enmity MoveLoop <gen>
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Difficulty_integer Greater than or equal to 2
        • Then - Actions
          • -------- If the game is on "Hard" or higher difficulty, the trigger for launching projectiles is enabled --------
          • Trigger - Turn on Spires of Enmity Launch <gen>
        • Else - Actions
          • -------- If on Easy or Normal difficulty, nothing further is turned on --------
      • -------- Cleans up this trigger by removing the location variable Tempp1 --------
      • Custom script: call RemoveLocation(udg_SoE_Tempp1)
  • Spires of Enmity MoveLoop
    • Events
      • Time - Every 0.05 seconds of game time
    • Conditions
    • Actions
      • -------- ------------------------------------------------------ --------
      • -------- Sets a new location for the Spires to be moved to - This is done much like in "Initiate", but the angle is calculated differently --------
      • -------- ------------------------------------------------------ --------
      • -------- Saves the location of the BossU (who should be at the center of the Arena) --------
      • Set SoE_BP = (Position of BossU)
      • -------- Sets four locations, and moves the four pillars around the Boss (using a loop of 1-4) --------
      • -------- Note that I use Tempi here instead of IntegerA, because the Lightning custom script cannot be too long! --------
      • For each (Integer SoE_i) from 1 to 4, do (Actions)
        • Loop - Actions
          • -------- Re-sets the location of each pillar, using the unit array set in "initiate" --------
          • Set SoE_Loc[SoE_i] = (Position of SoE_SpireU[SoE_i])
          • -------- Calculates the angle for the new Spire locaton (calculates current angle between Boss and spire, and retracts a bit --------
          • Set SoE_Angle = ((Angle from SoE_BP to SoE_Loc[SoE_i]) - 1.00)
          • -------- Sets a new offset point towards the angle (Boss' location + 700 range towards _Angle) --------
          • Set SoE_Loc[SoE_i] = (SoE_BP offset by 700.00 towards SoE_Angle degrees)
          • -------- Moves the looping Spire to the new location --------
          • Custom script: call SetUnitX(udg_SoE_SpireU[udg_SoE_i], GetLocationX(udg_SoE_Loc[udg_SoE_i]))
          • Custom script: call SetUnitY(udg_SoE_SpireU[udg_SoE_i], GetLocationY(udg_SoE_Loc[udg_SoE_i]))
          • -------- Moves the corresponding lightning effect --------
          • Custom script: call MoveLightningEx(udg_SoE_L[udg_SoE_i], true , GetLocationX(udg_SoE_Loc[udg_SoE_i]), GetLocationY(udg_SoE_Loc[udg_SoE_i]), GetLocationZ(udg_SoE_Loc[udg_SoE_i]) + 120, GetLocationX(udg_SoE_BP), GetLocationY(udg_SoE_BP), GetLocationZ(udg_SoE_BP) + 200)
          • -------- Removes the location used (The [bj_forLoopAIndex] makes it so that [1], [2], [3], and [4] are destroyed) --------
          • Custom script: call RemoveLocation(udg_SoE_Loc[udg_SoE_i])
      • -------- ------------------------------------------------------ --------
      • -------- Deals the Lightning Effects damage by setting points down a line --------
      • -------- ------------------------------------------------------ --------
      • -------- Sets the distance between each "Damage point" - similar to "Deathclock" from Phase 4 --------
      • Set SoE_Ldist = 46.60
      • -------- Sets the damage dealt by the Lightning (Note that this runs every 0.05 seconds, so the damage might seem very small) --------
      • Set SoE_LDamage = 2.50
      • -------- Loops through all 4 Spires --------
      • For each (Integer A) from 1 to 4, do (Actions)
        • Loop - Actions
          • -------- NOTE: The loop through the 4 Spries uses "IntegerA" while the loop to create the Damage Points uses "IntegerB" --------
          • -------- Gets the location of the Spires, using simply the location of the units (The units are stored in the SpireU unit array in "Initate") --------
          • Set SoE_Loc[(Integer A)] = (Position of SoE_SpireU[(Integer A)])
          • -------- Calculates the angle from the SpireLoc[IntegerA] to the BP --------
          • Set SoE_LAngle = (Angle from SoE_Loc[(Integer A)] to SoE_BP)
          • -------- Runs a loop to place the "Damage Points" and deal damage around them (Note that 15 x 46.6 circa equals 700 range) --------
          • For each (Integer B) from 1 to 15, do (Actions)
            • Loop - Actions
              • -------- Sets an offset point from the BossPosition (_BP) which is LDist x IntegerA towards the angle from SpireLoc to BP --------
              • Set SoE_LTempp = (SoE_Loc[(Integer A)] offset by (SoE_DistProj x (Real((Integer B)))) towards SoE_LAngle degrees)
              • -------- Sets a Unit group around the Lightning - this will only hit the Player Characters --------
              • Set SoE_Lug = (Units within 50.00 of SoE_LTempp matching ((((Matching unit) is alive) Equal to True) and (((Unit-type of (Matching unit)) Equal to Dragonknight) or ((Unit-type of (Matching unit)) Equal to Cleric))))
              • -------- Deals the damage to the Units in the group --------
              • Unit Group - Pick every unit in SoE_Lug and do (Actions)
                • Loop - Actions
                  • -------- Saves the picked unit in a variable --------
                  • Set SoE_LPicked = (Picked unit)
                  • -------- Saves the location of the picked unit (for effects) --------
                  • Set SoE_LPickedLoc = (Position of SoE_LPicked)
                  • -------- Creates a dummy at the location, this is an "immolation" effect --------
                  • Unit - Create 1 Dummy Immolation Effect for Neutral Passive at SoE_LPickedLoc facing Default building facing degrees
                  • -------- Adds a short expiration to the dummy --------
                  • Unit - Add a 0.50 second Generic expiration timer to (Last created unit)
                  • -------- Deals the damage to the picked unit --------
                  • Unit - Cause SoE_Tempu to damage SoE_LPicked, dealing SoE_LDamage damage of attack type Magic and damage type Fire
                  • -------- Destroys the point variable we used to the picked unit's location --------
                  • Custom script: call RemoveLocation(udg_SoE_LPickedLoc)
              • -------- Destroys the Unit group and the temporary points --------
              • Custom script: call DestroyGroup(udg_SoE_Lug)
              • Custom script: call RemoveLocation(udg_SoE_LTempp)
              • Custom script: call RemoveLocation(udg_SoE_Loc[bj_forLoopAIndex])
      • -------- ------------------------------------------------------ --------
      • -------- Moves the Projectiles - see "Void Wells MoveLoop" in Phase 2 for extra information --------
      • -------- ------------------------------------------------------ --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Difficulty_integer Greater than or equal to 2
        • Then - Actions
          • -------- If the difficulty is "Hard" or "Suicide" mode, then this will move the projectiles launched by the Spires of Enmity --------
          • -------- Picks all projectiles (they're added to the ProjGroup in "LaunchLoop") --------
          • Unit Group - Pick every unit in SoE_ProjGroup and do (Actions)
            • Loop - Actions
              • -------- Saves the picked unit in a variable --------
              • Set SoE_Tempu = (Picked unit)
              • -------- Retrieves the Unit ID of the picked unit, and saves it in a variable (this is used to recall the fitting values from the hashtable) --------
              • Set SoE_handle = (Key (Picked unit))
              • -------- Loads the angle for the Projectile dummy (using its ID) from the hashtable --------
              • Set SoE_AngleProj = (Load 0 of SoE_handle from SoE_hash)
              • -------- Loads the distance traveled by the Projectile dummy (using its ID) from the hashtable --------
              • Set SoE_DistProj = (Load 1 of SoE_handle from SoE_hash)
              • -------- Checks if the expiration is still greater than 0 (meaning the Void Well is still active), and performs accordingly --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • SoE_DistProj Less than 1500.00
                • Then - Actions
                  • -------- If the projectile has not yet traveled 1500 range, it will move onwards. First; the current location is saved --------
                  • Set SoE_Tempp2 = (Position of SoE_Tempu)
                  • -------- Saves "SoE_MoveReal" as the length the projectile travels for every run of this trigger --------
                  • Set SoE_MoveReal = 5.00
                  • -------- Sets a Tempp3 at "Tempp2 + MoveReal towards angle" --------
                  • Set SoE_Tempp3 = (SoE_Tempp2 offset by SoE_MoveReal towards SoE_AngleProj degrees)
                  • -------- Uses a custom script to move the Projectile dummy (udg_SoE_Tempu) to the new point --------
                  • Custom script: call SetUnitX(udg_SoE_Tempu, GetLocationX(udg_SoE_Tempp3))
                  • Custom script: call SetUnitY(udg_SoE_Tempu, GetLocationY(udg_SoE_Tempp3))
                  • -------- Saves the new distance as 1 in the hashtable, using the dummy Projectile's ID --------
                  • Hashtable - Save (SoE_DistProj + SoE_MoveReal) as 1 of SoE_handle in SoE_hash
                  • -------- Selects all enemies around the projectile, if any are found, proceeds to explode --------
                  • Set SoE_Tempug = (Units within 90.00 of SoE_Tempp3 matching ((((Matching unit) belongs to an ally of Player 1 (Red)) Equal to True) and ((((Matching unit) is Magic Immune) Equal to False) and ((False Equal to False) and (((Matching unit) is A structure) Equal to False)))))
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Number of units in SoE_Tempug) Greater than 0
                    • Then - Actions
                      • -------- Damages the units in the Tempug, and adds them to the HitGroup --------
                      • Unit Group - Pick every unit in SoE_Tempug and do (Actions)
                        • Loop - Actions
                          • -------- Sets the picked unit to the variable "SoE_DamU" --------
                          • Set SoE_DamPick = (Picked unit)
                          • -------- Saves the location of the picked unit --------
                          • Set SoE_DamLoc = (Position of SoE_DamPick)
                          • -------- Causes the projectile to damage the picked unit (The damage is set in the "Launch" trigger) --------
                          • Unit - Cause SoE_Tempu to damage SoE_DamPick, dealing SoE_Damage damage of attack type Spells and damage type Normal
                          • -------- Creates an effect dummy on the picked unit's location, and adds an expiration timer to the dummy --------
                          • Unit - Create 1 Dummy Immolation Effect for Player 12 (Brown) at SoE_DamLoc facing Default building facing degrees
                          • Unit - Add a 0.05 second Generic expiration timer to (Last created unit)
                          • -------- Destroys the created point variable --------
                          • Custom script: call RemoveLocation(udg_SoE_DamLoc)
                          • -------- Sets the units hit = HitGroup (the same group as the Tempug), this only occurs if units are hit, and it updates for every unit hit --------
                          • Set SoE_HitGroup = (Units within 100.00 of SoE_Tempp3 matching ((((Matching unit) belongs to an ally of Player 1 (Red)) Equal to True) and ((((Matching unit) is dead) Equal to False) and ((((Matching unit) is in SoE_HitGroup) Equal to False) and (((Matching unit) is A structure
                      • -------- Kills the projectile and removes it from the group --------
                      • Unit Group - Remove SoE_Tempu from SoE_ProjGroup
                      • Unit - Remove SoE_Tempu from the game
                      • -------- Cleans "child hashtables" of the projectile (key SoE_handle), this avoids leaks --------
                      • Hashtable - Clear all child hashtables of child SoE_handle in (Last created hashtable)
                    • Else - Actions
                      • -------- If no units were found near the projectile, nothing happens. The projectile continues onward --------
                  • -------- Removes the points and the temporary group --------
                  • Custom script: call RemoveLocation(udg_SoE_Tempp2)
                  • Custom script: call RemoveLocation(udg_SoE_Tempp3)
                  • Custom script: call DestroyGroup(udg_SoE_Tempug)
                • Else - Actions
                  • -------- If the projectile has traveled 1500 range or beyond, it is removed from the group and also just removed --------
                  • Unit Group - Remove SoE_Tempu from SoE_ProjGroup
                  • Unit - Remove SoE_Tempu from the game
                  • -------- Cleans "child hashtables" of the projectile (key SoE_handle), this avoids leaks --------
                  • Hashtable - Clear all child hashtables of child SoE_handle in (Last created hashtable)
        • Else - Actions
          • -------- If the difficulty is Easy or Normal, nothing happens in this part of the trigger --------
  • Spires of Enmity Launch
    • Events
      • Time - Every 0.75 seconds of game time
    • Conditions
    • Actions
      • -------- Loops through the 4 Spires of Enmity (they are saved into the unit array in "Spires of Enmity Initiate") --------
      • For each (Integer A) from 1 to 4, do (Actions)
        • Loop - Actions
          • -------- Saves the location of the currently active Spire (Note that I DO NOT use the SoE_Loc from "MoveLoop" as I don't want the triggers to conflict) --------
          • -------- Also Note: The "SpireU" unit array is configured in "Spires of Enmity Initiate" --------
          • Set SoE_Tempp1 = (Position of SoE_SpireU[(Integer A)])
          • -------- Sets the damage dealt by projectiles, calculated by Difficulty (Difficulty_i x 200 - 200) --------
          • Set SoE_Damage = ((200.00 x (Real(Difficulty_integer))) - 200.00)
          • -------- Sets an angle for the projectile to be launched towards --------
          • Set SoE_AngleProj = (Random angle)
          • -------- Creates an SoE Missile Dummy at the Spire's location --------
          • Unit - Create 1 Dummy SpireOfEnmity Projectile for Player 12 (Brown) at SoE_Tempp1 facing SoE_AngleProj degrees
          • -------- Saves the newly created projectile in a variable --------
          • Set SoE_Tempu = (Last created unit)
          • -------- Saves the handle of the projectile unit (again; an integer) for use in hashtables --------
          • Set SoE_handle = (Key (Last created unit))
          • -------- Adds the unit to the "GroupProj" - which is a unit group for the projectiles --------
          • Unit Group - Add SoE_Tempu to SoE_ProjGroup
          • -------- Sets the distance traveled by the missile so far (which is 0) --------
          • Set SoE_DistProj = 0.00
          • -------- Saves the angle (the randomized one from earlier) and the distance as 0 and 1 respectively in the hashtable "SoE_hash" --------
          • -------- The hashtable is created/set in "Hashtables" - this is were i use the Handle, it allows me to connect the values to the unit --------
          • Hashtable - Save SoE_AngleProj as 0 of SoE_handle in SoE_hash
          • Hashtable - Save SoE_DistProj as 1 of SoE_handle in SoE_hash
          • -------- Removes the point variable to avoid leaking --------
          • Custom script: call RemoveLocation(udg_SoE_Tempp1)
NOTE - The third mechanic is that the Spires of Enmity also launch projectiles in random directions. These work well enough, and are indeed copy-paste of work I've done earlier. But something in those triggers makes the Lightning effects not appear at all.

EDIT2: It seems that whether or not the lightning effects work is rather inconsistent. Sometimes all 4 will display and work perfectly, sometimes only 1 works, sometimes none at all. As if the succes of the trigger was based on some random chance?
 
Last edited:
Level 5
Joined
Feb 8, 2015
Messages
93
Inglorious self-bump/Double post:

I have now discovered that whether or not the trigger works is, indeed, quite random.
On easy, normal, hard, or "suicide" difficulty, it makes no matter. The trigger randomly works on like 2/3 restarts, with no difference to them whatsoever.
I am truly at a loss here...
Can anyone find the reason behind this?
 
Level 5
Joined
Feb 8, 2015
Messages
93
Could you show all the triggers? There are some references that I don't see being initilized with the trigger that make's it confusing to read.

Which things for instance? As far as I can recall, these triggers rely solely on eachother - and the the difficulty integer, but that is indeed nothing but an integer.
 
Level 5
Joined
Feb 8, 2015
Messages
93
  • Set SoE_BP = (Position of BossU)

I don't see BossU anywhere. I assumed you had another trigger with other stuff using BossU.

It is set in a previous trigger, and it works fine for all other purposes, so that should not be the issue here.
You will also see that it works for creating the Spires, by now it is only the Lightning Effects that malfunction, sometimes working perfectly but sometimes not appearing at all
-everything else works though.
 
Level 37
Joined
Jul 22, 2015
Messages
3,485
It is set in a previous trigger, and it works fine for all other purposes, so that should not be the issue here.
You will also see that it works for creating the Spires, by now it is only the Lightning Effects that malfunction, sometimes working perfectly but sometimes not appearing at all
-everything else works though.

You missed the point. I never said that BossU was the problem, I just want to see all the triggers so that I can get a clear view of what's going on behind the scenes.

I like to read things from start to finish. I dun like starting in the middle.
 
Level 5
Joined
Feb 8, 2015
Messages
93
These are the only other relevant triggers:

(The first "BossU")

  • Initialization
    • Events
      • Time - Elapsed game time is 0.01 seconds
    • Conditions
    • Actions
      • -------- Floating Text is initially ON for both players --------
      • Set FloatingTextCheck[1] = True
      • Set FloatingTextCheck[2] = True
      • Player Group - Add Player 1 (Red) to PlayerGroup_FloatingText
      • Player Group - Add Player 2 (Blue) to PlayerGroup_FloatingText
      • -------- Unit Settings and variables --------
      • Set HeroUnit[1] = Dragonknight 0014 <gen>
      • Set HeroUnit[2] = Cleric 0015 <gen>
      • Set BossU = Mourdan Hellsinger 0024 <gen>
      • Unit - Add classification of Mechanical to BossU
      • Set BossStartPoint = (Position of BossU)
      • Unit - Make BossU Invulnerable
      • -------- Saves the four Necrotic Pillars in a unit array variable, and then makes them hidden and neutral passive --------
      • Set Pillar_UArray[1] = Necrotic Pillar 0073 <gen>
      • Set Pillar_UArray[2] = Necrotic Pillar 0069 <gen>
      • Set Pillar_UArray[3] = Necrotic Pillar 0071 <gen>
      • Set Pillar_UArray[4] = Necrotic Pillar 0072 <gen>
      • For each (Integer A) from 1 to 4, do (Actions)
        • Loop - Actions
          • Unit - Hide Pillar_UArray[(Integer A)]
      • -------- Environmental Settings --------
      • Game - Set the time of day to 12.00
      • Player - Change color of Player 12 (Brown) to Green, Changing color of existing units
      • Environment - Set fog to style Linear, z-start 0.00, z-end 7000.00, density 0.50 and color (13.00%, 86.00%, 13.00%)
      • Camera - Set the camera bounds for Player 1 (Red) to Area1 CameraBounds <gen>
      • Camera - Set the camera bounds for Player 2 (Blue) to Area1 CameraBounds <gen>
      • -------- Disabled SpellBooks --------
      • Player - Disable InvisibleSpellBook (Disabled in initial trigger) for Player 1 (Red)
      • Player - Disable InvisibleSpellBook (Disabled in initial trigger) for Player 2 (Blue)
      • -------- Single or Multiplayer Detection (Note that "Hero Selection Buttons" only triggers if there are two active players) --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • And - All (Conditions) are true
            • Conditions
              • (Player 1 (Red) slot status) Equal to Is playing
              • (Player 2 (Blue) slot status) Equal to Is playing
        • Then - Actions
          • -------- If both Player 1 and Player 2 are active, this initiates the selection system --------
          • Trigger - Run Hero Selection Buttons <gen> (checking conditions)
          • Trigger - Turn on Hero Selection Choice <gen>
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Player 1 (Red) slot status) Equal to Is playing
              • (Player 2 (Blue) slot status) Not equal to Is playing
            • Then - Actions
              • -------- If only player 1 is active... --------
              • Unit - Change ownership of HeroUnit[1] to Player 1 (Red) and Retain color
              • Unit - Change ownership of HeroUnit[2] to Player 1 (Red) and Retain color
              • Trigger - Run Difficulty Selection Buttons <gen> (checking conditions)
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Player 1 (Red) slot status) Not equal to Is playing
              • (Player 2 (Blue) slot status) Equal to Is playing
            • Then - Actions
              • -------- If only player 2 is active... --------
              • Unit - Change ownership of HeroUnit[1] to Player 2 (Blue) and Retain color
              • Unit - Change ownership of HeroUnit[2] to Player 2 (Blue) and Retain color
              • Trigger - Run Difficulty Selection Buttons <gen> (checking conditions)
            • Else - Actions
      • -------- Difficulty Setting: If there is no player Red, Blue picks. Otherwise it is simply Player 1 (Red) //Note that Difficulty comes AFTER Hero Selection// --------


  • Phase 5 Initialization
    • Events
      • Player - Player 1 (Red) types a chat message containing -test p5 as An exact match
    • Conditions
    • Actions
      • -------- FOR TESTING PURPOSES: Turns off mechanics from Phase 1 --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Entered chat string) Equal to -test p5
        • Then - Actions
          • Trigger - Turn off Fight Initiate and First Portal <gen>
          • Trigger - Turn off Portal Decay <gen>
          • Destructible - Kill ForceWall Small (Horizontal) 0187 <gen>
          • Unit - Change ownership of BossU to Player 12 (Brown) and Change color
          • Unit - Make BossU Vulnerable
          • Unit - Move BossU instantly to ((Center of Arena Square <gen>) offset by 320.00 towards 270.00 degrees)
        • Else - Actions
      • -------- Turns off mechanics that ran in Phase 4 --------
      • Trigger - Turn off p4 Deathclock Loop <gen>
      • Trigger - Turn off p4 DarkBombs <gen>
      • Trigger - Turn off p4 VoidWells Spawn <gen>
      • Trigger - Turn off p4 VoidWells LaunchLoop <gen>
      • Trigger - Turn off p4 VoidWells MoveLoop <gen>
      • Unit Group - Pick every unit in VoidWell_WellsGroup and do (Actions)
        • Loop - Actions
          • Unit - Kill (Picked unit)
      • -------- Displays a message from the Boss --------
      • Cinematic - Send transmission to (All players) from Mourdan Hellsinger 0024 <gen> named Mourdan Says: Play No sound and display THIS IS MY REALM! I.... Modify duration: Add 1.50 seconds and Don't wait
      • -------- Replaces the Boss with a "Manifestation of Hatred" --------
      • Unit - Replace BossU with a Manifestation of Hatred (Phase 5 Boss Morph) using The new unit's max life and mana
      • -------- Sets BossU to be the newly replaced unit --------
      • Set BossU = (Last replaced unit)
      • -------- Turns on aesthetic triggers - such as camera shaking and random lightning effects --------
      • Trigger - Turn on Realm Undone <gen>
      • -------- Turns on mechanics for Phase 5 --------
      • Trigger - Turn on Sparks of Anger <gen>
      • Trigger - Turn on Sparks of Anger Loop <gen>
      • -------- Runs the Spires of Enmity Initiate --------
      • Trigger - Run Spires of Enmity Initiate <gen> (checking conditions)
Else there really isn't anything related to the 3 triggers concerning the "Spires of Enmity".


EDIT FIXED!
It turns out the Lightning Effects will not display if they are created when the players do not have sight of them. I.e.

>Iseedeadpeople
>-test p5
>Works

but
>-test p5
>Iseedeadpeople
>Does not work

The randomization was caused by me sometimes testing with vision first, and sometimes vision after.
I fixed it by just adding a visibility modifier for both players before the lightning effects are spawned.

Help much appreciated in any case though!
 
Level 37
Joined
Jul 22, 2015
Messages
3,485
These are the only other relevant triggers:

(The first "BossU")

  • Initialization
    • Events
      • Time - Elapsed game time is 0.01 seconds
    • Conditions
    • Actions
      • -------- Floating Text is initially ON for both players --------
      • Set FloatingTextCheck[1] = True
      • Set FloatingTextCheck[2] = True
      • Player Group - Add Player 1 (Red) to PlayerGroup_FloatingText
      • Player Group - Add Player 2 (Blue) to PlayerGroup_FloatingText
      • -------- Unit Settings and variables --------
      • Set HeroUnit[1] = Dragonknight 0014 <gen>
      • Set HeroUnit[2] = Cleric 0015 <gen>
      • Set BossU = Mourdan Hellsinger 0024 <gen>
      • Unit - Add classification of Mechanical to BossU
      • Set BossStartPoint = (Position of BossU)
      • Unit - Make BossU Invulnerable
      • -------- Saves the four Necrotic Pillars in a unit array variable, and then makes them hidden and neutral passive --------
      • Set Pillar_UArray[1] = Necrotic Pillar 0073 <gen>
      • Set Pillar_UArray[2] = Necrotic Pillar 0069 <gen>
      • Set Pillar_UArray[3] = Necrotic Pillar 0071 <gen>
      • Set Pillar_UArray[4] = Necrotic Pillar 0072 <gen>
      • For each (Integer A) from 1 to 4, do (Actions)
        • Loop - Actions
          • Unit - Hide Pillar_UArray[(Integer A)]
      • -------- Environmental Settings --------
      • Game - Set the time of day to 12.00
      • Player - Change color of Player 12 (Brown) to Green, Changing color of existing units
      • Environment - Set fog to style Linear, z-start 0.00, z-end 7000.00, density 0.50 and color (13.00%, 86.00%, 13.00%)
      • Camera - Set the camera bounds for Player 1 (Red) to Area1 CameraBounds <gen>
      • Camera - Set the camera bounds for Player 2 (Blue) to Area1 CameraBounds <gen>
      • -------- Disabled SpellBooks --------
      • Player - Disable InvisibleSpellBook (Disabled in initial trigger) for Player 1 (Red)
      • Player - Disable InvisibleSpellBook (Disabled in initial trigger) for Player 2 (Blue)
      • -------- Single or Multiplayer Detection (Note that "Hero Selection Buttons" only triggers if there are two active players) --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • And - All (Conditions) are true
            • Conditions
              • (Player 1 (Red) slot status) Equal to Is playing
              • (Player 2 (Blue) slot status) Equal to Is playing
        • Then - Actions
          • -------- If both Player 1 and Player 2 are active, this initiates the selection system --------
          • Trigger - Run Hero Selection Buttons <gen> (checking conditions)
          • Trigger - Turn on Hero Selection Choice <gen>
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Player 1 (Red) slot status) Equal to Is playing
              • (Player 2 (Blue) slot status) Not equal to Is playing
            • Then - Actions
              • -------- If only player 1 is active... --------
              • Unit - Change ownership of HeroUnit[1] to Player 1 (Red) and Retain color
              • Unit - Change ownership of HeroUnit[2] to Player 1 (Red) and Retain color
              • Trigger - Run Difficulty Selection Buttons <gen> (checking conditions)
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Player 1 (Red) slot status) Not equal to Is playing
              • (Player 2 (Blue) slot status) Equal to Is playing
            • Then - Actions
              • -------- If only player 2 is active... --------
              • Unit - Change ownership of HeroUnit[1] to Player 2 (Blue) and Retain color
              • Unit - Change ownership of HeroUnit[2] to Player 2 (Blue) and Retain color
              • Trigger - Run Difficulty Selection Buttons <gen> (checking conditions)
            • Else - Actions
      • -------- Difficulty Setting: If there is no player Red, Blue picks. Otherwise it is simply Player 1 (Red) //Note that Difficulty comes AFTER Hero Selection// --------


  • Phase 5 Initialization
    • Events
      • Player - Player 1 (Red) types a chat message containing -test p5 as An exact match
    • Conditions
    • Actions
      • -------- FOR TESTING PURPOSES: Turns off mechanics from Phase 1 --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Entered chat string) Equal to -test p5
        • Then - Actions
          • Trigger - Turn off Fight Initiate and First Portal <gen>
          • Trigger - Turn off Portal Decay <gen>
          • Destructible - Kill ForceWall Small (Horizontal) 0187 <gen>
          • Unit - Change ownership of BossU to Player 12 (Brown) and Change color
          • Unit - Make BossU Vulnerable
          • Unit - Move BossU instantly to ((Center of Arena Square <gen>) offset by 320.00 towards 270.00 degrees)
        • Else - Actions
      • -------- Turns off mechanics that ran in Phase 4 --------
      • Trigger - Turn off p4 Deathclock Loop <gen>
      • Trigger - Turn off p4 DarkBombs <gen>
      • Trigger - Turn off p4 VoidWells Spawn <gen>
      • Trigger - Turn off p4 VoidWells LaunchLoop <gen>
      • Trigger - Turn off p4 VoidWells MoveLoop <gen>
      • Unit Group - Pick every unit in VoidWell_WellsGroup and do (Actions)
        • Loop - Actions
          • Unit - Kill (Picked unit)
      • -------- Displays a message from the Boss --------
      • Cinematic - Send transmission to (All players) from Mourdan Hellsinger 0024 <gen> named Mourdan Says: Play No sound and display THIS IS MY REALM! I.... Modify duration: Add 1.50 seconds and Don't wait
      • -------- Replaces the Boss with a "Manifestation of Hatred" --------
      • Unit - Replace BossU with a Manifestation of Hatred (Phase 5 Boss Morph) using The new unit's max life and mana
      • -------- Sets BossU to be the newly replaced unit --------
      • Set BossU = (Last replaced unit)
      • -------- Turns on aesthetic triggers - such as camera shaking and random lightning effects --------
      • Trigger - Turn on Realm Undone <gen>
      • -------- Turns on mechanics for Phase 5 --------
      • Trigger - Turn on Sparks of Anger <gen>
      • Trigger - Turn on Sparks of Anger Loop <gen>
      • -------- Runs the Spires of Enmity Initiate --------
      • Trigger - Run Spires of Enmity Initiate <gen> (checking conditions)
Else there really isn't anything related to the 3 triggers concerning the "Spires of Enmity".


EDIT FIXED!
It turns out the Lightning Effects will not display if they are created when the players do not have sight of them. I.e.

>Iseedeadpeople
>-test p5
>Works

but
>-test p5
>Iseedeadpeople
>Does not work

The randomization was caused by me sometimes testing with vision first, and sometimes vision after.
I fixed it by just adding a visibility modifier for both players before the lightning effects are spawned.

Help much appreciated in any case though!

Oh interesting xP I've been staring at the lightning creation and they all look fine :( was about to give up.

However, instead of using the Lightning - Create a Lightning GUI function, you should use AddLightningEx()!
 
Status
Not open for further replies.
Top