I hit the char limit.

Post » Wed Feb 24, 2010 5:35 pm

Today I have made my longest script ever. I also found out that the GECK has a maximum of 720 lines. And that's really annoying. I suppose I'll have to splitt this.

What was your longest script ever?
User avatar
CArlos BArrera
 
Posts: 3470
Joined: Wed Nov 21, 2007 3:26 am

Post » Wed Feb 24, 2010 2:34 pm

Never mind my previous point, 550 lines is the max. It just won't even enter more then 720 lines. Looks like I'll need to splitt this in four pieces.
User avatar
Adrian Morales
 
Posts: 3474
Joined: Fri Aug 10, 2007 3:19 am

Post » Wed Feb 24, 2010 3:03 pm

Actually I believe it is more of a character limit, I believe around roughly 32 thousand characters and you have reached the limit.
My longest script(s) is in my work in progress Experience Control mod, the FOSE version. I have had to split the script off into about a 100 different quests.

Edit: It would have been so much simpler just to have used a terminal for my menu, but I am in too far to change it now. :embarrass:
User avatar
Sophie Payne
 
Posts: 3377
Joined: Thu Dec 07, 2006 6:49 am

Post » Wed Feb 24, 2010 4:23 pm

What happened at the limit? I mean did the script fail to compile or were you just not permitted to add more characters? I am building a rather large script at the moment, and I would rather not have to face this issue as I get farther into it.
User avatar
Lil'.KiiDD
 
Posts: 3566
Joined: Mon Nov 26, 2007 11:41 am

Post » Thu Feb 25, 2010 12:21 am

What happened at the limit? I mean did the script fail to compile or were you just not permitted to add more characters? I am building a rather large script at the moment, and I would rather not have to face this issue as I get farther into it.

It just stops you from adding any characters once you reach the limit, at least that is what it did for me. So I believe you will be able to know when you have reached the limit.
User avatar
stephanie eastwood
 
Posts: 3526
Joined: Thu Jun 08, 2006 1:25 pm

Post » Wed Feb 24, 2010 7:39 pm

What happened at the limit? I mean did the script fail to compile or were you just not permitted to add more characters? I am building a rather large script at the moment, and I would rather not have to face this issue as I get farther into it.


You could copy and paste your script into something like Notepad++. It tells you your character count at the bottom.
User avatar
Jack Moves
 
Posts: 3367
Joined: Wed Jun 27, 2007 7:51 am

Post » Thu Feb 25, 2010 12:41 am

What happened at the limit? I mean did the script fail to compile or were you just not permitted to add more characters? I am building a rather large script at the moment, and I would rather not have to face this issue as I get farther into it.


It won't compile after 550 lines, and it just won't add more chracters after 720 lines.
User avatar
Arrogant SId
 
Posts: 3366
Joined: Sat May 19, 2007 11:39 am

Post » Wed Feb 24, 2010 8:09 pm

If you wanna post it, I might be able to optimize/whittle it down so it all fits. I managed to reduce EndingBinksScript to 46% of its original size just by consolidating all of the conditions.

Original: 8200 characters
ScriptName EndingBinksScript; This script is triggered at the end of the game, and controls which series of ending binks gets playedshort EndKarma;EndKarma: 1=High Karma 1, 2=High Karma 2, 3=High Karma 3, 4=Low Karma 1, 5=Low Karma 2, 6=Low Karma 3, 7=Neutra lKarmashort EndDeath;EndDeath: 1=Player Dies Good, 2=Player Lives, 3=Player Dies Evilshort EndEden;EndEden: 1=Player Didn't Side With Eden 1, 2=Player Didn't Side With Eden 2, 3=Player Sided With Edenshort KarmaCheck;checks player's Karma and sets the appropriate variableshort PlayIntroBink;checks whether the Intro Bink has been playedshort PlayKarmaBink;checks whether the Karma Bink has been playedshort PlayDeathBink;checks whether the Player Death Bink has been playedshort PlayEdenBink;checks whether the Eden Assist Bink has been playedshort PlayClosingBink;checks whether the Closing Bink has been playedshort PlayMainKarma;Checks whether the main karma bink as been playedBegin GameMode;This block plays the Introduction Bink if PlayIntroBink == 0;	If GetStage MQ11 == 200		;Play Introduction Bink Here		PipBoyRadioOff		ShowMessage EndingBink1		;PlayMusic "Endgame01"		PlayBink "B01.bik" 0 1 0		Set PlayIntroBink to 1;	endifendif;This following section plays the appropriate Karma bink;---------------------------------------------------------------------------If PlayIntroBink == 1	If PlayKarmaBink == 0		If Player.GetAv Karma >= -249			If Player.GetAv Karma <= 249				;Play Neutral Karma Bink Here				;ShowMessage EndingBink8				;PlayMusic "Endgame08"				PlayBink "B08.bik" 0 1 0				set PlayKarmaBink to 1				set PlayMainKarma to 1			endif		endif	endifendif	If PlayIntroBink == 1	If PlayMainKarma == 0		If Player.GetAv Karma > 249			;Play High Karma Bink 1 Here			;ShowMessage EndingBink2			;PlayMusic "Endgame17"			PlayBink "B17.bik" 0 1 0			set PlayMainKarma to 1		endif	endifendif	If PlayMainKarma == 1	If PlayKarmaBink == 0		If Player.GetAv Karma > 249		 	If GetStageDone Ms06 100 == 1				;Play High Karma Bink 1 Here				;ShowMessage EndingBink2				;PlayMusic "Endgame02"				PlayBink "B02.bik" 0 1 0				set PlayKarmaBink to 1		 	endif		endif	endifendif	If PlayMainKarma == 1	If PlayKarmaBink == 0		If Player.GetAv Karma > 249			If Getstage MS17 >= 100				;Play High Karma Bink 2 Here				;ShowMessage EndingBink3				;PlayMusic "Endgame03"				PlayBink "B03.bik" 0 1 0				set PlayKarmaBink to 1			endif		endif	endifendif	If PlayMainKarma == 1	If PlayKarmaBink == 0		If Player.GetAv Karma > 249			;Play High Karma Bink 3 Here			;ShowMessage EndingBink4			;PlayMusic "Endgame04"			PlayBink "B04.bik" 0 1 0			set PlayKarmaBink to 1		endif	endifendif	If PlayIntroBink == 1	If PlayMainKarma == 0		If Player.GetAv Karma < -249			;Play High Karma Bink 1 Here			;ShowMessage EndingBink2			;PlayMusic "Endgame18"			PlayBink "B18.bik" 0 1 0			set PlayMainKarma to 1		endif	endifendif	If PlayMainKarma == 1	If PlayKarmaBink == 0		If Player.GetAv Karma < -249			If MegatonDestroyed == 1				;Play Low Karma Bink 1 Here				;ShowMessage EndingBink5				;PlayMusic "Endgame05"				PlayBink "B05.bik" 0 1 0				set PlayKarmaBink to 1			endif		endif	endifendif	If PlayMainKarma == 1	If PlayKarmaBink == 0		If Player.GetAv Karma < -249			If MS10.InFlames >= 1				;Play Low Karma Bink 2 Here				;ShowMessage EndingBink6				;PlayMusic "Endgame06"				PlayBink "B06.bik" 0 1 0				set PlayKarmaBink to 1			endif		endif	endifendif	If PlayMainKarma == 1	If PlayKarmaBink == 0		If Player.GetAv Karma < -249			;Play Low Karma Bink 3 Here			;ShowMessage EndingBink7			;PlayMusic "Endgame07"			PlayBink "B07.bik" 0 1 0			set PlayKarmaBink to 1		endif	endifendif	;-------------------------------------------------------------;This section plays the Player Died Binks;--------------------------------------------------------------If PlayKarmaBink == 1	If PlayDeathBink == 0		If EndDeath == 1			;Play Player Died (Good) Bink			;ShowMessage EndingBink9			;PlayMusic "Endgame09"			PlayBink "B09.bik" 0 1 0			set PlayDeathBink to 1		endif	endifendif	If PlayKarmaBink == 1	If PlayDeathBink == 0		If EndDeath == 2			;Play Player Lives Bink			;ShowMessage EndingBink10			;PlayMusic "Endgame10"			PlayBink "B10.bik" 0 1 0			set PlayDeathBink to 1		endif	endifendifIf PlayKarmaBink == 1	If PlayDeathBink == 0		If EndDeath == 3			;Play Player Died (Evil) Bink			;ShowMessage EndingBink11			;PlayMusic "Endgame11"			PlayBink "B11.bik" 0 1 0			set PlayDeathBink to 2		endif	endifendif;------------------------------------------------;This section plays the Sided With Eden Binks;-------------------------------------------------------------- If PlayDeathBink == 1	If PlayEdenBink == 0		If EndEden == 3			;Play Player Sided With Eden Bink			;ShowMessage EndingBink14			;PlayMusic "Endgame14"			PlayBink "B14.bik" 0 1 0			set PlayEdenBink to 1		endif	endifendifIf PlayDeathBink == 1	If PlayEdenBink == 0		If EndEden < 3			if MQ09.RRDestroy == 0				;Play Player Didn't Side With Eden 1 Bink				;ShowMessage EndingBink12				;PlayMusic "Endgame12"				PlayBink "B12.bik" 0 1 0				set PlayEdenBink to 1			endif		endif	endifendifIf PlayDeathBink == 1	If PlayEdenBink == 0		If EndEden < 3			if MQ09.RRDestroy == 1				;Play Player Didn't Side With Eden 2 Bink				ShowMessage EndingBink13				;PlayMusic "Endgame13"				PlayBink "B13.bik" 0 1 0				set PlayEdenBink to 1			endif		endif	endifendif;------------------------------------------------------------;This block plays the closing binkIf PlayDeathBink >= 1	If PlayClosingBink == 0		If GetPCIssix Male == 1			;Play Closing Bink			;ShowMessage EndingBink15			;PlayMusic "Endgame15"			PlayBink "B15.bik" 0 1 0			set PlayClosingBink to 1		endif	endifendifIf PlayDeathBink >= 1	If PlayClosingBink == 0		If GetPCIssix Male == 0			;Play Closing Bink			;ShowMessage EndingBink15			;PlayMusic "Endgame16"			PlayBink "B16.bik" 0 1 0			set PlayClosingBink to 1		endif	endifendif;------------------------------------------------------------;This block plays the epilogue binkIf PlayClosingBink == 1	If GetPCIssix Male == 1		If GetPCIsRace AfricanAmerican == 1			PlayBink "B19.bik" 0 1 0			addachievement 13			ExitGame			set PlayClosingBink to 2		endif	endifendifIf PlayClosingBink == 1	If GetPCIssix Female == 1		If GetPCIsRace AfricanAmerican == 1			PlayBink "B20.bik" 0 1 0			addachievement 13			ExitGame			set PlayClosingBink to 2		endif	endifendifIf PlayClosingBink == 1	If GetPCIssix Male == 1		If GetPCIsRace Caucasian == 1			PlayBink "B21.bik" 0 1 0			addachievement 13			ExitGame			set PlayClosingBink to 2		endif	endifendifIf PlayClosingBink == 1	If GetPCIssix Female == 1		If GetPCIsRace Caucasian == 1			PlayBink "B22.bik" 0 1 0			addachievement 13			ExitGame			set PlayClosingBink to 2		endif	endifendifIf PlayClosingBink == 1	If GetPCIssix Male == 1		If GetPCIsRace Asian == 1				PlayBink "B23.bik" 0 1 0			addachievement 13			ExitGame 			set PlayClosingBink to 2		endif	endifendifIf PlayClosingBink == 1	If GetPCIssix Female == 1		If GetPCIsRace Asian == 1			PlayBink "B24.bik" 0 1 0			addachievement 13			ExitGame			set PlayClosingBink to 2		endif	endifendifIf PlayClosingBink == 1	If GetPCIssix Male == 1		If GetPCIsRace Hispanic == 1			PlayBink "B25.bik" 0 1 0			addachievement 13			ExitGame			set PlayClosingBink to 2		endif	endifendifIf PlayClosingBink == 1	If GetPCIssix Female == 1		If GetPCIsRace Hispanic == 1			PlayBink "B26.bik" 0 1 0			addachievement 13			ExitGame			set PlayClosingBink to 2		endif	endifendifEnd 

Consolidated: 3759 characters
scn EndingBinksScriptInt EndKarma ; EndKarma: 1=High Karma 1, 2=High Karma 2, 3=High Karma 3, 4=Low Karma 1, 5=Low Karma 2, 6=Low Karma 3, 7=Neutra lKarmaInt EndDeath ; EndDeath: 1=Player Dies Good, 2=Player Lives, 3=Player Dies EvilInt EndEden ; EndEden: 1=Player Didn't Side With Eden 1, 2=Player Didn't Side With Eden 2, 3=Player Sided With EdenInt KarmaCheck ; checks player's Karma and Sets the appropriate variableInt PlayIntroBink ; checks whether the Intro Bink has been playedInt PlayKarmaBink ; checks whether the Karma Bink has been playedInt PlayDeathBink ; checks whether the Player Death Bink has been playedInt PlayEdenBink ; checks whether the Eden Assist Bink has been playedInt PlayClosingBink ; checks whether the Closing Bink has been playedInt PlayMainKarma ; Checks whether the main karma bink as been playedBegin GameMode	If (PlayClosingBink == 2)		Return	Else		;============= Intro Binks =============		If PlayIntroBink			If (PlayMainKarma == 0)				If (Player.GetAv Karma > 249)					PlayBink "B17.bik" 0 1 0				ElseIf (Player.GetAv Karma < -249)					PlayBink "B18.bik" 0 1 0				Else						If (PlayKarmaBink == 0)						PlayBink "B08.bik" 0 1 0						Set PlayKarmaBink to 1					EndIf				EndIf			EndIf			Set PlayMainKarma to 1		Else			PipBoyRadioOff			ShowMessage EndingBink1			PlayBink "B01.bik" 0 1 0			Set PlayIntroBink to 1		EndIf		;============= Karma Binks =============		If PlayMainKarma			If (PlayKarmaBink == 0)				Set PlayKarmaBink to 1				If (Player.GetAv Karma > 249)					If GetStageDone Ms06 100						PlayBink "B02.bik" 0 1 0					EndIf					If (Getstage MS17 >= 100)						PlayBink "B03.bik" 0 1 0					EndIf					PlayBink "B04.bik" 0 1 0				ElseIf (Player.GetAv Karma < -249)					If MegatonDestroyed						PlayBink "B05.bik" 0 1 0					EndIf					If (MS10.InFlames >= 1)						PlayBink "B06.bik" 0 1 0					EndIf					PlayBink "B07.bik" 0 1 0				EndIf			EndIf		EndIf		;=============  Player Died Binks =============		If PlayKarmaBink			If (PlayDeathBink == 0)				If (EndDeath == 1)					PlayBink "B09.bik" 0 1 0					Set PlayDeathBink to 1				ElseIf (EndDeath == 2)					PlayBink "B10.bik" 0 1 0					Set PlayDeathBink to 1				ElseIf (EndDeath == 3)					PlayBink "B11.bik" 0 1 0					Set PlayDeathBink to 2				EndIf			EndIf		EndIf		;============= Sided With Eden Binks =============		If (PlayDeathBink == 1)			If (PlayEdenBink == 0)				If (EndEden == 3)					PlayBink "B14.bik" 0 1 0					Set PlayEdenBink to 1				ElseIf (EndEden < 3)					Set PlayEdenBink to 1					If MQ09.RRDestroy						ShowMessage EndingBink13						PlayBink "B13.bik" 0 1 0					Else						PlayBink "B12.bik" 0 1 0					EndIf				EndIf			EndIf		EndIf		;============= Closing Bink =============		If (PlayDeathBink >= 1)			If (PlayClosingBink == 0)				Set PlayClosingBink to 1				If GetPCIssix Male					PlayBink "B15.bik" 0 1 0				Else					PlayBink "B16.bik" 0 1 0				EndIf			EndIf		EndIf		;============= Epilogue Bink =============		If PlayClosingBink			;Achievement 13			Set PlayClosingBink to 2			If GetPCIssix Male				If GetPCIsRace AfricanAmerican					PlayBink "B19.bik" 0 1 0				ElseIf GetPCIsRace Hispanic					PlayBink "B25.bik" 0 1 0				ElseIf GetPCIsRace Asian					PlayBink "B23.bik" 0 1 0				Else					PlayBink "B21.bik" 0 1 0				EndIf			Else				If GetPCIsRace AfricanAmerican					PlayBink "B20.bik" 0 1 0				ElseIf GetPCIsRace Hispanic					PlayBink "B26.bik" 0 1 0				ElseIf GetPCIsRace Asian					PlayBink "B24.bik" 0 1 0				Else					PlayBink "B22.bik" 0 1 0				EndIf			EndIf			ExitGame		EndIf	EndIfEnd


http://www.javascriptkit.com/script/script2/charcount.shtml's a handy bookmark for character counting.
User avatar
FLYBOYLEAK
 
Posts: 3440
Joined: Tue Oct 30, 2007 6:41 am

Post » Thu Feb 25, 2010 4:31 am

Today I have made my longest script ever. I also found out that the GECK has a maximum of 720 lines. And that's really annoying. I suppose I'll have to splitt this.


It is not a limitation on the lines, it's a limitation on the number of characters.

What was your longest script ever?


You

Cannot

Imagine.

omg.

My followers' weapon selection script maxed everything and it was at 1300 lines, or 1600, or something nuts.

The new system I am finishing up now has even more code - I did this by using my quest script as a controller hub, and having it call effects down on the followers. Big chunks of the code that used to be in the mega-quest-script has now been offloaded into effect scripts, which are activated on the follower by my script calling down the effect on top of the follower. The quest script gets to a place where it calls an effect down on a follower, and then it exits ("return" script command). You have to end the script processing pretty much when you call the effect because the effect doesn't actually happen instantly.

Thinking about how long this thing is, counting all the effect scripts this thing now calls? *cough*
User avatar
Rachel Cafferty
 
Posts: 3442
Joined: Thu Jun 22, 2006 1:48 am

Post » Thu Feb 25, 2010 6:29 am

Lol this reminds me of something funny/stupid I once tried in oblivion, though I did abandon it at some point. I wanted to detect if the player was currently walking on a road, but I could not come up with an idea on how to do this nicely. So my solution was to write an external program, which parsed the ROAD record from the master file to create a graph, then dividing the game world into 1024x1024 blocks and find those which intersected with the road graph. Finally, a script was generated to find out if the player was currently in one of those blocks, which were about 10k lines of if ... else... . I split it up into several scripts and it did work in the end, however not as accurate as I had hoped.
User avatar
Makenna Nomad
 
Posts: 3391
Joined: Tue Aug 29, 2006 10:05 pm

Post » Wed Feb 24, 2010 3:04 pm

Thanks JustinOther - that was really helpful. :) I'm gonna save that link!

As to script-lengths - the limit is not arbitrary, it actually exists for the very reason that scripts can't get too long. Remember that these scripts run Inside a single frame for the most part at max-speed, and as such if you pop-in 8,000 lines of script-text, the engine Will suffer slow-downs because of it. This could cause other timed events to go-off wrong, and could even cause CTD's if the script delays the engine for long-enough. For 100 reasons, only a few of which we really know yet, it is not a good idea to have huge scripts.

That said, there are alot of ways to break scripts up into a sequence or series of smaller scripts, depending on the context of what your trying to do. For my 4-floor working elevator, I broke up my code by putting one script on a token, and breaking the rest into two scripts on different activators that work together via variables and actions. Its not as Easy as having one giant script, but we have what we have in the engine and as JustinOther says, there are many ways around this problem.

I would take JustinOther up on his offer - he is one of the most knowledge here on this stuff, and his help is quite valuable. He can optimize your script, and we can give you ideas on how to break it up if you can give us some context - perhaps an Order in which things are supposed to occur.

Luck,

Miax
User avatar
Darlene Delk
 
Posts: 3413
Joined: Mon Aug 27, 2007 3:48 am

Post » Thu Feb 25, 2010 5:44 am

If I remember correctly, the OBSE team was able to remove the character length on Oblivion scripts, so that the only limit left is on the length of the compiled script rather than the source. I don't think the FOSE team has done this with the GECK, but I think I remember it being mentioned so it might be done in FOSE v2.

Cipscis
User avatar
Miss K
 
Posts: 3458
Joined: Sat Jan 20, 2007 2:33 pm

Post » Thu Feb 25, 2010 6:09 am

Do comments count in the total number of lines/characters?
User avatar
Sanctum
 
Posts: 3524
Joined: Sun Aug 20, 2006 8:29 am

Post » Thu Feb 25, 2010 6:22 am

Most likely.

Anyways, I appreciate your suggestions people :) I've split my script up. It wasn't that fital to have it all in one script, just easier.
User avatar
Emily Jeffs
 
Posts: 3335
Joined: Thu Nov 02, 2006 10:27 pm

Post » Wed Feb 24, 2010 7:32 pm

Do comments count in the total number of lines/characters?


Yes.

I feel sure that it's not about the lines, its a character limit straight-up.

In my experience, tab counts, linefeed, everything.
User avatar
amhain
 
Posts: 3506
Joined: Sun Jan 07, 2007 12:31 pm


Return to Fallout 3