Jump to content

What is the exact size limit for scripts?


ApexMods

Recommended Posts

Searched the forums and FAQs to no avail, so here it goes.

I'm somewhat astonished at the seemingly arbitrary size limit for GR mission/gametype scripts (.gtf). I thought I had it pinned down a while back and made a note of it, but recently encountered the dreaded file corruption resulting from passing the size limit at different byte lengths.

Had a look at just the size of the <scriptCompiled> and <scriptSource> parts to correct for different briefing and objective text length, but it still doesn't seem to make sense.

Sometimes a script would work up to a size of over 120,000 bytes (data size, not size on disk), sometimes it would start failing around just 114,000 bytes. Played around with different variable labels etc. but to no avail.

If anyone has an insight into the exact limitations at play here, please share. Thanks.

Link to comment
Share on other sites

Not sure of the exact limit, seems to vary. But in general, my scripts have had this issue over 200kb in size.

What you can do is edit the mission in notepad and remove some zones that are not needed for now and also the sound effects. Can add them back in once all is done.

Link to comment
Share on other sites

Yep, that's one of the largest out there. I think I'm getting close to figuring this out. Looks like the raw source data needs to be less than 65,536 bytes (64K) for the script to compile successfully. Sadly the only way to measure this is AFTER you save the script.

Harntrox came pretty close, with 64,596 bytes source data in his SP/COOP HX Mission. For the script I'm currently working on I'm way above 64K source data and have to jump through all sorts of hoops to get the size down.

Going nuts over here... :wacko:

Link to comment
Share on other sites

Yep you seem to be right with this. I picked 1 of my missions that was 212kb in size, removed all zones, plans, actors, all placed stuff, etc, until it was 110kb. Added more scripting only, it has same issue around 119kb.

I believe you can script it to unlimited size from what I have tested, however, you cannot save or close Igor until you are finished.

Link to comment
Share on other sites

Yes, you can script in IGOR to unlimited size, and you can save the script - but it will not load again in IGOR and it will crash GR upon launch, once the script source data - the one that goes between the <scriptSource> tags in GTF and MIS files - is over 64K (65,536 bytes).

You can measure the current size of the script source by having your text editor count the number of characters between those tags. Everything up to 65,536 is fine, one character/byte more and the script will end up corrupted - unplayable and uneditable.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...