How to add In-Game Map Options for custom Map Scripts

TylerDurden3

Chieftain
Joined
May 15, 2022
Messages
4
Hello everyone

Finally I was able to get a confirmation email to participate in this great forum!

I have been working on the great Perfect World map script by Rich Marinaccio (Cephalo) for quite a while.

I have added a lot of features that I can tweak in the .LUA source code.
Now I would like to make some of those features tweakable in-game, or at least in the World Builder SDK.
You know, when you start the game, or the World Builder SDK, you get different entry fields and menus, where you can tweak how a map should be generated.
How can I add such menus and entry fields to hook up with the actual variables I am using in the .LUA script?
Any help appreciated!

Sorry if this is a newbie question.

Cheers, Tyler
 
So long since I've done this ...

Take a look at the Skirmish.lua standard map script and the GetMapScriptInfo() function and then the Map.GetCustomOption(x) methods
 
Hey cool! Thanks! :)
I trust I can find the mentioned function and methods in the Civ 5 modding wiki:

But I can't find the mentioned Skrimish.lua standard map script.
Can you please give me a pointer (link)?
:)
 
Something like C:\Program Files (x86)\Steam\steamapps\common\Sid Meier's Civilization V\Assets\Maps\Skirmish.lua
 
Oh! There!!! :)
Awesome! Thanks! Found it!!!

Yep, looks very interesting and informative for what I am looking for!
Thanks a lot!
:)

EDIT:

I found the info on Map.GetCustomOption (Civ5 API) here:
https://modiki.civfanatics.com/index.php?title=Map.GetCustomOption_(Civ5_API)

But I could not find anything on the GetMapScriptInfo() function.
I tried googling it. No results.
I looked in the Wiki and even searched for it, and could not find any info on it (bad search? or is it a custom function in Skirmish.lua???)

Can anyone help me a bit with the GetMapScriptInfo() function?
I can see it in the Skirmish.lua standard map script at the very top, but I don't understand it.
I need a bit more info on it to use it.
 
Last edited:
Ok, it's me again:
I had a look at these functions and found them now.
Actually I found them before, but there's so little info on the functions that I thought that can't be it.

It appears now, after what I've seen, you can not add your own custom inputs for you own variables.
You can only hook up predefined variables, such as dominant_terraintype, rainfall amount and stuff like that.
I looks like you cannot control any of your own script variables from inside the game, but only by editing the script directly with a text editor.

Can someone confirm that?
 
Top Bottom