Jump to content

GECK script character limit?


crazytechnokid

Recommended Posts

I was just writing a script in the GECK (A long one mind you) and when i went to past a chunk of code it cut off near the middle, I tried to type out the rest but i couldn't. the script currently has 1233 lines and idk how many letters, so my question basically is, is there a limit for the length / character limit for a script in Fallout3/the GECK? And is there a way around it because i have FOSE installed? Thank you in advance.
Link to comment
Share on other sites

32,767 characters - that includes spaces and newlines. Reference here.

 

If you're using a decent text editor like Notepad++, character count, line count, and more is shown in the status bar.

 

If you're exceeding that limit, you almost certainly need to optimize something, or compartmentalize (break it up into separate parts) like pkleiss suggested.

 

If you're planning on posting your script for help, PLEASE upload it as a text file attachment - don't post it, even within spoiler tags.

Link to comment
Share on other sites

Alright thank you guys, and i figured out a way to make my script a lot shorter anyways haha, figured out how to last night, and if I was to run into this issue again, with another script, how would I compartmentalize it? Can you get a script to activate another script? I guess you could one script to add a token to the players inventory which then in turn activates the next script and you remove that token at the end, but can you just directly activate a script within a script? Sorry if that makes no sense, and Thanks again.
Link to comment
Share on other sites

When you say "just directly activate a script", you're looking for a method similar to defining and calling your own subroutines. There's no pure way to do that, but there's a number of ways to approximate it within the GECK's framework.

 

One way would be something like what you said, adding a token object that has its own Object Script attached. The method I've grown most accustomed to is using Quest Scripts, and running them with StartQuest, kind of like a function call. You could use Result Scripts within Quest Stages, and use SetStage to execute them. You could have an Effect Script attached to an Actor Effect (magic effect), and make it run by calling CastImmediateOnSelf. You can also use Activate with the RunOnActivateBlockFlag set to 1 to immediately run the OnActivate block of another object. This can be the closest to a function call, as the the next line of the calling script won't run until the new script has completed, but like every one of these methods, there are some peculiarities, pros and cons.

 

Read the wiki, try things out, and ask questions, and you'll get the hang of it.

 

EDIT:

Since you said you had previous programming experience, take a look at the various Blocktypes that are available - I think that will be helpful to you. An important thing to note is that each one is only available in certain types of scripts (Object, Quest, Effect, Result), and some are only valid on certain types of objects.

 

Another related thing to look at are Perk Entry Points. Entry Points are basically like interrupts, so can be very useful for certain things. Unfortunately, there are a very limited number of available, and I think the Activate entry point is the only one that has the option to run additional script.

Link to comment
Share on other sites

  • 11 months later...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...