This project is read-only.

Customizable Mods

Feb 10, 2008 at 4:46 PM
I am thinking about adding a new feature to SMM that would make mods configurable. A mod would contain a script defining a UI and some actions to tweak it after it is installed. For example, a "dark nights" mod could allow adjustment of how dark nights should be.

Requirements for the script are the following:

▪ it should be easy to learn and use
▪ it should be possible to predict which files and lines the script may affect

My current idea is to have the script as a text file consisting of two parts. The first part would assign a name and a type to each setting. The second part would define a set of line deletions, replacements, and insertions using these settings and regular expressions. Replacements would be within lines. Something like this:

[settings]
fog : fraction
flares : text
[actions]
change weather_default.ltx 38 : .* -> fog_density = %fog%
change weather_default.ltx 29 : .* -> flares = %flares%
change weather_default.ltx 54 : .* -> flares = %flares%

This would then add a "Settings" option to the mod in SMM, which would display a dialog with fields "fog" and "flares".

Comments? Ideas?
Feb 10, 2008 at 6:29 PM
Nice idea, but maybe would be better then if the objective is to make another application that allow users to make their own MODs. I have seen many MODs, and sometimes some lines appears or disappears depending on the modder, or simply change place. Have you been thinking about that?

Maybe I"m wrong or I dont understood too much your point (soo sorry), but this can be the harder point of your new Idea.

Have a nice day.
Feb 11, 2008 at 10:59 AM
You should also add the option of a little explanation of the variable is displayed to be changed (provided by the modder).
Maybe:
[settings]
fog : fraction : "text with description 1"
flares : text : "text with description 2"

Regarding to regular expresions, users might not need to define a substitution. Maybe, line (un)commenting is also needed.

[actions]
*comment* weather_default.ltx 39

Feb 11, 2008 at 12:18 PM
Edited Feb 11, 2008 at 12:22 PM
With regular expressions, line commenting would look like this:

change weather_default.ltx 39 .* -> //\0

Not sure that regular expressions satisfy the condition of being easy to learn and use, though.
Feb 11, 2008 at 1:06 PM
Edited Feb 11, 2008 at 1:09 PM
Dade, the idea is to make it simple to make mods be configurable after having been installed.
The ZRP mod has a Modifier tool that is very similar in concept.
For another example, AMK has its own installer with options for tuning the mod. My idea is like that, except that it allows the mod to be tuned at any time.
Feb 13, 2008 at 7:46 PM
Edited Feb 13, 2008 at 7:50 PM
I don't know how you are planning to implement this, but I think that the first word in the second block, "change", can be either deleted or used as a command to establish what kind of action is going to be done. I think it could simplify the regular expresions issue.
You could implement 2 options with this command: either the simplified way, with easier and simpler regular expressions, or the complex way, the pure regular expressions, with anything allowed.
Feb 13, 2008 at 8:08 PM
Edited Feb 13, 2008 at 8:11 PM
In addition to change there would be add and delete. It is just that it is more difficult to come up with examples for those.

I thought about regular expressions since, and realized that they are not needed at all. If you know which line you are replacing, then it is no trouble to replace the whole line.

change weather_default.ltx 38
fog_density = %fogDensity%
From the user's perspective, all of this could look like this:
http://img175.imageshack.us/img175/6334/settingsplan1sr9.png
Feb 21, 2008 at 5:29 PM
I do agree. This is the easiest way...
May 22, 2009 at 10:15 PM

I finally implemented this idea: http://modscript.codeplex.com/. Better late than never, right? :)