cool3a2
Aug 21, 2009, 05:47 AM
I'd like to continue the problem of this thread: http://forums.civfanatics.com/showthread.php?t=329479. (http://forums.civfanatics.com/showthread.php?t=329479) I would have prefered to continue the other thread itself, but didn't figured out how to rename it and as is the title misses the point somehow.
So I still don't want to give this up. At the moment I see two solutions for this problem, but plain xml won't be enough, I think...
a) GeoModder told me how to place a building into the citycenter, simply by adding this line:
<Attribute Class="Scalar">szSpecialLayout:CityCenter</Attribute>
This would even give the building the best place, but the default houses don't move and therefore overlap with my building. An idea would be to do some python work to force the other buildings to move. Well, if there would be an xml solution I've missed, I'd prefer that. So let me know if you have an idea. I have no idea what to do in python to move the other houses, so this is kind of vague.
b) Secondly, there are two other lines, similar to the one above, that brought me to an other idea:
<Attribute Class="Scalar">szSpecialLayout:Coast</Attribute>
and
<Attribute Class="Scalar">szSpecialLayout:Water</Attribute>
If I get this right, then szSpecialLayout is a python function. Correct me if I am wrong... And Coast and Water are arguments to it. So it seems that, in general, a building can be forced to only occur on certain types of squares. The naive way, typing
<Attribute Class="Scalar">szSpecialLayout:Plain</Attribute>
doesn't work :sad: But I think it should be possible to define an argument for the mentioned function, that stands for squares without hills, peaks, ocean, coast and rivers (maybe by even reusing the Water argument). If there is no legal square around, then the building just doesn't show up. Or, as a second version, the building gets positioned in the citycenter (which would be prefered anyways), where it seems to be okay to have it on a hill. Coast and ocean are impossible there anyways. The only thing that should be excluded, are rivers as it may look strange if there is a river just under the building.
I guess b) is possible somehow. The problem is, that I've never done python work so far (but I am a bit experienced with c++ at least), so I have no clue where to start. There are tutorials about python, but all seem to be far away from my specific problem. Furthermore, there seems to be quite a lot of python files, but I can't find the one with szSpecialLayout, so it would be nice if someone could help me a little by at least bring me on the right way. I am open for alternative ideas also, so feel free to share your thoughts.
BTW: As mentioned,
<Attribute Class="Scalar">fCurvatureBias:68</Attribute>
did not have the desired effect. Maybe I set up the new leaf incorrectly. GeoModder told me, that this requires a lot of definitions in a lot of files, so doing it the way it is mentioned in the other thread, may have been to simple. Some hints would be of help.
So I still don't want to give this up. At the moment I see two solutions for this problem, but plain xml won't be enough, I think...
a) GeoModder told me how to place a building into the citycenter, simply by adding this line:
<Attribute Class="Scalar">szSpecialLayout:CityCenter</Attribute>
This would even give the building the best place, but the default houses don't move and therefore overlap with my building. An idea would be to do some python work to force the other buildings to move. Well, if there would be an xml solution I've missed, I'd prefer that. So let me know if you have an idea. I have no idea what to do in python to move the other houses, so this is kind of vague.
b) Secondly, there are two other lines, similar to the one above, that brought me to an other idea:
<Attribute Class="Scalar">szSpecialLayout:Coast</Attribute>
and
<Attribute Class="Scalar">szSpecialLayout:Water</Attribute>
If I get this right, then szSpecialLayout is a python function. Correct me if I am wrong... And Coast and Water are arguments to it. So it seems that, in general, a building can be forced to only occur on certain types of squares. The naive way, typing
<Attribute Class="Scalar">szSpecialLayout:Plain</Attribute>
doesn't work :sad: But I think it should be possible to define an argument for the mentioned function, that stands for squares without hills, peaks, ocean, coast and rivers (maybe by even reusing the Water argument). If there is no legal square around, then the building just doesn't show up. Or, as a second version, the building gets positioned in the citycenter (which would be prefered anyways), where it seems to be okay to have it on a hill. Coast and ocean are impossible there anyways. The only thing that should be excluded, are rivers as it may look strange if there is a river just under the building.
I guess b) is possible somehow. The problem is, that I've never done python work so far (but I am a bit experienced with c++ at least), so I have no clue where to start. There are tutorials about python, but all seem to be far away from my specific problem. Furthermore, there seems to be quite a lot of python files, but I can't find the one with szSpecialLayout, so it would be nice if someone could help me a little by at least bring me on the right way. I am open for alternative ideas also, so feel free to share your thoughts.
BTW: As mentioned,
<Attribute Class="Scalar">fCurvatureBias:68</Attribute>
did not have the desired effect. Maybe I set up the new leaf incorrectly. GeoModder told me, that this requires a lot of definitions in a lot of files, so doing it the way it is mentioned in the other thread, may have been to simple. Some hints would be of help.