A small step for this mod...

Maybe I didn't fully understand that, but shouldn't it be quite simply to add this in NOW? Because now all we have to do is having a small program run a "add bEarth to all buildings" and then manually edit the few buildings that are all in a single folder to be bLunar.
 
So what does this new addon mean? Is it still necessary to check all free buildings for construct conditions?

And how excactly do these new ones work?

If I add:

<PrereqMapTypes>
<MapType>MAP_LUNAR</MapType>
</PrereqMapTypes>

to a building, can it only be build in a city that has lunar terrain?
What happens if a building does not have one of these tags at all? Is it default buildable on earth?
What if you want to have an earth building be buildable on the moon after you build an acology there for example?
 
The commit didn't go through last night so wasn't quite ready for use yet but its in now so I'll answer your questions here.

Is it still necessary to check all free buildings for construct conditions?
Yeah, I still think this is in general a good check but it wouldn't work for cities in the process of being founded based on other free buildings they may be getting. So it's good I think but not for THIS application so much. If we find it problematic I'll probably end up removing it and it wouldn't hurt anything to do so.

The new method is pretty much the basis for everything you'd need to work with I think.

And how excactly do these new ones work?
First of all, the MapTypes tag must be applied to all terrains or this won't have any effect. So that's the first step, defining the terrains we already have as validly representing one or more planetary types. Eventually, the map building systems will also use these to filter for the types they can place depending on the map type being generated.

But as it is, a plot in the game looks to the definition of its terrain to find its map type(s) - it's possible for a terrain to be defined as valid for multiple map types but not advisable for most applications I think. I just kept the door open for it because it didn't seem to be something that would make a large impact not to.

Cities basically inherit the map type of the terrain they are placed on.

Once that step is done:
If I add:

<PrereqMapTypes>
<MapType>MAP_LUNAR</MapType>
</PrereqMapTypes>

to a building, can it only be build in a city that has lunar terrain?
Yes. But you can also add a second line like:
Code:
<PrereqMapTypes>
	<MapType>MAP_LUNAR</MapType>
	<MapType>MAP_INITIAL</MapType>
</PrereqMapTypes>
to make the building valid for both the moon and earth BUT no other types.

What happens if a building does not have one of these tags at all? Is it default buildable on earth?
It is then buildable everywhere. This is how I've been able to introduce this without adding an immediate need to review all existing building XML!

What if you want to have an earth building be buildable on the moon after you build an acology there for example?
Put the arcology as a ConstructCondition. But this cannot be made to be a prereq for one and not for the other unless we add further coding to enable a more complex ConstructCondition where Map Type is a GOM that can be defined there. That would be a little challenging for me but I might be able to if it was absolutely necessary... then figuring out how to build the xml for the construct condition would be an interesting challenge as well.
 
Ah ok, thanks for clearing this up! Very usefull indeed!

I think Toffer had a program for mass editing XML? For a first step I think it could be usefull to give every building an earth tag.

Or we could give only buildings that "get in my way" the earth tag first and add it to those that are appear to be troublesome later.
 
I think Toffer had a program for mass editing XML? For a first step I think it could be usefull to give every building an earth tag.
It's called notepad++. ^^

Seriously though, I think RWN utilized some kind of mass-xml-editing software, I do stuff pretty much manually unless I feel like making an autohotkey script with a very spesific task.

EDIT: Adding that tag for every building can be done in one click in notepad++.
Use "find and replace" and just insert it after a tag that every building already have.
 
Ah ok, thanks for clearing this up! Very usefull indeed!

I think Toffer had a program for mass editing XML? For a first step I think it could be usefull to give every building an earth tag.

Or we could give only buildings that "get in my way" the earth tag first and add it to those that are appear to be troublesome later.

I'd probably do the second but Toffer does make a point... just don't screw that kind of process up or it'd be a nightmare!

I've also done more work to flesh out the uses of the MapTypes tags. I probably should've made even the building one be just MapTypes so as to fit with everything else but whats done is done and I'm not changing it now.

But we were having trouble with some units being able to cross the void right? So we set the void terrain type to the void map type (that's been added now) and assign the initial map type to all current units that can ignore all terrains (flying units and subs generally) and then they cannot travel through. This MAY be able to deny air rebasing that shouldn't take place or airport travel that shouldn't take place as well. But there may still be a bit more work to be done to make that fully functional because airports shouldn't be able to fly units to the moon even if the unit CAN exist on the moon. But for now, this set of tags alone should solve about 90% of our issues here. Will just take some xml effort to get it setup right.

Promotions, too, can be made specific to particular maps. This could be an interesting feature considering buildups and statuses and perhaps some other applications.
 
I'd probably do the second but Toffer does make a point... just don't screw that kind of process up or it'd be a nightmare!

@FM: I do it all the time, here's an example and some usefull tips:

Find:
"</iCost>"

Replace by:
Code:
</iCost>\n\t\t\t<PrereqMapTypes>\n\t\t\t\t<MapType>MAP_INITIAL</MapType>\n\t\t\t\</PrereqMapTypes>


Use search mode "Extended (\n \r \t \0 \x...)"

\n new line
\r carriage return
\t tab character
\0 null character
\xddd special character with code ddd
.* selects the rest of the line.

The example might actually work, but you should consider adding it under a different tag than <iCost>.
I'm sure you'll figure it out.
 
Interesting... I've not discovered how to go about doing multiline replacement edits. Did not know it took some inline coding like that to pull it off. Very interesting indeed.
 
Seriously though, I think RWN utilized some kind of mass-xml-editing software, I do stuff pretty much manually unless I feel like making an autohotkey script with a very spesific task.

Im pretty sure he was using Excel or similar program.
He is just good in this things :)
 
A good to know!

Just to be sure: The first thing I have to do is add:

<MapTypes>
<MapType>MAP_LUNAR</MapType>
</MapTypes>

(or martin or initial)

To the terrains that should determine which map type you are on?
Simply adding this tag to the CivTerrainInfos?
 
A good to know!

Just to be sure: The first thing I have to do is add:

<MapTypes>
<MapType>MAP_LUNAR</MapType>
</MapTypes>

(or martin or initial)

To the terrains that should determine which map type you are on?
Simply adding this tag to the CivTerrainInfos?

Yes. This sets up everything else for application.
 
Ok... it's not the schema. Looks like I need to build out Map Types a bit or at least for now look at the load order. Would've thought just having them in the enums would've been enough. Give me some hours to fix that. Sorry... I made an assumption that bit would work fine.

EDIT: Some further investigation into the dll has revealed that I'm in danger of making a major mistake of confusing a map category with a map type. A map type is apparently the initiated maps in multi-maps. Map Categories have gone undefined but THIS is what we really need in this case. We are going to need a full class for this by the time its all said and done so I'm going to be working on getting that setup. Shouldn't take too long to accomplish this but it's going to mean I'll need to change the naming of the tags a bit. I'll clarify as soon as I can.
 
No problem!
Could you add MAP_SPACE as well?
I think you or DH said that this could stop flying units and subs from traveling space.

And what about that iCultureDistance tag? I suspect it's for realistic culture? If so, if increased to like 10, would culture at all "conquer" space?
 
No problem!
Could you add MAP_SPACE as well?
I think you or DH said that this could stop flying units and subs from traveling space.

And what about that iCultureDistance tag? I suspect it's for realistic culture? If so, if increased to like 10, would culture at all "conquer" space?

It was MAP_VOID for what you're calling space I think. However, that was to be the dividing lines nothing could be in so if you want space tiles on a map that could differ.

However, you'll be given a CIV4MapCategoryInfos.xml file to add Map Category types with and as needed perhaps pick up further tags. I know we'll need text keys for some displays needed for the MapCategoryTypes tags that will be replacing all the current MapTypes tags (and PrereqMapTypes).

To answer your second question, that might be enough... may try even a little higher. 20 is something I'm beyond sure would be completely prohibitive as you're looking for.
 
@Mouse:

The tags are now named <MapCategoryTypes> and are formatted as:
Code:
<MapCategoryTypes>
	<MapCategoryType>MAPCATEGORY_EARTH</MapCategoryType>
</MapCategoryTypes>

There is a Civ4MapCategoryInfos.xml that lists the different MAPCATEGORY_TYPES and it's possible to add tags to this which may make a few things a bit easier to adjust from here.

The same steps as before need to be made, just with the new formatting.

Make sense?
 
Done!
And it should work now; at least there was no error message and if you look at the pedia it says "this is a Earth Plot". Well done! :goodjob:

If I want to apply it to buildings do I have to use

Code:
<PrereqMapTypes>
	<MapType>MAP_LUNAR</MapType>
</PrereqMapTypes>

or

Code:
<MapCategoryTypes>
	<MapCategoryType>MAPCATEGORY_EARTH</MapCategoryType>
</MapCategoryTypes>

?
 
Works like a charm :goodjob:

Most buildings are done, with special thanks to Toffer for the "replace multiple lines" trick! :)

@DH:


You have plenty of buildings in your mod that I have to edit as well; it won't affect anything in a normal game, the only changes are that they won't appear on the moon.
Are you working on something inside your Myth / Story folder or can I quickly edit them?

@TB:


Are you working on units or can I mass edit them as well?
 
Top Bottom