HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Multiboard trigger crashing

06-30-2007, 03:21 PM#1
marshall
I've been having some trouble with multiboards. It seems that when I loop round creating all the elements I want, if I create too many then the entire trigger crashes out and doesn't finish all the remaining actions (including actions not related to the multiboard).

I created a test map that has only the following trigger:
Trigger:
multiboard
Collapse Events
Player - Player 1 (Red) types a chat message containing -multiboard as A substring
Conditions
Collapse Actions
Set LocalInteger = (Integer((Substring((Entered chat string), 13, 14))))
Set LocalInteger2 = (Integer((Substring((Entered chat string), 16, 17))))
Multiboard - Create a multiboard with LocalInteger2 columns and LocalInteger rows, titled multiboard
Set GameMultiboard = (Last created multiboard)
Collapse For each (Integer A) from 1 to LocalInteger2, do (Actions)
Collapse Loop - Actions
Collapse For each (Integer B) from 1 to LocalInteger, do (Actions)
Collapse Loop - Actions
Multiboard - Set the text for GameMultiboard item in column (Integer A), row (Integer B) to 1

Now, the results of entering the message
"-multiboard 16 16"
"-multiboard 16 18"
"-multiboard 18 18"
are shown in the attached screenshots.

Why is this happenning?
I've searched everywhere for tutorials and info about multiboards but none of them mention any limits on the number of elements or any problems like this.

I should also point out that experimenting with different sized multiboards revealed a variable limit on the number of elements that were updated before the trigger crashes.
Attached Images
File type: jpgmultiboard16x16.jpg (104.3 KB)
File type: jpgmultiboard16x18.jpg (115.5 KB)
File type: jpgmultiboard18x18.jpg (123.0 KB)
06-30-2007, 03:31 PM#2
DanL.
Well I know for one thing you have to change to hide or show icons. Its in display part of the multiboard.
Trigger:
Multiboard - Set the display style for Multiboard item in column 0, row 0 to Show text and Hide icons
Column 0,Row 0 Will mean the entire multiboard.
06-30-2007, 03:45 PM#3
marshall
I appreciate the input DanL, but I know that. This is just a quick and dirty example - I'm only interested in the text that isn't being displayed.
I can't use Column 0, Row 0 because in my 'real' trigger, the elements are not all the same. The trigger shown above is just an example to illustrate what appears to me to be a bug in WarCraft 3.

My question is why, in screenshot 3 (18x18), is the text not being added to all the multiboard items, and what can I do to fix/work around the problem?
06-30-2007, 03:57 PM#4
Szythe
Your trigger probably reached the op limit. Either split it into 2 triggers, or convert it to JASS and optimize it some.
06-30-2007, 04:07 PM#5
marshall
op limit?
06-30-2007, 04:12 PM#6
Szythe
operation limit. When wc3 runs a trigger, it has a certain number of actions that it will run before terminating the thread, since it thinks that something is wrong or it is an infinite loop. I'm a little hazy myself about how exactly this works, but some of the other people here can fill in the blanks. Basically, in order to get around the op limit, you have several options.
1) Put waits inside the loop. This is probably the worst solution because the Wait action has a minimum time of .27 sec, which will make your loop take forever.
2) Convert it to JASS and optimize out all of the GUI wrappers and other bullshit GUI uses. If you don't know JASS then this obviously isn't an option.
3) Make a repeating timer with a period of 0.01 run when you type the command, and every time it expires fill in the next enumeration of the "loop"
06-30-2007, 04:15 PM#7
marshall
I did wonder if it might have been something to do with the amount of looping but I decided that couldn't be it - I've got several other complicated functions that loop literally hundreds of times - and they work fine.
If the loop called another trigger to fill in some of the items, would that work around the problem / reset the operation counter?
06-30-2007, 04:23 PM#8
Ammorth
The GUI Multiboard functions are extremely poorly written. So when you use them, a little bit of code, is actually quite a bit.
06-30-2007, 08:29 PM#9
marshall
Thanks guys. I've split my intended trigger into 4 separate triggers and it works perfectly. Plus, the 4 triggers are much easier to understand than one big trigger. Many thanks :)