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

[Trigger] Symbol "udg_Variable" already defined as a global variable when creating local variable?

Status
Not open for further replies.
Level 12
Joined
Feb 5, 2018
Messages
521
So while I was using a shadowed global variable things went as expected until now.

I wanted to make a dps calculation for each player that resets every 5 seconds.

Here is screenshot of the error and the trigger below.

I already checked that this is the only trigger that uses this variable.

  • Dps
    • Events
      • Game - DamageEvent becomes Equal to 1.00
    • Conditions
      • (Owner of DamageEventSource) Not equal to Player 14 (Navy)
      • (Owner of DamageEventSource) Not equal to Player 21 (Coal)
      • (Owner of DamageEventSource) Not equal to Neutral Hostile
      • DamageEventAmount Less than 99999.00
    • Actions
      • Custom script: local unit udg_DPS_Unit = udg_DamageEventSource
      • Custom script: local real COUNTDOWN = 5
      • Custom script: local timer DPSTIMER
      • Custom script: local integer udg_DPS_Cv = GetConvertedPlayerId(GetOwningPlayer(udg_DPS_Unit))
      • Custom script: local integer udg_DPS_PlayerNumber = GetConvertedPlayerId(GetOwningPlayer(udg_DPS_Unit))
      • Custom script: local real array udg_DPS_Count
      • Set VariableSet DPS_Count[DPS_Cv] = (DPS_Count[DPS_Cv] + DamageEventAmount)
      • Custom script: set DPSTIMER = CreateTimer()
      • Custom script: call TimerStart(DPSTIMER,COUNTDOWN,false,null)
      • Custom script: call PolledWait(COUNTDOWN)
      • Multiboard - Set the text for MultiBoard item in column 3, row 2 to (String(((Integer(DPS_Count[(Player number of Player 1 (Red))])) / 60)))
      • Multiboard - Set the text for MultiBoard item in column 3, row 3 to (String(((Integer(DPS_Count[(Player number of Player 2 (Blue))])) / 60)))
      • Multiboard - Set the text for MultiBoard item in column 3, row 4 to (String(((Integer(DPS_Count[(Player number of Player 3 (Teal))])) / 60)))
      • Multiboard - Set the text for MultiBoard item in column 3, row 5 to (String(((Integer(DPS_Count[(Player number of Player 4 (Purple))])) / 60)))
      • Custom script: call PauseTimer(DPSTIMER)
      • Custom script: call DestroyTimer(DPSTIMER)
      • Custom script: set udg_DPS_Unit = null
      • Set VariableSet DPS_Count[DPS_Cv] = 0.00
 

Attachments

  • Error.png
    Error.png
    58.7 KB · Views: 19
Level 12
Joined
Feb 5, 2018
Messages
521
Oohh, maybe my memory have failed me, but I am pretty sure you were able to use "local variable array" in the past.
 
Status
Not open for further replies.
Top