View Full Version : Help with errors!


NotSoGood
Aug 24, 2009, 10:32 AM
I was making my and spotted few errors which I cannot solve by myself. That's why I'm asking help from those who know modding better than I do.

1) When a barbarian frigate appears there is a red circle AND the ship. :confused: (first screenshot)

2) There appears tornadoes and mountains on cities after some events. (second and third screenshot)

3) When training a settler or worker you get a popup screen which cogratulates you about training your first archery and melee unit. :eek: (fourth and fifth screenshot)
I have removed both unitcombats but couldn't manage to remove that popup too.



Soif anyone who knows how to fix these please tell me. Even an idea is ok.
Thanks.

The_J
Aug 24, 2009, 05:41 PM
1) Have you checked the unit itself and the artdefines for it?

2) You've sure merged the volcano/tornado events wrong in your files.

3) I guess, the problem is in CvAdvisorUtils.py.

Not sure, but i think, you have to remove this section:

if (not gc.getPlayer(pCity.getOwner()).isFeatAccomplished( FeatTypes.FEAT_UNITCOMBAT_ARCHER)):

if (pUnit.getUnitCombatType() == gc.getInfoTypeForString("UNITCOMBAT_ARCHER")):

gc.getPlayer(pCity.getOwner()).setFeatAccomplished (FeatTypes.FEAT_UNITCOMBAT_ARCHER, True)

if (featPopup(pCity.getOwner()) and (gc.getGame().getStartYear() == gc.getDefineINT("START_YEAR"))):
popupInfo = CyPopupInfo()
popupInfo.setButtonPopupType(ButtonPopupTypes.BUTT ONPOPUP_PYTHON)
popupInfo.setData1(FeatTypes.FEAT_UNITCOMBAT_ARCHE R)
popupInfo.setData2(pCity.getID())
popupInfo.setText(localText.getText("TXT_KEY_FEAT_UNITCOMBAT_ARCHER", (pUnit.getNameKey(), pCity.getNameKey(), )))
popupInfo.setOnClickedPythonCallback("featAccomplishedOnClickedCallback")
popupInfo.setOnFocusPythonCallback("featAccomplishedOnFocusCallback")
popupInfo.addPythonButton(localText.getText("TXT_KEY_FEAT_ACCOMPLISHED_OK", ()), "")
popupInfo.addPythonButton(localText.getText("TXT_KEY_FEAT_ACCOMPLISHED_MORE", ()), "")
popupInfo.addPopup(pCity.getOwner())

The same for melee.

NotSoGood
Aug 25, 2009, 11:01 AM
1) It is the original frigate nothing changed in it...

2) Any idea HOW I have merged it wrong?

3) Thanks it worked.

Thanks for your great help. :goodjob: :bowdown:

The_J
Aug 25, 2009, 06:13 PM
1) Strange. Can you reproduce it?

2) No idea.
Are python exceptions turned on?

NotSoGood
Aug 26, 2009, 09:44 AM
1) Hmm... That's strange. Seems like they are working correctly when I try to repruduce it.

2) What are they?

Somehow the hole mod crashes for some reason. Any ideas how to find the reason?

phungus420
Aug 26, 2009, 10:24 AM
Random crashes are almost always caused by a missing art defines entry. You can try running a debug dll to get the game to tell you what specific string is missing. Here are two debug gamecores I've compiled already, one for regular old BtS, and the other for mods using RevDCM:

50civ 3.19 debug dll (http://www.filefront.com/14170947/3.19-50Civ-Debug.zip/)
RevolutionDCM debug dll (http://www.filefront.com/14170937/RevDCM-debug.zip/)

Remember to run Civ in windowed mode when using a debug dll (you can set this up in the main BtS ini file, where you turn on python exceptions and such, something else you should turn on while developing a mod). If you've made SDK modifications, you will need to compile your own debug dll with your changes.

If the debug dll doesn't catch anything, it's likely a bad button. Ie you either have a leading comma for a button not using an atlas, or forgot the leading comma for a button that does use an atlas. No good way to track this down unfortunately.

NotSoGood
Aug 26, 2009, 10:40 AM
About that barbarian ship and the crash could they be the same error? I found this message from logs at the bottom of the xml file.
[5275.734] info type EFFECT_ENEMY_GLOW_UNIT not found, Current XML file is: xml\GameInfo/CIV4EspionageMissionInfo.xml
Random crashes are almost always caused by a missing art defines entry.
Also I noticed that when an enemy unit is inside your borders there is a red circle and the unit. Like in the screenshot. If this is causing the crahs how to fix it?

EDIT:My mod has its own sdk so that isn't much help to me.

The_J
Aug 26, 2009, 04:44 PM
The error message points you to the reason, why there's the red blob: The red circle, which normally appears around enemy units (i guess that's what EFFECT_ENEMY_GLOW_UNIT is), is missing.
But no idea, why.
Look in your EffectInfos.xml, if the entry is there.
If yes: Look, where the art for this is, and copy it to the right place in your mod folder.

NotSoGood
Aug 27, 2009, 08:47 AM
Wow for some reason I have copied the EffectInfos.xml from civilization not from BTS. My bad. :mischief:
Still does anyone have any idea how I have merged the tornado and volcano events wrong? Like is the problem in the xml or python or something like that. Any help will be appreciated.

The_J
Aug 27, 2009, 06:40 PM
Please turn the python exceptions on in the Civ4.ini (My Documents\My Games\BtS\Civilization4.ini; rightclick, open with Wordpad/Notepad, search for python).
Then tell us, if you get any exceptions, when the event happens.

NotSoGood
Aug 28, 2009, 07:26 AM
And where should I see these python exceptions?

phungus420
Aug 28, 2009, 07:48 AM
Turn them on and it'll be obvious.

Also If you are using custom dll changes, you should really build a debut dll and run that as well, is helpful, but do what you want of course, modding is a hobby, just giving my advice based on what I have found to make things easier.

NotSoGood
Aug 28, 2009, 07:53 AM
This may sound like a stupid question...but how do I build that debug dll?

phungus420
Aug 28, 2009, 07:56 AM
You said you have a custom gamecore (your mod has SDK changes), how did you build this gamecore?

NotSoGood
Aug 28, 2009, 08:18 AM
I used this (http://forums.civfanatics.com/downloads.php?do=file&id=10018).

phungus420
Aug 28, 2009, 08:34 AM
Check out the guide to installing the SDK on this wiki page to see how to build a debug dll:
http://modiki.civfanatics.com/index.php/Civ4_Useful_Programs

Also I think most of your current problems are related to python, so turn on python exceptions.

NotSoGood
Aug 28, 2009, 08:40 AM
Seems like all that I have to know is in refar's guide. I'll take a look at it later. About the python exceptions I have turned them on and the tornados and mountains appear on cities but I don't get any messages. :dunno:

The_J
Aug 28, 2009, 07:09 PM
Then you should kick these events out, and re-merge them.

@phungus: Would be nice, if you could put your 50 civs normal + debug dll in the download database.
I everytime have to search, when somebody asks for a 50 civs dll.

NotSoGood
Sep 04, 2009, 07:32 AM
Hi again.

I decided to try to build that debug dll. I read the refar quide about ten times before I understood something. I started the game and attached my project, whitch I had used to build my dll, to game. I also put there a breakpoint in the code and managed to freeze the game like in the quide.

But my question is how do I use this to find errors in my code? Or tell me if I did it all wrong. Please help me.

PS: Now I know how the python exceptions work. Got one 'cos randomevent wanted The Statue of Zeus but it wasn't in the game.

phungus420
Sep 04, 2009, 09:38 AM
When a failed exception is thrown while you are using a debug dll, a box pops up telling you about it, and it automatically pauses the game. I'm not very well versed when it comes to using a debug dll, I just think it's invaluable in finding causes of crashes, as with things like ethnic unit crashing, it'll tell you the cause isntead of making you hunt it down (saves hours and hours of fruitless frustration). In terms of using a debug dll to check your code which you yourself have added, I don't know how to do that. You should start a thread on it in the Python/SDK forums. Keep in mind though the bugs and crashes you are experiencing could very well not be caused by your custom SDK or python code. The crashes are most likely caused by art bugs, if this is the case just play through till you get a crash, the debug dll will let you know why when that happens if it's caused by ethnic unit art.