View Full Version : Start location question
thefinn May 24, 2007, 03:16 AM Hello.
I've posted on this topic in the main modding forum, and was directed here, so here goes:
I'm looking for a way to make a map of Earth (the one from Vanilla Civ IV would do nicely as a starting point) that also includes appropriate starting points for all civs, including those in Warlords. Simply putting them in the World Builder save doesn't do what I want, which is to avoid forcing any particular civ to be part of the game - in other words, I'd like to be able to play a game with, say, 9 random opponents, but have those opponents start out in their proper locations.
I don't know any Python, so please assume as little as possible in any replies (but on the other hand, if someone has a solution, I would of course take a look at some Python tutorials before asking stupid questions).
Sto May 24, 2007, 05:23 AM If i've well understood , you want to create a scenario where the starting location are linked with the civilization .
I think this is not easy to do . One problem is what to do if there is two leader of the same civilization . Another problem will be the balance of the map , if there is only one american civ and all other are asians ,africans or european ... the american civ will have a great advantage .
The proper way is to make a map script i think . But you can also create a MOD that relocate units at the beginning of the game , but that need some work that is not very easy ( like specify again starting location ,erase the old and update AI_FoundValues ) . Or use the 48 civ Dll , place all civ and erase some at the beginning of the game . But in this 2 solutions , you can't choose the other civilizations .
SmartMap have a module to load a scenario and then replace civilizations . Perhaps , if you can extract just what you want with your scenario , you will be able to choose starting location in function of the civilization . But that will be a hard work especially if you've never done any python work .
Do not hesitate to ask questions if you begin to work on this because that will be very difficult especially if you start with SmartMap as a basis as a beginner .
Tcho !
thefinn May 24, 2007, 06:28 AM If i've well understood , you want to create a scenario where the starting location are linked with the civilization .
I think this is not easy to do . One problem is what to do if there is two leader of the same civilization .
I've never seen two instances of the same civ with AI civs to random - have I just missed it, or are you thinking in terms of multiplayer? That's not my concern. I've noticed a flag in (IIRC) a mod's .ini file that specifies single player only - I could set that to avoid bugs if I ever get it made, and post it to the net.
Another problem will be the balance of the map , if there is only one american civ and all other are asians ,africans or european ... the american civ will have a great advantage .
Agreed. I'm not too concerned about that, though. I'm merely looking into making it for my own pleasure, and I kind of like the kind of skewed scenarios where some civs are in vicious competition early, and others only enter the world stage later. Incidentally, being isolated does have disadvantages - you can't trade techs, and you can't get foreign trade routes.
The proper way is to make a map script i think . But you can also create a MOD that relocate units at the beginning of the game , but that need some work that is not very easy ( like specify again starting location ,erase the old and update AI_FoundValues ) . Or use the 48 civ Dll , place all civ and erase some at the beginning of the game . But in this 2 solutions , you can't choose the other civilizations .
SmartMap have a module to load a scenario and then replace civilizations . Perhaps , if you can extract just what you want with your scenario , you will be able to choose starting location in function of the civilization . But that will be a hard work especially if you've never done any python work .
Do not hesitate to ask questions if you begin to work on this because that will be very difficult especially if you start with SmartMap as a basis as a beginner .
Tcho !
If the proper way is to make a map script, I'll try to look into it. I'm thinking that making a script that actually specifies the content of every single plot will be a comparatively simple matter, even if time-consuming (but please correct me if I'm wrong). I'll start looking at the existing map scripts to get a feel for how they're put together. Once I've done that, I'll likely return with more questions, but as far as I can make out without any actual knowledge, there are two things I need to learn to do:
1. Tell the script the exact content of a given plot (and then do that a couple thousand times, once for each plot).
2. Tell the script to always place the Egyptians in Egypt, but only if they're present, and so on for the other civs.
Thanks for your comments.
Sto May 24, 2007, 06:47 AM 1. Tell the script the exact content of a given plot (and then do that a couple thousand times, once for each plot).
2. Tell the script to always place the Egyptians in Egypt, but only if they're present, and so on for the other civs.
Thanks for your comments.
1 _ you should take a look at "CvMapScriptInterface.py" located in "<civ4>\Assets\Python\EntryPoints" folder to see all function called with a map script . The only thing you need is "generateTerrain" , "generatePlotTypes" , "addRivers" , "addFeatures" , "addBonuses" , "addGoodies" if you don't want that they are randomly placed , "assignStartingPlots" . Then you should disable all other function in order to not alter your scenario .
Howewer , i think that parsing your scenario for each of these function is the best way ( you can take example in smartmap for most of these functions i think ) as you can change your scenario without having to change your mapscript .
2 _ this can be done in "assignStartingPlots" , do not hesitate to ask questions when you're on this part . there is some things that are not obvious to do .
Tcho !
thefinn May 24, 2007, 06:58 AM Thanks, I'll look into it. I had a thought just after I posted my previous post, though: is it possible to have a map script reference a worldbuilder save? I already have a world map, after all - I just took the "Earth18civs" file and replaced the player info with CivType=NONE and LeaderType=NONE, and removed the starting locations. If I could reference that somehow, it would save me a lot of drudge-work.
Sto May 24, 2007, 07:06 AM In fact , this is what i propose you ... to parse the scenario in the map script . Not very easy , but Smart map already do that , you have just to extract only what you need or take example of that .
Another way , more simple if this is just for you , is to create a MOD with the 48 civ dll , place all civ and delete some aleatory non-human civ units at the beginning of the game .
thefinn May 25, 2007, 03:12 PM Ok, I've looked a bit around, and it strikes me that parsing the scenario in a map script might be overly complicated. I'm thinking of simply using the "Earth" world builder save, cleaning out the player and team info, and adding a ModPath=<path> to the "BeginGame" section. In that path I'd have a script specifying each civ's starting location.
So, two questions:
Could this work?
and
What sort of module and function would I need to call to set a civ's starting location to a particular set of coordinates?
EDIT: I just noticed the existence of an XML file called <civ4>\Assets\XML\Civilizations\CIV4\CivilizationInfos.x ml, which includes all sorts of basic info on each civ. Could start location be added to this?
Sto May 25, 2007, 03:54 PM EDIT: I just noticed the existence of an XML file called <civ4>\Assets\XML\Civilizations\CIV4\CivilizationInfos.x ml, which includes all sorts of basic info on each civ. Could start location be added to this?
No it can't be added . This is just all basic informations about civs
I think the easiest way is to make this :
- take an earth map , place each civ without specify the leader
- if you play with warlords , you can add more than 18 civs
- create a mod , with the 48 or 24 civ Dll .
- the only files you need to put into the mod are the dll if you play with warlords and "CvEventManager.py"
- edit "CvEventManager.py" and on the function "onGameStart" delete some aleatory non human civ units to reach the number of player you want . I can help you for that if you've never done any python script .
Tcho !
Edit : Do th earth map with each civ placed , then i will do the mod for you it's easy . Specify the number of civ placed on the scenario and the number of civ you want to play (all players including you )
thefinn May 26, 2007, 09:19 AM I decided to follow your suggestion, but I ran into a problem: For some reason, if I don't put a specific leader to each civ (that is, if I replace LEADER_RAMESSES or LEADER_HATSHEPSUT with LEADER_NONE for the Egyptians, and so on), the game randomizes who gets which starting position. This happens even though I've got CivType= and StartingX= , StartingY= lines in the same section.
It seems that removing the reference to a specific leader makes the game choose a random leader from all leaders, regardless of civilization, and then set the civ to match that, regardless of the CivType line. I've noticed that the human player always starts out in Egypt (which is the first start location on the list), so I assume that's what happens.
Is there a way to limit the leader selection for a particular player to a specific list (ie the list of Egyptian leaders, for instance)?
Sto May 26, 2007, 09:39 AM I'm sorry , i can't answer your question , i don't know anything about scenario . I was thinking that not specify the leader will keep the civilization . Howewer , can you post the scenario like this with the civ specified and not the leader , i will try to do something .
Edit: tell me how many player you want to have
thefinn May 26, 2007, 04:05 PM Here you go:
http://forums.civfanatics.com/uploads/116585/Earth24Civs.CivWarlordsSave
I had to change the filetype to get permission to upload it. The proper extension is .CivWarlordsWBSave.
I hope you can make something of it. It's getting frustrating that something so seemingly conceptually simple falls in a sort of dead area between a scenario with fixed data and a script for generating random maps etc.
Edit: Let's go with 12, just to see what it looks like. If it works out, I'll have a look at your python and try to implement an option so I can choose different numbers of civs as the whim takes me. How's that for hubris? :cool:
Sto May 26, 2007, 04:12 PM Ok thanks , i will try to do something . can you tell me where is the original file please ? . I also have to find the 24 civ dll , i don't remember where is the dll . i will not make the map script .. too much work . i will try to relocate civ and do all the stuff that go with it in a MOD . I needed the starting location of all civ to do that , so you've provided them with this file . Can you also tell me with how many player you want to play , i 'm not sure that will be selectable .
Tcho !
Sto May 27, 2007, 12:11 PM I've finished the scenario . Just add all the files to the original earth24 MOD . Select custom scenario and you will be able to select the number of player you want to play , enable some team etc ... all civ start in its own position ( except if there is two player of the same civilization ).
The original scenario (http://forums.civfanatics.com/showthread.php?t=179246)
Tcho !
Edit : i've removed the file attachement . Rhye has already include this changes in the original scenario .
thefinn May 28, 2007, 08:24 AM Thank you very much. It looks like it's working perfectly (though I haven't actually started playing it yet, as I'm in the middle of another game).
This is exactly what I was looking for. Great work :goodjob: !!!
jakeotto Jun 03, 2007, 03:44 PM This is awesome I have wanted this for a long time.
Thank you very much.
I have now modified a standard earthmap and can do the same.
Thanks again!!!!:) :lol:
jakeotto Jun 03, 2007, 03:57 PM Here is the file for a standard earth map which lets you chose your civilization and number of rivals. Civilizations start out at historic locations except for the Celts which I have placed in australia
To use unzip into your civ4folder\warlords\mods\
Run Warlords
"load a mod"
Custom Scenario
Tetsuru Aug 08, 2007, 02:18 PM Has anyone made these BTS-Compatible yet? Would be nice.
|
|