Maximum length of an INI file value?

Discussions about Coding and Scripting
Post Reply
User avatar
Barbie
Godlike
Posts: 2792
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

Maximum length of an INI file value?

Post 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?
"Multiple exclamation marks," he went on, shaking his head, "are a sure sign of a diseased mind." --Terry Pratchett
User avatar
EvilGrins
Godlike
Posts: 9668
Joined: Thu Jun 30, 2011 8:12 pm
Personal rank: God of Fudge
Location: Palo Alto, CA
Contact:

Re: Maximum length of an INI file value?

Post 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.
http://unreal-games.livejournal.com/
Image
medor wrote:Replace Skaarj with EvilGrins :mrgreen:
Smilies · viewtopic.php?f=8&t=13758
sn260591
Average
Posts: 75
Joined: Sat Jun 01, 2013 10:38 am

Re: Maximum length of an INI file value?

Post by sn260591 »

1023 characters is max.
User avatar
sektor2111
Godlike
Posts: 6403
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: Maximum length of an INI file value?

Post 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.
User avatar
Chamberly
Godlike
Posts: 1963
Joined: Sat Sep 17, 2011 4:32 pm
Personal rank: Dame. Vandora
Location: TN, USA
Contact:

Re: Maximum length of an INI file value?

Post by Chamberly »

I think Wildcard's Gauntlet games use so many + Mapvote ini so it seem pretty wild that it went over the limit.
Image
Image
Image Edit: Why does my sig not work anymore?
sn260591
Average
Posts: 75
Joined: Sat Jun 01, 2013 10:38 am

Re: Maximum length of an INI file value?

Post by sn260591 »

sektor2111, I mean one variable in ini.
User avatar
sektor2111
Godlike
Posts: 6403
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: Maximum length of an INI file value?

Post by sektor2111 »

sn260591 wrote:sektor2111, I mean one variable.
Aha... I have confused problem.
sn260591
Average
Posts: 75
Joined: Sat Jun 01, 2013 10:38 am

Re: Maximum length of an INI file value?

Post 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 "$".
User avatar
sektor2111
Godlike
Posts: 6403
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: Maximum length of an INI file value?

Post 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.
User avatar
Barbie
Godlike
Posts: 2792
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

Re: Maximum length of an INI file value?

Post 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>
"Multiple exclamation marks," he went on, shaking his head, "are a sure sign of a diseased mind." --Terry Pratchett
User avatar
sektor2111
Godlike
Posts: 6403
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: Maximum length of an INI file value?

Post 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.
Post Reply