Help! All triggers stopped working

Togrias

New Member
Reaction score
0
Hi! My map's triggers stopped working for some odd reason! None of them work at all. My map is entirely GUI-based save for a few custom scripts to minimize memory leaks. It does not have many variables. Some arrays are quite large up to 500+ in size, but I'm pretty sure they're nowhere near the limit of 8192(?).

Recently I added a new trigger. It's meant to "detect" and replace all attacks. Whenever a unit attacks another, I give it the ability "Channel" instead and order it to do it, so that I can entirely do up attacks in the form of triggers. This is what I have:

Events
Unit - A unit Is attacked
Conditions
Actions
Unit - Pause (Attacking unit)
Unit - Unpause (Attacking unit)
Unit - Add Channel (Attack) to (Attacking unit)
Unit - Order (Attacking unit) to Special Malganis - Soul Preservation (Attacked unit)

My map also uses many other triggered spells with a rather complicated triggered spell engine (at least for GUI-based maps) but absolutely nothing I know of can actually cause ALL my triggers to stop working, not just newly done triggers. Previously all my triggered spells ran flawlessly.

I tried to fix it on my own. I lowered a newly created array size of 2000+ to 500+, then viola! All triggers functioned normally again. This is quite puzzling as 2000+ is nowhere near the limit either but never mind. Then I made a few edits here and there and my triggers stopped working again! This time I have no idea where to even start fixing it.

Even the simplest debug trigger like this will not work:

Untitled Trigger 003
Events
Time - Elapsed game time is 5.00 seconds
Conditions
Actions
Game - Display to (All players) the text: hi

Does anyone out there know of anything that I may have done that can result in some catastrophic failure of all my triggers?
 

rodead

Active Member
Reaction score
42
în your code the unit gets damage i don't know id this is the mean of it but first of all i can't find any problems in the trigger but the pause unpause thingie is a lillte bit to much since you don't need them. i think yur map could be corrupted but if you don't mind post also your other triggers.
 

Togrias

New Member
Reaction score
0
Thanks for the quick replies! Sorry. Here are the triggers in code:

This is one of the triggers I just added.

Code:
Events
Unit - A unit Is attacked
Conditions
Actions
Unit - Pause (Attacking unit)
Unit - Unpause (Attacking unit)
Unit - Add Channel (Attack) to (Attacking unit)
Unit - Order (Attacking unit) to Special Malganis - Soul Preservation (Attacked unit)

This is the sample debug trigger I camp up with to show that all triggers are non-functional.

Code:
Untitled Trigger 003
Events
Time - Elapsed game time is 5.00 seconds
Conditions
Actions
Game - Display to (All players) the text: hi

Previously (when my triggers were functioning) my new triggers did what I intended: The attacks actually get prevented and replaced my a "fake attack" which was actually a copy of the Channel ability.

Now at that point in time the Triggers were doing fine. Then I added the following three triggers (a rather rudimentary GUI-version of, and inspired by Vexorian's CSCache system, at least with a similar desired function and purpose to the extent of my map):

This code is added to all instances in existing triggers where I need to store a value (usually custom value and stuff) on a unit:
Code:
                        For each (Integer A) from 0 to 500, do (Actions)
                            Loop - Actions
                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    If - Conditions
                                        DummyBooleanB Equal to False
                                        CacheIsOccupied[CSHeads] Equal to False
                                    Then - Actions
                                        Set DummyBooleanB = True
                                        Set DummyIntegerB = (Integer A)
                                    Else - Actions
                        Set CacheNumber = DummyIntegerB
                        Set CacheIsOccupied[CacheNumber] = True
                        Set CacheUnit[CacheNumber] = (Last created unit)
                        Set CacheCustomVariable[CacheNumber] = DummyIntegerA                        
                        Unit - Set the custom value of (Last created unit) to CacheNumber

Whenever I need to retrieve a unit's custom value I use the following trigger:
Code:
Set DummyIntegerA = CacheCustomVariable[(Custom value of (Triggered unit))]

When a unit dies its slot is no longer needed so I free it up such that another unit may store its custom value in that slot.
Code:
Unit Dies Free up Occupied
    Events
        Unit - A unit Dies
    Conditions
    Actions
        Set CacheNumber = (Custom value of (Dying unit))
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Dying unit) Equal to CacheUnit[CacheNumber]
                CacheIsOccupied[CacheNumber] Equal to True
            Then - Actions
                Set CacheIsOccupied[CacheNumber] = False
            Else - Actions

Previously the array size of 500 was 2500, but then all of the triggers stopped working. So I messed around thinking I have done something seriously wrong, then I reduced the array size to 500 and it started working again.

Then afterwards I implemented the Cache triggers to previously-existing triggers I have and suddenly all triggers stopped working again.

But as far as I know none of these triggers can affect the whole map. Surely my other triggers are not too relevant in causing this as they were working perfectly fine before. Can my map be corrupted? If so how do I fix it? My map opens up fine in Worldedit though.
 

Togrias

New Member
Reaction score
0
Not a lot. Probably 50+? Mostly Trigger spells, as I take at least 3 separate triggers to do a spell.
 

Togrias

New Member
Reaction score
0
I fixed it (temporarily) by globally halving all array sizes. Does anybody know whether the number of arrays affects the map? Also I'm looking for a more permanent solution.
 

Somatic

You can change this now in User CP.
Reaction score
84
IIRC Blizzard's Array have a maximun size, same for Cache, so maybe have afew Cache and a few arrays to lessen the load of a single array and single Cache
 
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