Quick Modding Questions Thread

2.- I created two new specialists. [...] I believe this is an UI matter (python?), maybe the upper panel (resources) is getting above the 7th+ specialists and prevents the hovering? Can someone confirm me this is tha case?
Can't definitively confirm, but I recall having had this problem with a panel blocking the mouse after I enlarged the specialist buttons and moved them up. I guess it must've been the the transparent bottom end of the bonus resource panel. Perhaps the ones named "BonusPane0/1/2" and/or "BonusBack0/1/2" in Python\Screens\CvMainInterface.py. That file, in any case (if something is blocking the way).
 
Can't definitively confirm, but I recall having had this problem with a panel blocking the mouse after I enlarged the specialist buttons and moved them up. I guess it must've been the the transparent bottom end of the bonus resource panel. Perhaps the ones named "BonusPane0/1/2" and/or "BonusBack0/1/2" in Python\Screens\CvMainInterface.py. That file, in any case (if something is blocking the way).
I had similar issues with specialists. I had to toy around in said python file to arrange them in a way I liked
I don't know about the order issue though. My guess is you are using modular xml files. In that case, the modular stuff always comes only after the "normal" stuff.
1.- I have seen that forested tiles remove trees to open space for improvements. I made a new improvement, but whenever a place it on a forest, the trees don't disappear to open up space. As a result, it is difficult to spot the improvement. Why is this happening and where should I look to correct this?
This should be an xml thing. Try comparing improvement entries.
<FeatureMakesValid> will leave the feature under the improvement.
Edit: I knew I was missing something...
Forget the above and read what @Mr Smith said below.
 
Last edited:
I have seen that forested tiles remove trees to open space for improvements. I made a new improvement, but whenever a place it on a forest, the trees don't disappear to open up space.
You need <bRemove>1 for FeatureStructs in CIV4BuildInfos.xml, check other entries.
How can I replicate this? Where should I look?
It's ArtDefineTag for either improvement or bonus, you can reuse an existing one or add your own in XML/Art.
 
Last edited:
Hello, I have done some experiments and I was left more confused. Notice that I don't mean to remove the forest feature itself, but only some individual trees to make space for the improvement to be easily spotted.

First I tried doing what you told me, but I found some discrepancies:
The limbermill has forest as <FeatureMakesValid>, as mentioned above, but the trees are not removed when placed (not the forest, some individual trees).
My Improvement also has forest as <FeatureMakesValid>, but it gets lost under the treetops. This is very bad for gameplay. My improvement is not supose to remove th forest feature itself.
Quarries don't have forest as <FeatureMakesValid>, and yet, the trees are removed when placed.

So, then, I hipotetized that the trees are only removed when the improvement adds eyecandies to the "floor" of the tile:
Quarries add some eyecandy to the "floor" itself when built over a Stone resourse. Here is the quarry model without any eyecandy (according to Civilopedia). As you can see, there is extra eyecandy that comes from somewhere else. When you build a quarry over a forest (World Builder), the tile removes some trees, but the forest remains.
Farms add some ayecandy to the "floor" too. Here is the farm without eyecandy. When you build a farm, some trees are removed too, but the forest remains (WB).
Lumbermills do not add eyecandy. When you build a lumbermill, the trees remain, covering it under the treetops.

But I was proven wrong because forest preserves do not add eyecandy to the soil, and yet, the trees are removed when it is placed. Here is the Forest Preserve model from the civilopedia, as you can see the little fence is part of the model itself, not extra eyecandy. Before. Trees being removed. Placed.

The "Worked Tile" improvement, also removes some trees. Not worked. Worked. Adding to my confusion.

Look at this: pastures, get lost under the treetops too.

The bRemove just removes the forest, but I need to keep the forest, just remove some trees to make the improvement visible.

I haven't been able to determine what governs the removal of individual trees. I couldn't find any relation between eyecandy, model, FeatureMakesValid or being supposed to be built on forests with the removal of trees when placed.

Any clue?
 
I haven't been able to determine what governs the removal of individual trees. I couldn't find any relation between eyecandy, model, FeatureMakesValid or being supposed to be built on forests with the removal of trees when placed.
Many/most/all mods have improvements with the behavior you desire, you could pick one where it works the way you want it and copy stuff from there. BTW I think it's LSystem that governs that behavior but I can't double check now.
 
Yes, a lot of the specific graphical details and interactions with features and improvements are defined in XML/Buildings/CIV4PlotLSystem.xml.

However, I don't think the specific quarry behaviour that integrates with e.g. a stone or marble resource is defined there. My impression is that you also need to do something in the improvement art files to make this work. But I also only poorly understand how these work. Your best bet is looking at another mod that does something similar to what you want and using that for reference.
 
Hello all,
.
I have successfully added a couple new religions to my mod, along with the proper icons for them on the city screen and well as the religion adviser screen [as well as the tech tree, etc.]. Thank you to all who have provided guidance to get me to that point, previously.
.
For the actual units for the added religions, I have temporarily hijacked existed missionaries and the monastery and simply copied them and added their new names [while still being stuck with the art for the original missionary and monastery]. For example - I have a new religion called Hellenism and I'm simply copied the Taoist missionary and monastery and renamed them Hellenic missionary and Hellenic monastery. So, when both Taoism and Hellenism have been founded, I have duplicates of the Taoist missionary and monastery, one representing each religion. If I have found a unit from another mod to represent the Hellenic missionary and monastery; exactly what art files so I need to replace to have the new art appear for the new unit and building? Anyone who could provide some help on this direction, I would very much appreciate it.
 
Hello all,
.
I have successfully added a couple new religions to my mod, along with the proper icons for them on the city screen and well as the religion adviser screen [as well as the tech tree, etc.]. Thank you to all who have provided guidance to get me to that point, previously.
.
For the actual units for the added religions, I have temporarily hijacked existed missionaries and the monastery and simply copied them and added their new names [while still being stuck with the art for the original missionary and monastery]. For example - I have a new religion called Hellenism and I'm simply copied the Taoist missionary and monastery and renamed them Hellenic missionary and Hellenic monastery. So, when both Taoism and Hellenism have been founded, I have duplicates of the Taoist missionary and monastery, one representing each religion. If I have found a unit from another mod to represent the Hellenic missionary and monastery; exactly what art files so I need to replace to have the new art appear for the new unit and building? Anyone who could provide some help on this direction, I would very much appreciate it.
You can start here:
:)
 
Can you confirm whether or not wonder movies for Natural Wonders work in any mod? I can't get them to work in any mod.
I already have tried a lot of things but nothing gets it to work. Other movies work but not the Natural Wonders.
Any hints? :confused:
 
*National Wonders?
 
*National Wonders?
:nope:
Nope. Platyping wrote a modcomp I am merging into my mod:

But the wonder movies for the Natural Wonders are not working after merge. What even stranger is that they neither work in Platypings original modcomp nor in C2C, nor in History Rewritten.
I already tested other wonders and their movies show in game, so it's not the 'No Movies' setting.
 
Last edited:
I played a bit of History Rewritten recently and the natural wonder movies worked for me.
 
I played a bit of History Rewritten recently and the natural wonder movies worked for me.
That's weird... Just tested before posting...
Can there be some other options responsible?
 
The No Movies option would have been my first suspect but you already checked that, so no idea. Maybe there is something in the init file?
 
The No Movies option would have been my first suspect but you already checked that, so no idea. Maybe there is something in the init file?
I also tried clearing that but no difference.
What I have figured out so far is this:
I have an autobuild xml tag in CoM taken from C2C. When a building meets its requirements it is automatically built without any cost. Using that method the same happens. So if a building is built normally, the wonder movie is playing. If a building is built either by platyping's python code or the dll/xml code from C2C, than there is no wonder movie displayed.
 
Perhaps the C2C DLL made some changes / added additional conditions for movies to be played which clashes with Platyping's natural wonder implementation?

I am not familiar with either component but maybe it would be a good start to figure out how the natural wonder movie is triggered and then try to find it in the DLL again to see if there are some changes around it. IIRC to trigger a movie from Python you have to launch a popup with "showMovie" or similar in the message body.
 
I'm 99% sure that the problem is somewhere else, because it doesn't work for me in platy's original modcomp either:

Could anyone download it and confirm whether Natural Wonders movies work for them or not?
I have set up and attached a save game for testing.
 

Attachments

Hello all,
.
I am attempting to add a function to have religions spawn at random on the map in any city for any civ once a particular technology is founded. I have added new code [screenshot 1 and 2 attached], but I get right to the end of it and then get a python error [log attached]. I have also attached screenshots showing what happens at game start [tech screen shows, then no HUD after bypassing it]. Any thoughts or advice as to what is occurring?
 

Attachments

  • Civ4ScreenShot0000.JPG
    Civ4ScreenShot0000.JPG
    201.6 KB · Views: 3
  • Civ4ScreenShot0001.JPG
    Civ4ScreenShot0001.JPG
    99.4 KB · Views: 4
  • Code1.jpg
    Code1.jpg
    179.3 KB · Views: 7
  • Code2.jpg
    Code2.jpg
    137 KB · Views: 5
  • PythonErr.txt
    PythonErr.txt
    29.3 KB · Views: 3
One closing parenthesis too many in that for line (line 706). I figured that an AI chat bot should've been able to tell, but when I just tried it, it did not spot the problem. ("Upon reviewing the code snippet you provided, I should have noticed the extra closing parenthesis.") While I was at it, I asked whether the items method is in Python 2.4. Supposedly yes, already since version 2.2. So with the parenthesis removed, that line at least should be fine.
 
Back
Top Bottom