Sign in to follow this  
doanything

More than 1000 GlobalNumbers

Recommended Posts

Hello, my little green friends!

 

I know, why the project "TSLRCM" is *stuck*.

It is because modders hit the limit of 1000 global number variables that can be stored in Kotor TSL.

 

Some days ago I have mailed them to share with community information of the problem, but I was ignored. So I will now hit harder...

 

I will post the workaround *include* file. It will allow to use few more variables, how much exactly I do not know, but you can always expand the workaround (if you have some weight of scripting, ofc!)

 

So:

 

 

// This is your new globalcat. You shoud *not* add them to globalcat.2da
// Also, there are my predefined vars (wipe them!), i've installed much mods and exceed the 1000's limit, so wrote that lib

//
// I'm unaware how much of them you can put in theory...
// Script limit is 9999, my limit is 9-per-row, but if you wish to try 10+ increase next definition.
// I'm unaware of how long a string cound even be, too... So...
// If you are out of limit of scripted string's length, then script must be modified. Do or inform to do.

//
// Note you should *not* write +0/ again after +9/, just continue with +10/YOUR_AWESOME_VARS+11/AS_MUCH_AS_NEED

//

// You are still had to add K_GLOBALS_1 to globalcat.2da, it should look so way: XXX|K_GLOBALS_1|String
// And for each new one (K_GLOBALS_2 and so on).

//

// FUNCTIONS:

// Exactly what you need! Just use with your vars as usual, but with _N )))
void SetGlobalNumber_N( string sIdentifier, int nValue );

int GetGlobalNumber_N( string sIdentifier );

void IncrementGlobalNumber_N( string sIdentifier, int nAmount );

void DecrementGlobalNumber_N( string sIdentifier, int nAmount );

 

Yeah, I'm russian maniaco head-broken psycho-conspirator so MY SCRIPT IS LICENSED.

But do not be afraid, the license is in russian but it is both permissive and GNU GPL compatible. Just google translate contents of ЛИЦЕНЗИЯ.txt if you want to check it.

global_n_inc.nss

ЛИЦЕНЗИЯ.txt

fog_dialogs.zip

Share this post


Link to post
Share on other sites

Well, I didn't know we were stuck.

Or could only have 1000 global variables. I'm looking at M4-78EP and see 1130... and it works just fine.

 

Nor did I get any mail... :/

 

So; I'm not sure what's the issue here. It might be the russian "translation"? But for english versions, there's really nothing at all wrong.

Share this post


Link to post
Share on other sites

It is important to pay attention to what i said.

1)  It is limit of global NUMBER variables, though BOOLEANS, LOCATION and STRINGS still could be set and stored.

2) It is no limit for globalcat.2da howewer. Limit is when the game engine makes saved game. Then only (maximum) 1000 bytes of data stored into the NUMBER GLOBALS STACK.

 

Check it on, install TSLRCM+M4-78EP+Nar Shadda Hidden Complex (order is relevant!). It will not work properly, even in light version, but recompile it's scripts with my hack - and everything' fine.

Also, my install is TSLRCM+M4-78EP+NS_HC+Handmaiden_For_Females. Then, on the last mentioned, you will see a limit's effect far earlier.

 

You'll say "bug in the mod". It is unright. Launch K-GFF, open SWKOTOR2/Saves/XXXXXX - GameX/GLOBALVARS.res Navigate to the bottom. Click on ValNumber [Type: BINARY]. See on the right. There are "Bytes: 1000". Even of you have 9000 number globals in globalcat.2da

 

Values of global numbers are -128 to +127 (as referenced from nwscript.nss), (or 0 to 255). One byte. So there are nothing strange if it cant be more that 1000 global numbers (bytes) in 1000 byte data.

 

About TSLRCM... yes, i could be mistaken when said "it is not finished". But it is my wish for it to be developed further..)

Well, I didn't know we were stuck.
Or could only have 1000 global variables. I'm looking at M4-78EP and see 1130... and it works just fine.

Nor did I get any mail... :/

So; I'm not sure what's the issue here. It might be the russian "translation"? But for english versions, there's really nothing at all wrong.

Share this post


Link to post
Share on other sites

Says Bytes: 2400 to me... :?

EDIT: Meh, that was locations. 963 bytes for numerics so far...

 

But TSLRCM + M4-78EP + Handmaiden is still onyl 963 numeric globals.

Share this post


Link to post
Share on other sites

Says Bytes: 2400 to me... :?

EDIT: Meh, that was locations. 963 bytes for numerics so far...

 

But TSLRCM + M4-78EP + Handmaiden is still onyl 963 numeric globals.

+Nas Shaddaa Hidden Complex. BTW!

 

P.S. Renamed topic... Im just a naive animeist but I run into a problem with more than 1000 GlobalNumbers not working, and created a workaround... Maybe it is not so important now, but in future, I'm sure, will be used widely

Share this post


Link to post
Share on other sites

um nar shadda hidden complex is incompatible that why it does work!

Share this post


Link to post
Share on other sites

Well, I filled my globalcat.2da will bogus numerics and you're right, it does stop at 1000.

 

However, considering we aren't going over 1000, but it happens with other mods it doesn't look if the provided solution would be much use here, only to the other mods using a lot of globals pushing it over the 1000.

Share this post


Link to post
Share on other sites

There aren't too much new mods, maybe it is because lack of workarounds.

Well, I filled my globalcat.2da will bogus numerics and you're right, it does stop at 1000.

However, considering we aren't going over 1000, but it happens with other mods it doesn't look if the provided solution would be much use here, only to the other mods using a lot of globals pushing it over the 1000.

 

/um nar shadda hidden complex is incompatible that why it does work!/

/It's listed as incompatible with TSLRCM to start with./

So I have predicted precisely what you'd say) Hope they will use my script to become compatible. My local version have patched scripts already, and I'm testing it now. I'll post any further advancements. Maybe, someone interested in patched nss's, but they are easy to DIY (just add #include "global_n_inc" and "_N" to each call of SetGlobalNumber/GetGlobalNumber functions).

Share this post


Link to post
Share on other sites

Yeah, it wont be too hard to implement with a few global numerics.

But with the amount of content TSLRP works with, sometimes around the entire game, modifying globals to work differently can take a lot of work. Personally, not really willing or required to transfer all those over to another system.

 

For Handmaiden 4 females I probably just change it to a boolean instead, problem solved.

 

There is a lot more with the Hidden Complex than just numerics hitting the cap that makes it incompatible with TSLRCM. It was already deemed so before M4-78EP, which would make it fall way under the 1000. If it's to be compatible, a lot more needs to be done than converting the globals, other files will also need to be updated to reflect 1.8.2 rather than vanilla TSL.

 

Lastly, I doubt it. More to do with being a 8(?) year old game now. I'm pretty sure most didn't know about this, I certainly didn't. And considering this is the first I hear about it in those 8 or so years I suspect most others don't either...

Share this post


Link to post
Share on other sites

/Personally, not really willing or required to transfer all those over to another system./

Existing variables had their "live" in the state they are already done. No need of transferring them but if one want some mod to transfer vars for being compatible.

 

 

/For Handmaiden 4 females I probably just change it to a boolean instead, problem solved./

I thought about that. But it requires to modify dialog, not only nss's. And in case of workaround wrapper, mod is modified withoud touching dialogs, that are not being currently done compatible with TSLPatcher.

 

/Lastly, I doubt it. More to do with being a 8(?) year old game now/

Yeah, agreed. So, thank you for the conversation! At least, I just spent my time and trained my brains writing the workaround and (new for me) putting 8-bit integers into 6-bit-encoded strings. I'm certain, we'll speak if some people decide to mod the game further or write an open-source and binary-compatibla clone of the engine... Maybe we'll speak if I will be one of so people (but I'm sadly lazy)

 

Tho things put me actually to play TSL and TSLRCM again after about 4 years of last playing. First, my computer died and I work now at low-clock netbook. Second, I read news about TSLRCM said that game was restored to the state it is initially designed.

Share this post


Link to post
Share on other sites

It will definitely be something in mind for new mods, as TSLRCM and M4-78EP together get rather close to that 1000.

 

As for Handmaiden for females, I have to go over the scripts and dialog to make it M4-78EP/Coruscant Jedi Temple compatible anyway, might aswell use that to make the necessary modification.

Share this post


Link to post
Share on other sites

It will definitely be something in mind for new mods, as TSLRCM and M4-78EP together get rather close to that 1000.

 

As for Handmaiden for females, I have to go over the scripts and dialog to make it M4-78EP/Coruscant Jedi Temple compatible anyway, might aswell use that to make the necessary modification.

I haven't played Coruscant Jedi Temple yet, but are there some issues with Handmaiden for females and M4-78EP?

 

It will definitely be something in mind for new mods

If that will be useful, then I'll probably make some new versions of my workaround, easier to use, well-tested for any restrictions and (if there any) bug-fixed.

Share this post


Link to post
Share on other sites

Yeah, both M4-78EP, Jedi Temple and Handmaiden 4 Females modify the galaxy map travel script.

Shouldn't be that hard to fix though, just have to make some time to do it :D.

Share this post


Link to post
Share on other sites

Now I see... Maybe, should make the galaxy map travel script modular, one part for traveling, one for defining planets, one for mechanics and logics. Then it will be useful for modders whom adds new planets without such a pain with compatibility.

Yeah, both M4-78EP, Jedi Temple and Handmaiden 4 Females modify the galaxy map travel script.
Shouldn't be that hard to fix though, just have to make some time to do it :D.

Share this post


Link to post
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.

Sign in to follow this