Staredit Network

Staredit Network -> UMS Assistance -> Problem Loading a Valid CHK File
Report, edit, etc...Posted by Staredit.Net Essence on 2005-01-13 at 18:44:15
Hey, there. I'm doing my best to keep up with the utilities already in existence for Starcraft but very few if any tools seem to exist for tedious operations. For example, in the map I am creating, I intend for a player to have to bring one of sixteen different things to any of nine beacons on the map. The contents of each trigger are considerable (four conditions, five actions), each player gets a different result (thus meaning each player needs his or her own trigger for each case), there are nine possible locations and sixteen possible requirements. Therefore, for this portion of the map alone, I need 9x16x8 = 1152 triggers. As I don't want to put those in by hand, I sought a different way.

I looked up the CHK file format and wrote a program to generate the necessary triggers. This program then takes a valid CHK (the base map with no triggers), generates a TRIG section, and replaces the CHK's existing TRIG section with the generated one. It also replaces the STR (strings) section, as many of the triggers have text or at least comments.

I was testing the result as I went along. I got as far as the first player, all nine locations for six of the sixteen requirements. After I add the seventh set for the first player, StarEdit X-Tra, StarForge, and the original editor cease to be able to load the CHK file. I'm quite confused, as I'm absolutely certain I've kept to the file format spec.

Only one thing strikes me as a potential problem. The generated triggers section is absolutely massive, accounting for more than a megabyte of the 1.3 Mb file. Is there some kind of size limit that I'm not aware of? According to the spec, the TRIG section can be up to 2 Gb in size.

The spec I'm using, by the way, is the one on the Campaign Creations site (here) as it is the only one I can find.

Can anyone provide any insight or a potential fix? I'd appreciate help on this one. The eventual goal of the map is to function much like the well inspired but poorly designed God's Land maps on Battle.Net, but the deity influencing the game is a trigger-driven computer instead of a human (to encourage fairness wink.gif ). Unfortunately, Starcraft's trigger system is far short of a Turing-complete language; I have to copy a trigger and use a switch just to get an OR out of the blasted thing.

Is what I'm trying to do impossible? Does anyone know the limits of this file format or of the Starcraft map's trigger section in general?

Thanks again for reading and for any help you might provide. I appreciate the time.

Cheers!
Report, edit, etc...Posted by greenreaper on 2005-01-13 at 20:59:38
Well, I'm pretty sure you're NOT hitting the SC Trigger limit. You could think about making less triggers, or just making a system of random events....
Report, edit, etc...Posted by Urmom(U) on 2005-01-13 at 21:11:14
i think the problem is the string limit. it depends on whether or not your triggers are commented though because the string limit is 1024 and you have over 1024 triggers(many with comments probably), locations, and other things that add to the limit.
Report, edit, etc...Posted by Staredit.Net Essence on 2005-01-13 at 22:59:52
QUOTE(urmom @ Jan 13 2005, 10:11 PM)
i think the problem is the string limit.  it depends on whether or not your triggers are commented though because the string limit is 1024 and you have over 1024 triggers(many with comments probably), locations, and other things that add to the limit.
[right][snapback]124880[/snapback][/right]


I see your point. However, examining the contents of the STR section, the strings and the vector table only consume 17,990 bytes; the STR section has 65,536 bytes of addressable space including the vector table. Each trigger actually has only one comment.

Something does occur to me as I type this. It is illegal to have two comments point to the same string? Until now, the editor has shown no problem with this. Many triggers are similar enough that, in context of the player for which they are occurring, I can use the same description. Therefore, for each nine triggers, there is only one comment string. I specifically constructed the triggers to all reference that same string and, once again, the editor had no problem with this. Could this be related? If necessary, I could just dump all the comments.

EDIT: I'm currently using about 380 of the 1,024 available strings.
Report, edit, etc...Posted by chuiu on 2005-01-14 at 01:29:51
tvnr, you might want to take the easier route and write a program that does it in the GUEdit style. If you have ever used GUEdit, it allows you to export and import plain text triggers in maps. So for example, if you had a trigger that said something like:

Player 1
Conditions:
Current Player brings at least 1 men to 'here'.

Actions:
Remove 1 men for Current Player at 'here'.
Preserve trigger.

It would more or less look the same in the txt file. I'm positive this would be a much faster and much easier solution to your problem. There is only one drawback. Sometimes GUEdit ends up screwing up the map as well. It obviously exports and imports the triggers the same way you are, but it has it already coded down to something like 30% failure rate.
Report, edit, etc...Posted by Heimdal on 2005-01-14 at 12:07:21
I'd suggest following Chu's advice. If you'd like, you can post the map and I can see if I can find a problem with it. If all else fails, there's probably a way to accomplish what you're doing with fewer triggers.
Report, edit, etc...Posted by Staredit.Net Essence on 2005-01-14 at 12:34:09
I'd upload the file, but the forum won't let me post .chk files. I'll look into the GUEdit thing. Thanks. smile.gif
Report, edit, etc...Posted by chuiu on 2005-01-14 at 12:51:05
I'm sure most the advanced map makers here can remove a chk file from a scm/scx. I don't, however, think most map makers here can help you with the exact problem you are having.

Also, I seriously doubt it is illegal to have one string point to multiple places. Matter of fact, I believe using Starforge allows you to use strings multiple times.
Report, edit, etc...Posted by Robi on 2005-01-14 at 13:04:00
Or maybe try the new SCMDraft triggers plugin, it got all the triggers of the map in one editbox....
Next Page (1)