Create a map script: guide and issues

2.2)Run your script.
A lua console window will pop up and disappear when the script finishes. This is a real pain since the error message that will inevitably happen will vanish as soon as it is shown. Sometimes the window will close before the error traceback is even printed. Maybe the output of this console is logged somewhere, but I couldn't locate where.
In response to this, I spent a couple of minutes looking at the code for WorldBuilder. I found the line of code where it hides the window, and deleted it. I've attached an edited version of WorldBuilder where the lua debug window stays open. I hope it helps.

Edit: This version also has a new maximum world size of 256x127, for everyone whining about not being able to make gigantic maps. Good luck trying to play a game on that size map, though.

Edit: Now in its own thread
 
After you fix the Lua language service (look in the Utilities forum), ModBuddy has everything you need. Telling people to use other tools is just likely to create confusion.
I don't get it. If you're talking about the Better lua editor, it does not fix the main issue with ModBuddy, which is that, if you create and Build your script, then the script does not show in the WorldBuilder. It does show if you've already created the script and installed the mod, but does not work for the first time you create the mod, so it's rather useless.
I keep thinking that ModBuddy is a loss of time as far as map scripts are concerned, and only useful for packaging, but even then a zip file is better because you'll have to manually move your map script out of the mod directory if you want to be able to launch a game with it without losing 2 clicks to go to the mods section, or to play MP with it.
 
I don't get it. If you're talking about the Better lua editor, it does not fix the main issue with ModBuddy, which is that, if you create and Build your script, then the script does not show in the WorldBuilder. It does show if you've already created the script and installed the mod, but does not work for the first time you create the mod, so it's rather useless.
I think I must be misunderstanding something here. WorldBuilder looks at the same files Civ5 itself does, so if you haven't installed a mod into Civ5, how is WorldBuilder supposed to know about it?
 
It's pretty simple in fact:
You're creating your mod for the first time. Create in ModBuddy, build it. The Build generates files in a directory where Civ can use them, but Civ, nor the WorldBuilder, won't use them until you install the mod. Which is not finished. So you have to run the game and activate the mod.
With this solution, you need ModBuddy, WorldBuilder and Civ to all run once before you can see the result of your script. And then, you won't be able to use the script without clicking mods/accept and won't be able to play it in MP.
The alternative I prefer is to use a text editor (whatever you like, gvim, notepad++, emacs, nedit, even ModBuddy) and save the file in the Maps directory. You can then use WorldBuilder directly without having to go through Civ to activate the mod, and you won't have to go through mods/accept to use it, and you can use it in MP. The only downside is you can't distribute it through the mod browser, but since the mod browser doesn't put the file where it belongs (in Maps folder), I'm not sure that the mod browser is actually useful except in terms of advertising the mod for those who don't know the forums.
 
I see. I can't say I've used WB much, but I guess if I used it constantly, that would be a PITA.
 
It's pretty simple in fact:
You're creating your mod for the first time. Create in ModBuddy, build it. The Build generates files in a directory where Civ can use them, but Civ, nor the WorldBuilder, won't use them until you install the mod. Which is not finished. So you have to run the game and activate the mod.
With this solution, you need ModBuddy, WorldBuilder and Civ to all run once before you can see the result of your script. And then, you won't be able to use the script without clicking mods/accept and won't be able to play it in MP.
The alternative I prefer is to use a text editor (whatever you like, gvim, notepad++, emacs, nedit, even ModBuddy) and save the file in the Maps directory. You can then use WorldBuilder directly without having to go through Civ to activate the mod, and you won't have to go through mods/accept to use it, and you can use it in MP. The only downside is you can't distribute it through the mod browser, but since the mod browser doesn't put the file where it belongs (in Maps folder), I'm not sure that the mod browser is actually useful except in terms of advertising the mod for those who don't know the forums.
I assume that Firaxis's intention is that only official map scripts are available in the normal single player or multiplayer. Multiplayer with mods is supposed to be coming, so it's not that the intention is to keep them out of multiplayer. But generally, the intention seems to be that you need to be in Mod mode to play with any user-supplied material. Which is understandable, though I'm not sure I agree with it personally. A few extra clicks really isn't that much of a burden, and if the mod interface is good then requiring a distinct game mode for mods versus vanilla makes a kind of sense.
 
I assume that Firaxis's intention is that only official map scripts are available in the normal single player or multiplayer. Multiplayer with mods is supposed to be coming, so it's not that the intention is to keep them out of multiplayer. But generally, the intention seems to be that you need to be in Mod mode to play with any user-supplied material. Which is understandable, though I'm not sure I agree with it personally. A few extra clicks really isn't that much of a burden, and if the mod interface is good then requiring a distinct game mode for mods versus vanilla makes a kind of sense.

A few extra clicks each time you load a game is a real pain to me. YMMV. I started looking at the code to get rid of these intermediary panels but didn't want to spend much time on it.

Anyway, I think the following is worth mentioning:
Bob Thomas aka Sirian said:
Be warned, there is NO automatic handling of resource balance and appearance for
new or modified resource types. Gone is the Civ4 method of XML-based terrain
permissions. Gone is plug-and-play with new resource types. If you remove any
types from the list, you will need to disable the hard-coded handling of those
types present in the resource distribution. If you modify or add types, you will
not see them in the game until you add them to the hard-coded distribution.
Map scripting becomes mandatory if one wants to add resources to the game! Thanks Jon Shafer. It's going to be a real real pain for all modders. I do think the game is much less modder-friendly than Civ IV.
 
A few extra clicks each time you load a game is a real pain to me. YMMV. I started looking at the code to get rid of these intermediary panels but didn't want to spend much time on it.

Anyway, I think the following is worth mentioning:

Map scripting becomes mandatory if one wants to add resources to the game! Thanks Jon Shafer. It's going to be a real real pain for all modders. I do think the game is much less modder-friendly than Civ IV.
Not quite mandatory... for any map script that actually uses AssignStartingLocations, then all a resource-adding mod has to do is fix that file. Of course, that's non modular, but I'm working on an infrastructure modcomp that makes it modular.
 
Updated first post to precise that player placement cannot be tested in the WorldBuilder.
Incidentally, it means that WB cannot be used at all if the number of players has any impact on your script beyond placement of players (this was the case of my tectonics script for Civ IV for instance).
I very strongly recommend the use of XiDragon's Reveal map button mod, which allows seeing the whole map in-game by clicking a button.
 
Top Bottom