Jump to content

Break the 128 array elements limit


niston

Recommended Posts

Browsing through the LL_FourPlay.psc source, I just realized that LL_FourPlay F4SE Plugin has functionality to patch the 128 array elements limit. Yep, that's right!

 

In F4SE\Plugins\LL_FourPlay.ini, put this:

[Custom Arrays]
uMaxArraySize=512

Tadaa.. You can now have 512 settlements, instead of just 128. In fact, all your <array>.Add() or <array>.Insert() calls can now add or insert up to 512 elements, instead of only 128. Just like that.

 

And to raise the limit from mod script, you can do something along these lines:

Scriptname LargeArrayPatch:LAP extends ObjectReference

Import LL_FourPlay

Int Property ArraySizeLimit = 512 Auto Const

Event OnInit()
	If (SetMinimalMaxArraySize(ArraySizeLimit))
		Debug.Trace(Self + ": Array size limit patched to (" + ArraySizeLimit + ") elements.")
	EndIf	
EndEvent

That will create the LL_FourPlay.ini, if it doesn't exist already. The SetMinimalMaxArraySize() function will return true and adjust the ini setting if the new limit is larger than then one previously set in the ini. It'll return false otherwise and not update the ini. Be cautious however: You should not use very large numbers as the limit, it might cause unintended consequences, trash your game and burn down your home. I wouldn't really trust anything above 1024.

 

Very much awesome indeed!

Link to comment
Share on other sites

Its a plugin from that other site which can't be linked here.

But if you get AAF, you also get LL_FourPlay included with that.

 

Not sure yet if you can also distribute LLFP with your mods. It's declared a community resource after all. Asking around right now.

 

@Pra you will probably like this:

;	Returns the first index of the position the toFind string starts. You can use this to check if an animation has a tag on it. Is not case sensitive.
Int Function StringFind(string theString, string toFind, int startIndex = 0) native global

;	Returns the selected substring from theString. If no length is set, the entire string past the startIndex number is returned.
string Function StringSubstring(string theString, int startIndex, int len = 0) native global

;	Splits the string into a string array based on the delimiter given in the second parameter. 
;	As this function does ignore whitespace, putting a space as the delimiter will only result in a string being returned without spaces.
string[] Function StringSplit(string theString, string delimiter = ",") native global

;	Opposite of StringSplit.
string Function StringJoin(string[] theStrings, string delimiter = ",") native global

;	Converts an integer of any base to a hexadecimal string representation
string Function IntToHexString(Int num) native global

;	Converts a hexadecimal string to an integer
Int Function HexStringToInt(String theString) native global

And who would refuse some nice array functions:

Form[] Function ResizeFormArray(Form[] theArray, int theSize, Form theFill = NONE) native global

String[] Function ResizeStringArray(String[] theArray, int theSize, String theFill = "") native global

Int[] Function ResizeIntArray(Int[] theArray, int theSize, Int theFill = 0) native global

Float[] Function ResizeFloatArray(Float[] theArray, int theSize, Float theFill = 0.0) native global

Bool[] Function ResizeBoolArray(Bool[] theArray, int theSize, Bool theFill = False) native global

Var[] Function ResizeVarArray2(Var[] theArray, int theSize) native global
Link to comment
Share on other sites

  • 5 months later...

Maybe someone will see this, maybe not, but I found the following ini after I had pasted an entire settlement using the newest version of clipboard:

 

LL_FourPlay

[Custom Arrays]
uMaxArraySize=2000

 

When I Googled the ini entry, it brought me to this forum.

 

I have no idea what this is. I am not a programmer. This ini was created after I pasted a settlement using Clipboard Resurrection. I pasted approximately 5,000 pieces of a recent Sanctuary build. Since pasting the settlement, my game freezes every 2-3 minutes for abut 15 seconds.

 

I am stumped. If I go to a save before the "pasting incident" the game is fine.

Any ideas? At this point it is more curiosity than saving a game as this was a test game for my settlements that I am creating either as blueprints of clipboard files.

 

Thanks.

Link to comment
Share on other sites

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

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