Maximum length of an INI file value?

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

Maximum length of an INI file value?

Post by Barbie » Fri Apr 01, 2016 9:56 pm

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: 6456
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 » Sat Apr 02, 2016 12:27 am

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:
Image Image Image Image

User avatar
sn260591
Average
Posts: 54
Joined: Sat Jun 01, 2013 10:38 am
Location: Russia

Re: Maximum length of an INI file value?

Post by sn260591 » Sat Apr 02, 2016 7:30 am

1023 characters is max.
Sorry for my bad English

User avatar
sektor2111
Godlike
Posts: 4172
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: Maximum length of an INI file value?

Post by sektor2111 » Sat Apr 02, 2016 8:45 am

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: 1782
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 » Sat Apr 02, 2016 9:37 am

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

User avatar
sn260591
Average
Posts: 54
Joined: Sat Jun 01, 2013 10:38 am
Location: Russia

Re: Maximum length of an INI file value?

Post by sn260591 » Sat Apr 02, 2016 9:49 am

sektor2111, I mean one variable in ini.
Sorry for my bad English

User avatar
sektor2111
Godlike
Posts: 4172
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: Maximum length of an INI file value?

Post by sektor2111 » Sat Apr 02, 2016 9:51 am

sn260591 wrote:sektor2111, I mean one variable.
Aha... I have confused problem.

User avatar
sn260591
Average
Posts: 54
Joined: Sat Jun 01, 2013 10:38 am
Location: Russia

Re: Maximum length of an INI file value?

Post by sn260591 » Sat Apr 02, 2016 9:58 am

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 "$".
Sorry for my bad English

User avatar
sektor2111
Godlike
Posts: 4172
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: Maximum length of an INI file value?

Post by sektor2111 » Sat Apr 02, 2016 11:58 am

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: 1727
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

Re: Maximum length of an INI file value?

Post by Barbie » Sat Apr 02, 2016 6:47 pm

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: 4172
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: Maximum length of an INI file value?

Post by sektor2111 » Sun Apr 03, 2016 11:54 am

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