Page 1 of 1

Maximum length of an INI file value?

Posted: Fri Apr 01, 2016 9:56 pm
by Barbie
I'm thinking about a map patching mutator but my problem is how to read an INI file with UScript like in other high level languages (that use the Windows API for it mostly). So I got the idea to put all information into a base64 coded string stored as value of an INI file key. But before I write even one line of code for it I need to know what the maximum string length for an INI file value is that UScript can handle. Does anyone know something about that?

Re: Maximum length of an INI file value?

Posted: Sat Apr 02, 2016 12:27 am
by EvilGrins
Can't speak to Uscript but .ini files can be any length whatsoever, depending on whatever limitations that're set in whatever you use to edit them.

I edit all my .ini files with Windows' Notepad. You could stuff a short novel into there with room to spare.

Re: Maximum length of an INI file value?

Posted: Sat Apr 02, 2016 7:30 am
by sn260591
1023 characters is max.

Re: Maximum length of an INI file value?

Posted: Sat Apr 02, 2016 8:45 am
by sektor2111
sn260591 wrote:1023 characters is max
Huh ? It's about a class or many classes involved ? I'm, asking because right now I'm looking at a file named "MapListTemp.ini" which is 56820 bytes length which means 55,4 kilobytes and space on disk is 64 kilobytes according to disk's cluster rules.

Re: Maximum length of an INI file value?

Posted: Sat Apr 02, 2016 9:37 am
by Chamberly
I think Wildcard's Gauntlet games use so many + Mapvote ini so it seem pretty wild that it went over the limit.

Re: Maximum length of an INI file value?

Posted: Sat Apr 02, 2016 9:49 am
by sn260591
sektor2111, I mean one variable in ini.

Re: Maximum length of an INI file value?

Posted: Sat Apr 02, 2016 9:51 am
by sektor2111
sn260591 wrote:sektor2111, I mean one variable.
Aha... I have confused problem.

Re: Maximum length of an INI file value?

Posted: Sat Apr 02, 2016 9:58 am
by sn260591
However, string in a code have no such restriction. It is possible to take several variables from ini and to combine them by means of the operator "$".

Re: Maximum length of an INI file value?

Posted: Sat Apr 02, 2016 11:58 am
by sektor2111
Perhaps Barbie needs a sort of package with actors, actors being called as Level
Example
MHActors.Arden...
MHActors.MJD...
Then dynamicload MHActors.string(etc..Level...)
spawn it - check if exist if not = Level badly screwed, log issue.
Then actors operates an entire internal list with fixes... and then getting vanished...
I don't see why I need 5000 bytes from an ini if I know exactly what I need to change in Level.

Hint: at a moment when some Level mutator intend to screw BaseMutator with regen timers you can ruin it correctly by moving all regen in outside... into an actor spawned (or two actors) spawning based on day from week or month, server-side so less "mappers" will be able to get over rules by adding trash in maps ruining server stuff and rules.

Re: Maximum length of an INI file value?

Posted: Sat Apr 02, 2016 6:47 pm
by Barbie
Just to clear what I want to know: assuming an INI file like this:

Code: Select all

[Examplechapter]
Examplekey="Examplevalue"
What is the maximum length of Examplevalue that can be read if that INI file is a configuration file for a mutator?
sn260591 wrote:However, string in a code have no such restriction. It is possible to take several variables from ini and to combine them by means of the operator "$".
Not really true for bulk concatenating... see thread Maximum String length.

<EDIT>Joined double post :D</EDIT>
<EDIT2>I've just written a small mutator to answer this and got the result that an INI ASCII value string is truncated to 1023 chars. What bad - I feel limited at every corner with UScript... :sad2: </EDIT2>

Re: Maximum length of an INI file value?

Posted: Sun Apr 03, 2016 11:54 am
by sektor2111
Barbie wrote: <EDIT2>I've just written a small mutator to answer this and got the result that an INI ASCII value string is truncated to 1023 chars. What bad - I feel limited at every corner with UScript... :sad2: </EDIT2>
Happens because as I could figure so far, you are using to follow almost always the hard way. UScript is not extremely limited as much as it is SIMPLE and even Non-Coders are able to write a small mutator in UScript.

You can make a tool for tweaking Levels more simple without all sort of doggy SLOW string things using a Level check and spawn "fixer" doing job based on hard-coded "constants" (as you like and I don't understand well why that way). I think you don't even need an INI for this job. Take a look at BotzMutator, it is using some packages matching Level name and there are coded separate things loaded when they need to enter in action.

Aside, if still UScript is too... amoeba like, feel free to setup some natives in C++ bound by an actor from an U file - see TickFix example, and then you can toy in Level with actors as you like. If not, try to think simple.