Two Inexplicable Bugs

Edward

New Member
Reaction score
2
Hello,
I have a trigger that spawns 16 Spike Traps and 16 Fire Traps every 15 seconds and then removes all of them 3 seconds later. However, there are two bugs that occur.

The first bug is the strangest because it doesn't occur every time the trigger fires! It happens on average about 1 out of 4 times. The bug is that some Fire and Spike traps spawn in the center of the map, thus I had a to create another trigger to remove these periodically.

The second bug is that the Fire Traps in the 9th Fire Trap region do not remove themselves. I have checked several times that all of the variables are in place.

I suspect that there is some sort of heavy leak in these triggers. Here are the Fire and Spike traps.

Trigger:
  • Spike Traps
    • Events
      • Time - Every 15.00 seconds of game time
    • Conditions
    • Actions
      • For each (Integer B) from 1 to 16, do (Actions)
        • Loop - Actions
          • Custom script: set bj_wantDestroyGroup = true
          • Unit Group - Pick every unit in (Units in RegionSpikeDeath[(Integer B)]) and do (Unit - Kill (Picked unit))
          • Set Efixed = E[(Integer B)]
          • Sound - Play Spikes1 <gen> at 100.00% volume, located at Efixed with Z offset 0.00
          • Sound - Play Spikes2 <gen> at 100.00% volume, located at Efixed with Z offset 0.00
          • Destructible - Create a Cage at Efixed facing (Random angle) with scale 0.60 and variation 0
          • For each (Integer A) from 1 to 6, do (Actions)
            • Loop - Actions
              • Destructible - Create a Cage at (Efixed offset by 75.00 towards (60.00 x (Real((Integer A)))) degrees) facing (Random angle) with scale 0.60 and variation 0
      • Custom script: call RemoveLocation(udg_Efixed)
      • Wait 3.00 seconds
      • For each (Integer B) from 1 to 16, do (Actions)
        • Loop - Actions
          • Destructible - Pick every destructible in RegionSpikeDeath[(Integer B)] and do (Actions)
            • Loop - Actions
              • Destructible - Remove (Picked destructible)


Trigger:
  • Fire Traps
    • Events
      • Time - Every 15.00 seconds of game time
    • Conditions
    • Actions
      • For each (Integer B) from 1 to 16, do (Actions)
        • Loop - Actions
          • Custom script: set bj_wantDestroyGroup = true
          • Unit Group - Pick every unit in (Units in RegionFireDeath[(Integer B)]) and do (Unit - Kill (Picked unit))
          • Set Ffixed = F[(Integer B)]
          • Sound - Play FireScream2 <gen> at 100.00% volume, located at Ffixed with Z offset 0.00
          • Destructible - Create a Crates at Ffixed facing (Random angle) with scale 0.60 and variation 0
          • For each (Integer A) from 1 to 6, do (Actions)
            • Loop - Actions
              • Destructible - Create a Crates at (Ffixed offset by 75.00 towards (60.00 x (Real((Integer A)))) degrees) facing (Random angle) with scale 0.60 and variation 0
      • Custom script: call RemoveLocation(udg_Ffixed)
      • Wait 3.00 seconds
      • For each (Integer B) from 1 to 16, do (Actions)
        • Loop - Actions
          • Destructible - Pick every destructible in RegionFireDeath[(Integer B)] and do (Actions)
            • Loop - Actions
              • Destructible - Remove (Picked destructible)


This is the trigger I'm using to remove the bugged destructibles. Do Destructible Groups leak?
Trigger:
  • Remove Garbage
    • Events
      • Time - Every 3.00 seconds of game time
    • Conditions
    • Actions
      • Destructible - Pick every destructible in Remove Garbage <gen> and do (Actions)
        • Loop - Actions
          • Destructible - Remove (Picked destructible)
      • Destructible - Pick every destructible in A15 <gen> and do (Actions)
        • Loop - Actions
          • Destructible - Remove (Picked destructible)
 

Kling[o]

New Member
Reaction score
7
I'm not sure but I think you should remove those waits and use another way to do that waits whitout using the "wait" function. Secondly , Integer A and B can cause bug, you should maybe use a custom integer. Third, you use the same integer for the both trigger, maybe you should 2 different. Oh yeah , you could maybe put the whole trigger because I need see you setting "E" anywhere
 

hgkjfhfdsj

Active Member
Reaction score
55
leak here:
Trigger:
  • Efixed offset by 75.00

perhaps combine the two triggers? since they both have the same event..

also whats this? where/how did you set it
Trigger:
  • Units in RegionSpikeDeath[(Integer B)]

(certain) groups dont need to be destroyed
 

Edward

New Member
Reaction score
2
Well the Garbage collection trigger works perfectly so that you can't see the bug. Still it is annoying.

Perhaps you guys are misunderstanding as well. 99% of the traps work perfectly 100% of the time, there's just one trap that's not working right only 25% of the time.

There is still no explanation for the doodad spawns in the center of the map either.

The next step from here is to upload my map so you can take a look.
 

Edward

New Member
Reaction score
2
Here is the map. I deleted some sound files so I could upload the attachment.
 

Attachments

  • Footmen vs Grunts 5.w3x
    692 KB · Views: 83

hgkjfhfdsj

Active Member
Reaction score
55
2 things i picked up (not sure if its related to the bugs..)
- your regionfiredeath[15] theres two of them xD change one to 16

where are you setting the RegionSpikeDeath[Integer B]? are you reusing them? if you are
remove the set bj_wantDestroyGroup > you wouldnt want to destroy it when you are using it again

EDIT
and dont destroy the locations .. thats the reason why one of them is being created in the middle > it doesnt have a point referenced after you destroyed it so it sets (0,0) as default.
 

Edward

New Member
Reaction score
2
Well you fixed the first problem, I had two settings for RegionFireDeath[15]! I'll give you rep points for that!

However I don't understand why I shouldn't be using the remove group command. If I don't have that custom script there, I'll get massive group leaks, unless I am, once again, wrong.

RegionSpikeDeath[Integer B] comes from the "Variable Triggers" folder. Each of these are set to actual regions I made on the map.
 

hgkjfhfdsj

Active Member
Reaction score
55
actually ignore what i said about the remove group leak (keep the bj_wantDestroy), your right, i just realized it when i saw where you were setting RegionSpikeDeath[Integer]. thought it was a unit group xD
but remove the destroylocation... set Efixed as E[Integer B] offset by 75.00 towards .. instead and destroy that. E[Integer B] you are reusing but the offset leaks
 

Edward

New Member
Reaction score
2
How do I fix the offset leaks?

EDIT:
Actually I got an idea hold on :)

The idea didn't work, but I got some progress on the bug.

The 16th loop, for Fire Trap 16 and Spike Trap 16 don't spawn traps, instead they spawn their trap in the center of the map. It seems that the final loop (16th) for both trigger is bugged.
 

Edward

New Member
Reaction score
2
Well I finally got around to clearing the offset leaks. Take a look at this insanity! If can you manage to read it without your eyes popping, are there any more leaks here? LeakCheck v3.1 says there aren't, but it also said that previously about the offset leaks, meaning LeakCheck isn't foolproof.
Trigger:
  • Spike Traps Visual
    • Events
      • Time - Every 15.00 seconds of game time
    • Conditions
    • Actions
      • For each (Integer B) from 1 to 17, do (Actions)
        • Loop - Actions
          • Set Efixed[(Integer B)] = E[(Integer B)]
          • Set X2 = (Integer B)
          • Destructible - Create a Cage at Efixed[(Integer B)] facing (Random angle) with scale 0.60 and variation 0
          • For each (Integer X) from 1 to 6, do (Actions)
            • Loop - Actions
              • Set Gfixed[X] = Efixed[X2]
          • For each (Integer Y) from 1 to 6, do (Actions)
            • Loop - Actions
              • Destructible - Create a Cage at (Gfixed[Y] offset by 75.00 towards (60.00 x (Real(Y))) degrees) facing (Random angle) with scale 0.60 and variation 0
      • Custom script: call RemoveLocation (udg_Efixed[GetForLoopIndexB()])
      • Wait 3.00 seconds
      • For each (Integer B) from 1 to 17, do (Actions)
        • Loop - Actions
          • Destructible - Pick every destructible in RegionSpikeDeath[(Integer B)] and do (Actions)
            • Loop - Actions
              • Destructible - Remove (Picked destructible)
          • For each (Integer A) from 1 to 6, do (Actions)
            • Loop - Actions
              • Custom script: call RemoveLocation (udg_Gfixed[GetForLoopIndexA()])

I increased the first loop from 16 times to 17 times so it no longer bugs the 16th spawn point, instead the 17th non-existing spawn point bugs which I have made the center of the map. I modified the Garbage Collection Trigger to make the 17th bug spawn unnoticeable, thus "fixing" the bug in a virtual sense.

I also separated the Unit Killing part into another trigger.

I also used custom Loop Integers within the B Loop as you suggested

Lastly, I have the Remove Location Gfixed[A] (from A 1 to 6) looping 17 times in respect to B.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top