• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Absolutely random bug

Status
Not open for further replies.
Level 19
Joined
Feb 25, 2009
Messages
2,004
I've been trying to discover the matter of this thing but I couldn't find any reference why it occurs.

It appears that the spells in my map works only for player 1 (red) and never for any other player.

Here are the triggers of both spells:


  • EA Start
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Elune's Arrow
    • Actions
      • Set EA_Caster[EA_MUI1] = (Triggering unit)
      • Set EA_Loc1[EA_MUI1] = (Position of (Triggering unit))
      • Set EA_Loc2 = (Target point of ability being cast)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering unit) has buff Damage (buff)) Equal to True
        • Then - Actions
          • Set EA_Damage[EA_MUI1] = (AbilityStat1[(Player number of (Owner of (Triggering unit)))] x 2.00)
        • Else - Actions
          • Set EA_Damage[EA_MUI1] = AbilityStat1[(Player number of (Owner of (Triggering unit)))]
      • Set EA_Range[EA_MUI1] = AbilityStat2[(Player number of (Owner of (Triggering unit)))]
      • Set EA_Speed[EA_MUI1] = AbilityStat3[(Player number of (Owner of (Triggering unit)))]
      • Set EA_Distance[EA_MUI1] = 0.00
      • Set EA_Timers[EA_MUI1] = 0.00
      • Set EA_TimerLevel[EA_MUI2] = 0
      • Unit - Create 1 Projectile Dummy for (Owner of (Triggering unit)) at EA_Loc1[EA_MUI1] facing EA_Loc2
      • Set EA_Dummy[EA_MUI1] = (Last created unit)
      • Special Effect - Create a special effect attached to the origin of (Last created unit) using war3mapImported\s_Enchanted Arrow.mdx
      • Set EA_ProjectileModel[EA_MUI1] = (Last created special effect)
      • Animation - Change (Last created unit) flying height to 50.00 at 0.00
      • Animation - Change (Last created unit)'s size to (125.00%, 125.00%, 125.00%) of its original size
      • Custom script: call RemoveLocation (udg_EA_Loc1[udg_EA_MUI1])
      • Custom script: call RemoveLocation (udg_EA_Loc2)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • EA_MUI1 Equal to 0
        • Then - Actions
          • Trigger - Turn on EA Loop <gen>
        • Else - Actions
      • Set EA_MUI1 = (EA_MUI1 + 1)
  • EA Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer EA_MUI2) from 0 to (EA_MUI1 - 1), do (Actions)
        • Loop - Actions
          • Custom script: set udg_X = GetUnitX(udg_EA_Dummy[udg_EA_MUI2])
          • Custom script: set udg_Y = GetUnitY(udg_EA_Dummy[udg_EA_MUI2])
          • Custom script: call SetUnitX( udg_EA_Dummy[udg_EA_MUI2] , udg_X + udg_EA_Speed[udg_EA_MUI2] * Cos( GetUnitFacing( udg_EA_Dummy[udg_EA_MUI2] ) * 0.017453292 ) )
          • Custom script: call SetUnitY( udg_EA_Dummy[udg_EA_MUI2] , udg_Y + udg_EA_Speed[udg_EA_MUI2] * Sin( GetUnitFacing( udg_EA_Dummy[udg_EA_MUI2] ) * 0.017453292 ) )
          • Set EA_Loc1[EA_MUI2] = (Position of EA_Dummy[EA_MUI2])
          • Set EA_Distance[EA_MUI2] = (EA_Distance[EA_MUI2] + EA_Speed[EA_MUI2])
          • Set EA_Timers[EA_MUI2] = (EA_Timers[EA_MUI2] + 4.13)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • EA_Timers[EA_MUI2] Greater than or equal to 33.00
            • Then - Actions
              • Set EA_TimerLevel[EA_MUI2] = (EA_TimerLevel[EA_MUI2] + 1)
              • Set EA_Timers[EA_MUI2] = 0.00
            • Else - Actions
          • Set EA_Targets = (Units within 100.00 of EA_Loc1[EA_MUI2] matching ((((Matching unit) is A Hero) Equal to True) and ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of EA_Dummy[EA_MUI2])) Equal to True))))
          • Custom script: set udg_EA_Main = FirstOfGroup(udg_EA_Targets)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • ((Playable map area) contains EA_Dummy[EA_MUI2]) Equal to False
                  • EA_Distance[EA_MUI2] Greater than or equal to EA_Range[EA_MUI2]
                  • EA_Main Not equal to No unit
            • Then - Actions
              • Set EA_MUI1 = (EA_MUI1 - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • EA_MUI1 Equal to 0
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions
              • Unit - Create 1 Caster Dummy for (Owner of EA_Caster[EA_MUI2]) at EA_Loc1[EA_MUI2] facing Default building facing degrees
              • Unit - Add Stun to (Last created unit)
              • Unit - Set level of Stun for (Last created unit) to EA_TimerLevel[EA_MUI2]
              • Unit - Order (Last created unit) to Human Mountain King - Storm Bolt EA_Main
              • Unit - Cause EA_Dummy[EA_MUI2] to damage EA_Main, dealing EA_Damage[EA_MUI2] damage of attack type Spells and damage type Magic
              • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • EA_Distance[EA_MUI2] Greater than Player_Longest_Shot[(Player number of (Owner of EA_Caster[EA_MUI2]))]
                • Then - Actions
                  • Set Player_Longest_Shot[(Player number of (Owner of EA_Caster[EA_MUI2]))] = EA_Distance[EA_MUI2]
                • Else - Actions
              • Custom script: call RemoveLocation (udg_EA_Loc1[udg_EA_MUI2])
              • Set EA_Loc1[EA_MUI2] = EA_Loc1[EA_MUI1]
              • Custom script: set udg_EA_Caster[udg_EA_MUI2] = null
              • Set EA_Caster[EA_MUI2] = EA_Caster[EA_MUI1]
              • Special Effect - Destroy EA_ProjectileModel[EA_MUI2]
              • Set EA_ProjectileModel[EA_MUI2] = EA_ProjectileModel[EA_MUI1]
              • Unit - Kill EA_Dummy[EA_MUI2]
              • Custom script: set udg_EA_Dummy[udg_EA_MUI2] = null
              • Set EA_Dummy[EA_MUI2] = EA_Dummy[EA_MUI1]
              • Set EA_Distance[EA_MUI2] = EA_Distance[EA_MUI1]
              • Set EA_Range[EA_MUI2] = EA_Range[EA_MUI1]
              • Set EA_Speed[EA_MUI2] = EA_Speed[EA_MUI1]
              • Set EA_Timers[EA_MUI2] = EA_Timers[EA_MUI1]
              • Set EA_TimerLevel[EA_MUI2] = EA_TimerLevel[EA_MUI1]
              • Set EA_MUI2 = (EA_MUI2 - 1)
            • Else - Actions



  • LP Start
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Leap
    • Actions
      • Set LP_Caster[LP_MUI1] = (Triggering unit)
      • Set LP_Angle[LP_MUI1] = (Facing of LP_Caster[LP_MUI1])
      • Set LP_MaxDistance[LP_MUI1] = AbilityStat4[(Player number of (Owner of (Triggering unit)))]
      • Set LP_Height[LP_MUI1] = 250.00
      • Set LP_Distance[LP_MUI1] = 0.00
      • Set LP_Speed[LP_MUI1] = AbilityStat5[(Player number of (Owner of (Triggering unit)))]
      • Animation - Change LP_Caster[LP_MUI1] turn speed to 0.00
      • Unit - Add Fly Trick to LP_Caster[LP_MUI1]
      • Unit - Remove Fly Trick from LP_Caster[LP_MUI1]
      • Unit - Turn collision for LP_Caster[LP_MUI1] Off
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • LP_MUI1 Equal to 0
        • Then - Actions
          • Trigger - Turn on LP Move <gen>
        • Else - Actions
      • Set LP_MUI1 = (LP_MUI1 + 1)
  • LP Move
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer LP_MUI2) from 0 to (LP_MUI1 - 1), do (Actions)
        • Loop - Actions
          • Custom script: set udg_X = GetUnitX(udg_LP_Caster[udg_LP_MUI2])
          • Custom script: set udg_Y = GetUnitY(udg_LP_Caster[udg_LP_MUI2])
          • Set LP_CasterLoc[LP_MUI2] = (Position of LP_Caster[LP_MUI2])
          • Set Parabola = (((2.00 x LP_Height[LP_MUI2]) / LP_MaxDistance[LP_MUI2]) x ((LP_MaxDistance[LP_MUI2] - LP_Distance[LP_MUI2]) x (LP_Distance[LP_MUI2] / LP_MaxDistance[LP_MUI2])))
          • Custom script: call SetUnitX( udg_LP_Caster[udg_LP_MUI2] , udg_X + udg_LP_Speed[udg_LP_MUI2] * Cos( GetUnitFacing( udg_LP_Caster[udg_LP_MUI2] ) * 0.017453292 ) )
          • Custom script: call SetUnitY( udg_LP_Caster[udg_LP_MUI2] , udg_Y + udg_LP_Speed[udg_LP_MUI2] * Sin( GetUnitFacing( udg_LP_Caster[udg_LP_MUI2] ) * 0.017453292 ) )
          • Animation - Change LP_Caster[LP_MUI2] flying height to Parabola at 0.00
          • Unit - Make LP_Caster[LP_MUI2] face LP_Angle[LP_MUI2] over 0.00 seconds
          • Animation - Play LP_Caster[LP_MUI2]'s walk animation
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • ((Playable map area) contains LP_Caster[LP_MUI2]) Equal to False
                  • (LP_Caster[LP_MUI2] has buff Ensare (Ground 2)) Equal to True
            • Then - Actions
              • Unit - Move LP_Caster[LP_MUI2] instantly to LP_CasterLoc[LP_MUI2]
            • Else - Actions
          • Set LP_Distance[LP_MUI2] = (LP_Distance[LP_MUI2] + LP_Speed[LP_MUI2])
          • Custom script: call RemoveLocation (udg_LP_CasterLoc[udg_LP_MUI2])
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • LP_Distance[LP_MUI2] Greater than or equal to LP_MaxDistance[LP_MUI2]
            • Then - Actions
              • Set LP_MUI1 = (LP_MUI1 - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • LP_MUI1 Equal to 0
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions
              • Unit - Turn collision for LP_Caster[LP_MUI2] On
              • Set Temp_Loc4 = (Position of LP_Caster[LP_MUI2])
              • Unit - Create 1 Caster Dummy for (Owner of LP_Caster[LP_MUI2]) at Temp_Loc4 facing Default building facing degrees
              • Unit - Add Speed (skill) to (Last created unit)
              • Unit - Order (Last created unit) to Orc Shaman - Bloodlust LP_Caster[LP_MUI2]
              • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
              • Animation - Change LP_Caster[LP_MUI2] turn speed to (Default turn speed of LP_Caster[LP_MUI2])
              • Animation - Change LP_Caster[LP_MUI2] flying height to 0.00 at 0.00
              • Unit - Order LP_Caster[LP_MUI2] to Stop
              • Set LP_Caster[LP_MUI2] = No unit
              • Set LP_Caster[LP_MUI2] = LP_Caster[LP_MUI1]
              • Set LP_Distance[LP_MUI2] = LP_Distance[LP_MUI1]
              • Set LP_MaxDistance[LP_MUI2] = LP_MaxDistance[LP_MUI1]
              • Set LP_MUI2 = (LP_MUI2 - 1)
            • Else - Actions


"AbilityStat" variables are used for upgrades and varry based on the level of each upgrade.
Their values goes from 2000 to 3000 for Elune's Arrow and 650 to 800 for Leap.
All suggestions are acceptable.
 
Level 25
Joined
Jul 10, 2006
Messages
3,315
  • For each (Integer EA_MUI2) from 0 to (EA_MUI1 - 1), do (Actions)
  • Set EA_MUI2 = (EA_MUI2 - 1)
That seems a little off.

For MPI, I usually Pick Every Player for my main loop, and index the variables using player number.

Let's compare notes. Here's a spell similar to your arrow, that is definitely working for multiple players.

Casting:
  • LongShotCast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Power Shot
    • Actions
      • Set l[0] = (Position of (Triggering unit))
      • Set l[1] = (Target point of ability being cast)
      • Set l[2] = (l[0] offset by 120.00 towards (Angle from l[0] to l[1]) degrees)
      • Unit - Create 1 Long Shot for (Owner of (Triggering unit)) at l[2] facing (Angle from l[0] to l[1]) degrees
      • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
      • Unit Group - Add (Last created unit) to longshotGroup
      • Custom script: call RemoveLocation(udg_l[0])
      • Custom script: call RemoveLocation(udg_l[1])
      • Custom script: call RemoveLocation(udg_l[2])
Looping: (this is in a trigger looping at 0.03 with a whole bunch more Unit Group - Pick Every actions for each missile type)
  • Unit Group - Pick every unit in longshotGroup and do (Actions)
    • Loop - Actions
      • Set ip = (Player number of (Owner of (Picked unit)))
      • Set l[0] = (Position of (Picked unit))
      • Set l[1] = (l[0] offset by 60.00 towards (Facing of (Picked unit)) degrees)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Terrain pathing at l[1] of type Walkability is off) Equal to False
        • Then - Actions
          • Unit - Move (Picked unit) instantly to l[1]
        • Else - Actions
          • Unit Group - Remove (Picked unit) from longshotGroup
          • Unit - Kill (Picked unit)
      • Set ug = (Units within 65.00 of l[1] matching ((Matching unit) Not equal to (Picked unit)))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (ug is empty) Equal to False
        • Then - Actions
          • Set u = (Random unit from ug)
          • Unit - Cause hero[ip] to damage u, dealing 70.00 damage of attack type Pierce and damage type Normal
          • Unit Group - Remove (Picked unit) from longshotGroup
          • Unit - Kill (Picked unit)
        • Else - Actions
      • Custom script: call DestroyGroup(udg_ug)
      • Custom script: call RemoveLocation(udg_l[0])
      • Custom script: call RemoveLocation(udg_l[1])
This does allow for multiple instances per player, now that I think about it.

You shouldn't be too worried about it being less efficient than it could be; since you only have one per player.

But the problem is definitely somewhere between your EA_MUI1 etc variables.
 
Status
Not open for further replies.
Top