xStringBuild format string 64 character limit

Post » Tue Feb 16, 2016 11:15 am

I'm noticing that anything longer than 64 characters in the xStringBuild format string gets truncated, for example:



setx string to xStringBuild "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"


gets truncated to string value of "abcd...ABCD...abcd...ijkl" that's exactly 64 characters.



I'm guessing it's the same limitation as for xMessageFix that has been reported previously. It's not a big deal to work around by concatenating multiple xstringbuilds together, but it would be nice to update the morrowind modding wiki entry for future reference, if indeed it is a consistent issue. Has anyone else run into this limitation?

User avatar
Veronica Martinez
 
Posts: 3498
Joined: Tue Jun 20, 2006 9:43 am

Post » Tue Feb 16, 2016 8:43 am

It shouldn't be a problem if you're combining multiple strings, so long as each individual one is less than 64 characters.


e.g.



begin mwse_Test

long len
long str

setx str to xStringBuild "1234567890"; 10 chars
setx str to xStringBuild "%s%s" str str; 20 chars
setx str to xStringBuild "%s%s" str str; 40 chars
setx str to xStringBuild "%s%s" str str; 80 chars
setx len to xStringLength str

xLogMessage "len: %d" len
xLogMessage "str: %s" str

StopScript mwse_Test

end


MWSE 0.9.5-alpha.20151016 loaded
DLL:Starting Script Extender
Possible duplicate opcode 0x3a00
Possible duplicate opcode 0x3a01
len: 80
str: 12345678901234567890123456789012345678901234567890123456789012345678901234567890
MWSE Terminated

Edit: Oh, misread the original post. You already knew this. :whistling:


User avatar
Stryke Force
 
Posts: 3393
Joined: Fri Oct 05, 2007 6:20 am


Return to III - Morrowind