How do mod options work? - Page 2

How do mod options work?

Discuss the source code and development of Spring Engine in general from a technical point of view. Patches go here too.

Moderator: Moderators

User avatar
Pxtl
Posts: 6112
Joined: 23 Oct 2004, 01:43

Re: How do mod options work?

Post by Pxtl »

Now, whoever was the genius who implemented this, I thank you. It's a really cool feature, and I'm making good use of it. That being said: FOCKKKK YOUUU, THE HORSE YOU RODE IN ON, AND YOUR LOWER-CASE-CONVERTING WAYS.

(note: mod option names are all converted into lower case. This is not obvious to the mod developer)

edit: I actually now have no idea if the above is true or not, the was caused by a completely different mismatch of auto-recasing and case-sensitivity. My bad.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: How do mod options work?

Post by Argh »

Everything is converted to lower-case internally, IIRC.
User avatar
lurker
Posts: 3842
Joined: 08 Jan 2007, 06:13

Re: How do mod options work?

Post by lurker »

Some aspects are, like tdf and fbi tags (but not their contents), and file names, but generally no.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: How do mod options work?

Post by Argh »

Ok, so the strings referring to, say, CanAttack == canattack, but the string values aren't. Makes sense. Except... when referring to Unit names, you've gotta use lowercase, at least in Lua...
User avatar
lurker
Posts: 3842
Joined: 08 Jan 2007, 06:13

Re: How do mod options work?

Post by lurker »

The unit filenames are converted to lowercase...
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: How do mod options work?

Post by AF »

In tdf files all the tagnames and categories are all lower case, if not theyre converted to lowercase.

I think this is what is confusing argh. No such case conversion is applied to variables in lua files, and as lurker said, unitnames are lowercase.
User avatar
Pxtl
Posts: 6112
Joined: 23 Oct 2004, 01:43

Re: How do mod options work?

Post by Pxtl »

The thing that threw me off unexpectedly (which I have no idea if it was the cause of the problems I was facing) was that this logic apparently also applies to the modoptions names. So my orignalOTABuildLists modoption became originalotabuildlists. This is surprising because modoptions are never converted into TDF files.
User avatar
Peet
Malcontent
Posts: 4384
Joined: 27 Feb 2006, 22:04

Re: How do mod options work?

Post by Peet »

They're loaded through script.txt which is read by the tdf parser.
User avatar
lurker
Posts: 3842
Joined: 08 Jan 2007, 06:13

Re: How do mod options work?

Post by lurker »

Well, luadefs do have lowercase conversion performed on them (unless you feel like commenting out that line)
Post Reply

Return to “Engine”