I keep having to break my triggers in half to get them to work. It feels like i keep having to shrink them all smaller and then smaller as the code becomes larger, is there any documentation on this?
There's no documentation on it as far as I know. I will say that the more triggers you have in your map, the longer it takes for the editor to verify and load them. The same is true for any coding really: the greater volume of code you have, the more time it takes for a computer to process that code.
With the SC2 editor in particular, there is a limit to the number of actions you can have in a single trigger. Breaking them up into multiple triggers is one solution. First, though, I recommend reviewing your triggers and finding ways to eliminate unnecessary code. Records, action definitions, functions, and loops are all great tools for reducing trigger bloat, and there are plenty of resources on this site for learning how to use each of those. You could also try and migrate certain triggers to data-only functions, which will further reduce trigger bloat.
I'd have to experiment a bit to find the actual limit, but it's a certain number of lines. I ran into it for long chat command triggers where I had around 20 or so possible chat commands and the functions for each one. I've also hit it for long cinematic sequences. What happens is that the editor simply refuses to save the file. This may have been corrected since HotS came out, though... it's just not a common thing people run into, so I can't say for sure. Copying half of the chat commands to a new trigger corrected the problem for me.
The code segments in questions are usually one-two shot only with 8-14 loop and a long if statement. i did manage to crash a trigger awhile back trying to bubble sort it, that code was much larger. but if theirs no documents there are no documents, for all i know the code just might be buggy, i wanted to ask.
If it is stopping due to the trigger being too big, you should try to reduce the size of it anyway you can. Honestly. in my opinion having one large trigger isn't a good idea. Comment can help, but having 1-3 or so triggers that do different parts for one thing can really make it easier on the eyes and keep your Trigger Editor organized.
Also, there are ways to reduce the size of a trigger. You may be over thinking what needs to be done to pull it off. When I started working on Dark System for Generic Code. I reduced one of the triggers they made before I joined from 25 If Statements to 0, then added a loop. Things like that can really make a significant difference.
Also, lets say you made 1 massive trigger and then going into the Test Document and all it tells you is that there was a Dialog Parameter Error in a trigger that has loads of Dialogs. That would be a huge mess of not knowing exactly what went wrong. By splitting it up into multiple triggers can make it easier to figure out where errors are happening a much easier process.
I keep having to break my triggers in half to get them to work. It feels like i keep having to shrink them all smaller and then smaller as the code becomes larger, is there any documentation on this?
@SoulTaker916: Go
There's no documentation on it as far as I know. I will say that the more triggers you have in your map, the longer it takes for the editor to verify and load them. The same is true for any coding really: the greater volume of code you have, the more time it takes for a computer to process that code.
With the SC2 editor in particular, there is a limit to the number of actions you can have in a single trigger. Breaking them up into multiple triggers is one solution. First, though, I recommend reviewing your triggers and finding ways to eliminate unnecessary code. Records, action definitions, functions, and loops are all great tools for reducing trigger bloat, and there are plenty of resources on this site for learning how to use each of those. You could also try and migrate certain triggers to data-only functions, which will further reduce trigger bloat.
@BasharTeg: Go
I've never heard of an action limit, but then again my triggers are relatively efficient. What is this action limit for a trigger?
Still alive and kicking, just busy.
My guide to the trigger editor (still a work in progress)
@willuwontu: Go
I'd have to experiment a bit to find the actual limit, but it's a certain number of lines. I ran into it for long chat command triggers where I had around 20 or so possible chat commands and the functions for each one. I've also hit it for long cinematic sequences. What happens is that the editor simply refuses to save the file. This may have been corrected since HotS came out, though... it's just not a common thing people run into, so I can't say for sure. Copying half of the chat commands to a new trigger corrected the problem for me.
The code segments in questions are usually one-two shot only with 8-14 loop and a long if statement. i did manage to crash a trigger awhile back trying to bubble sort it, that code was much larger. but if theirs no documents there are no documents, for all i know the code just might be buggy, i wanted to ask.
@SoulTaker916: Go
If it is stopping due to the trigger being too big, you should try to reduce the size of it anyway you can. Honestly. in my opinion having one large trigger isn't a good idea. Comment can help, but having 1-3 or so triggers that do different parts for one thing can really make it easier on the eyes and keep your Trigger Editor organized.
Also, there are ways to reduce the size of a trigger. You may be over thinking what needs to be done to pull it off. When I started working on Dark System for Generic Code. I reduced one of the triggers they made before I joined from 25 If Statements to 0, then added a loop. Things like that can really make a significant difference.
Also, lets say you made 1 massive trigger and then going into the Test Document and all it tells you is that there was a Dialog Parameter Error in a trigger that has loads of Dialogs. That would be a huge mess of not knowing exactly what went wrong. By splitting it up into multiple triggers can make it easier to figure out where errors are happening a much easier process.
@SoulTaker916: Go
Also you don't need multiple triggers, use action definitions, they will help shorten your trigger while helping you know where your stuff is.
Still alive and kicking, just busy.
My guide to the trigger editor (still a work in progress)