• 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.

[Trigger] Glitchy Timer in 1.31?

Status
Not open for further replies.
So, my spell is supposed to loop the timer as to how a timer should. However, this particular spell for some reason instantly loops till 0 in less than a second span (while the ability is supposed to be about 10 seconds at the first level). I have debugged triggers to show the issue that allows me to get this conclusion. I use patch 1.31 for this particular work.


  • FShield Config
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- Shield Ability --------
      • Set FShieldAbility = Blizzard
      • -------- Shield Duration --------
      • Set FShieldDuration[1] = 10.00
      • Set FShieldDuration[2] = 20.00
      • Set FShieldDuration[3] = 30.00
      • -------- Shield Effect --------
      • Set FShieldEffectName = Ubershield/Ubershield Cosmic.mdx
      • -------- Shield Range --------
      • Set FShieldRange[1] = 600.00
      • Set FShieldRange[2] = 800.00
      • Set FShieldRange[3] = 1000.00
      • -------- Shield Scale --------
      • Set FShieldScale[1] = 7.00
      • Set FShieldScale[2] = 9.00
      • Set FShieldScale[3] = 11.00
      • -------- Shield Filter --------
      • Set FShieldFilterTrigger = FShield Filter <gen>
      • -------- Shield Loop --------
      • Set FShieldLoopTrigger = FShield Loop <gen>
      • -------- Loop Timeout --------
      • Set TSETimeout = 0.03
      • -------- DO NOT TOUCH --------
      • Custom script: call DestroyGroup(udg_FShieldGroup[0])
      • Custom script: call DestroyGroup(udg_FShieldGroup[1])
      • Trigger - Add to FShieldLoopTrigger the event (Time - Every FShieldTimeout seconds of game time)
  • FShield Start
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to FShieldAbility
    • Actions
      • -------- Core Data --------
      • Set FShieldMaxIndex = (FShieldMaxIndex + 1)
      • Set FShieldCaster = (Triggering unit)
      • Set FShieldLevel = (Level of FShieldAbility for FShieldCaster)
      • Set FShieldPoint = (Target point of ability being cast)
      • -------- Spell Effect --------
      • Set FShieldDurationRemaining[FShieldMaxIndex] = FShieldDuration[FShieldLevel]
      • Set FShieldGroup[FShieldMaxIndex] = (Units within FShieldRange[FShieldLevel] of FShieldPoint)
      • Unit Group - Pick every unit in FShieldGroup[FShieldMaxIndex] and do (Actions)
        • Loop - Actions
          • Set FShieldTargetUnit = (Picked unit)
          • Set FShieldFilterPass = False
          • Trigger - Run FShieldFilterTrigger (checking conditions)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • FShieldFilterPass Equal to True
            • Then - Actions
              • Unit - Make FShieldTargetUnit Invulnerable
            • Else - Actions
              • Unit Group - Remove FShieldTargetUnit from FShieldGroup[FShieldMaxIndex]
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • FShieldMaxIndex Equal to 1
        • Then - Actions
          • Trigger - Turn on FShieldLoopTrigger
        • Else - Actions
      • -------- Shield SFX --------
      • Set TSEPoint = (Target point of ability being cast)
      • Set TSEDuration = FShieldDuration[FShieldLevel]
      • Set TSEEffectName = FShieldEffectName
      • Set TSEScale = FShieldScale[FShieldLevel]
      • Trigger - Run TSERegister (checking conditions)
  • FShield Filter
    • Events
    • Conditions
      • (FShieldTargetUnit is A structure) Equal to True
      • (FShieldTargetUnit belongs to an ally of (Owner of FShieldCaster)) Equal to True
      • (Level of Invulnerable (Neutral) for FShieldTargetUnit) Equal to 0
    • Actions
      • Set FShieldFilterPass = True
  • FShield Loop
    • Events
    • Conditions
    • Actions
      • For each (Integer FShieldIndex) from 1 to FShieldMaxIndex, do (Actions)
        • Loop - Actions
          • Set FShieldDurationRemaining[FShieldIndex] = (FShieldDurationRemaining[FShieldIndex] - TSETimeout)
          • Game - Display to (All players) the text: (String(FShieldDurationRemaining[FShieldIndex]))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • FShieldDurationRemaining[FShieldIndex] Less than or equal to 0.00
            • Then - Actions
              • Game - Display to (All players) the text: Instance Over
              • Unit Group - Pick every unit in FShieldGroup[FShieldIndex] and do (Actions)
                • Loop - Actions
                  • Unit - Make FShieldTargetUnit Vulnerable
              • Custom script: call DestroyGroup(udg_FShieldGroup[udg_FShieldIndex])
              • Set FShieldDurationRemaining[FShieldIndex] = FShieldDurationRemaining[FShieldMaxIndex]
              • Set FShieldGroup[FShieldIndex] = FShieldGroup[FShieldMaxIndex]
              • Set FShieldIndex = (FShieldIndex - 1)
              • Set FShieldMaxIndex = (FShieldMaxIndex - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • FShieldMaxIndex Equal to 0
                • Then - Actions
                  • Game - Display to (All players) the text: No Instance Found
                  • Trigger - Turn off (This trigger)
                • Else - Actions
            • Else - Actions


The TSE is based on a to-be-uploaded patch of Timed Spell Effect [Patch 10] (the one on the map is patch 12). I attached the test map below. Before recommending me to switch to a countdown timer, I already tried using a countdown timer with the same result. Also, TSE logic is very similar to this, so TSE should've bugged out if this bugs out, but the test map shows it does not.

I'll be more than happy to share spell ownership to anyone who can find the core cause, as this frustrates me and my spell making targets.
 

Attachments

  • ForceShield.w3x
    1.1 MB · Views: 12
Level 29
Joined
Sep 26, 2009
Messages
2,595
you probably use incorrect variable. In your config trigger you set "Set TSETimeout = 0.03", yet when adding the timer, you use different variable:
  • Trigger - Add to FShieldLoopTrigger the event (Time - Every FShieldTimeout seconds of game time)

Edit: similar thing in your loop trigger, when you decrease the duration, you use TSETimeout
  • Set FShieldDurationRemaining[FShieldIndex] = (FShieldDurationRemaining[FShieldIndex] - TSETimeout)
 
you probably use incorrect variable. In your config trigger you set "Set TSETimeout = 0.03", yet when adding the timer, you use different variable:
  • Trigger - Add to FShieldLoopTrigger the event (Time - Every FShieldTimeout seconds of game time)
Damn, that was a shortsight on my end! It now works properly.

As promised, I'll be co-authoring the resources once I'm done polishing the test map. Thanks @Nichilus!

EDIT:

The patch used is 11, not 12, just a note for anyone else reading.
 
Last edited:
Status
Not open for further replies.
Top