Quick Modding Questions Thread

Look here: DoC plugs into the onBeginGameTurn event trigger for this (regular BtS might do that with CvEventManager.py). The linked Python module makes a call to a different module that actually spawns the units. In this case that is the checkTurn method in AIWars.py, which calls the checkConquest methods for the specific stages of the spawned invasions.

I am always hesitant to point people to my mod for examples on how to mod stuff in BtS, because RFC is already heavily modified and modularized, so emulating it might not work because you're missing the required utility methods, or needlessly complicated because your own use case is much simpler. So take everything you see with a grain of salt. It's useful to understand how everything is connected, not so much for outright copying code.
I'm sorry but I can't find anything in those files that let me declare war through python.

I really need this feature for my Middle East mod to simulate historical invasions and I need a civ to auto declare war on a specific date.
 
Oh my science, thank you! Thank you! Thank you!
Uh, that mod doesn't work, even in its unmodified state, we'll have to find another one, sigh. :sad:
And it messes up the python folder (no Dawn of Man, etcetera).
 
Also, how do I prevent a religion from autospawning in my scenario?
I have created a required tech to found it, but it still spawns randomly at around turn 5 or 6.
 
Oh my science, thank you! Thank you! Thank you!
Uh, that mod doesn't work, even in its unmodified state, we'll have to find another one, sigh. :sad:
And it messes up the python folder (no Dawn of Man, etcetera).

Working as intended. Read instructions.
 
Uh, I read the instructions. I put it in the mod directory and tried running a game with England and France, nothing happened.
And it messes up the python folder, as in no Dawn of Man and possibly other sidd effects.
 
1) It works in its unmodified status.
If it doesn't work in your mod, it is not unmodified status. It is a result of failed merging.

2) The instructions clearly mentioned there is a need to change the python filepath.

3) When doing python changes, activate exceptions.....
 
I'm sorry but I can't find anything in those files that let me declare war through python.

I really need this feature for my Middle East mod to simulate historical invasions and I need a civ to auto declare war on a specific date.
You were asking how to trigger events based on date. There's plenty of examples in there. Including declarations of war by the way.

You actually have to put in a minimal amount of effort. This feels like you're waiting for someone to give you the right snippet of code so "you" can code it by copying it.
 
1) It works in its unmodified status.
If it doesn't work in your mod, it is not unmodified status. It is a result of failed merging.

2) The instructions clearly mentioned there is a need to change the python filepath.

3) When doing python changes, activate exceptions.....
This is the problem (unmodified mod, just cut and paste into mod directory).
attachment.php
 

Attachments

  • Civ4ScreenShot0011.JPG
    Civ4ScreenShot0011.JPG
    97.6 KB · Views: 147
  • Anakin.zip
    Anakin.zip
    498.3 KB · Views: 31
Read the error message... Then look above and see the 3 steps I wrote...
The answer is already there.
 
The name "Ngāpuhi" shows up as a city called "Ng?puhi" ingame. The code I used for ā is &#257. Can the game simply not handle this, or am I doing something wrong? Diaereses seem to be handled just fine.
 
The game doesn't use unicode, but raTHER CodePage 1252, aka windows 1252. To make matters worse, there is a bug preventing line 8_ and 9_ to display correctly in signs and city billboards.

You need to html escape the second half of the characters (8_ and everything below it). To write ã, you need to use the number 227, which you do by typing "& # 227" (without spaces).

RoM had modded encoding support and sort of supports unicode.
 
Read the error message... Then look above and see the 3 steps I wrote...
The answer is already there.
Am I missing something? I can clearly see the "WarNPeace.xml file in that directory, yet it claims it's missing.
 
Ultra short summary of the unicode+RoM feature.
Thread: http://forums.civfanatics.com/showthread.php?t=527371

A Russian translator showed up for M:C and I worked on adding support for a translation. It didn't work as planned, but I gained lots of insights into how the text engine works. I shared this info with dbkblk, who then copied most of my wip code into RoM (like reading utf-8 encoded xml files). He then figured out that the Japanese exe has support for 2 byte encoding (the western one is hardcoded to one) and that UCS-2 encoding is "as much unicode as you can get in two bytes". Don't ask me how he managed to get the Japanese exe file, but it seems he did that somehow and can now support 65536 different characters ingame (including control characters).

I never managed to get it working on colonization, mainly due to lack of the Japanese exe. Also it became a low priority task when I lost the translator. I'm still interested in the Japanese exe file if anybody can provide it.
 
I think there is a file path at the lines mentioned in those three exceptions, you need to change it to point to the right place.
It's the unmodified mod, yet it does not work.
The line in python "Mods/WarNPeaceScript/Assets/XML/CustomXML/WarNPeace.xml" is the correct one, or should be. The WarNPeace file is exactly in that location, yet I get that error.
It should already point at the right place, considering it's not my mod.

And repost: Also, how do I prevent a religion from autospawning in my scenario?
I have created a required tech to found it, but it still spawns randomly at around turn 5 or 6.
 
Ultra short summary of the unicode+RoM feature.
Thread: http://forums.civfanatics.com/showthread.php?t=527371

A Russian translator showed up for M:C and I worked on adding support for a translation. It didn't work as planned, but I gained lots of insights into how the text engine works. I shared this info with dbkblk, who then copied most of my wip code into RoM (like reading utf-8 encoded xml files). He then figured out that the Japanese exe has support for 2 byte encoding (the western one is hardcoded to one) and that UCS-2 encoding is "as much unicode as you can get in two bytes". Don't ask me how he managed to get the Japanese exe file, but it seems he did that somehow and can now support 65536 different characters ingame (including control characters).

I never managed to get it working on colonization, mainly due to lack of the Japanese exe. Also it became a low priority task when I lost the translator. I'm still interested in the Japanese exe file if anybody can provide it.
Reading into it right now, thanks for the information.
 
It's the unmodified mod, yet it does not work.
The line in python "Mods/WarNPeaceScript/Assets/XML/CustomXML/WarNPeace.xml" is the correct one, or should be. The WarNPeace file is exactly in that location, yet I get that error.
It should already point at the right place, considering it's not my mod.

And repost: Also, how do I prevent a religion from autospawning in my scenario?
I have created a required tech to found it, but it still spawns randomly at around turn 5 or 6.

That golden shiny theme is not unmodded BTS. Most likely it is not loading the CustomXML folder which is why the file cannot be located.
 
Back
Top Bottom