Quick & dirty fix for the mercenary button crash

Psyringe

Scout
Joined
Dec 7, 2001
Messages
3,394
Location
Berlin, Germany
Okay, I took a look at the code, ran some experiments, and think I have a temporary fix for the annoying mercenary button crash bug.

In the "Rhye's and Fall of Civilization" directory, open this file:
Assets\Python\screens\CvMainInterface.py

Go to line 304. Right now it reads:
Code:
screen.setImageButton( "MercenaryManagerButton", ArtFileMgr.getInterfaceArtInfo("INTERFACE_MERCENARIES_MANAGER").getPath(), iBtnX, iBtnY - 1, iBtnWidth, iBtnWidth, WidgetTypes.WIDGET_ACTION, -1, -1 )

The first of the two trailing "-1" is the problem. It should tell the interface what to do when you move the mouse over the button, but it doesn't. Change the line into:

Code:
screen.setImageButton( "MercenaryManagerButton", ArtFileMgr.getInterfaceArtInfo("INTERFACE_MERCENARIES_MANAGER").getPath(), iBtnX, iBtnY - 1, iBtnWidth, iBtnWidth, WidgetTypes.WIDGET_ACTION, gc.getControlInfo(ControlTypes.CONTROL_TURN_LOG).getActionInfoIndex() , -1 )

This is a rather dirty (but working) hack which replaces the non-working "-1" with a working function call copied over from the "Event Log" button. As a result, when you mouse over the mercenaries button, the interface displays the info "Event Log <Ctrl + Tab>" in the lower left corner. Not perfect, but at least it doesn't crash anymore.

Ideally, the game should display "Mercenaries Screen <Alt + M>" instead, but I don't know yet where to enter that info.

Also, I have not the slightest hint of an idea why this bug does occur for some people, while others never see it. But at least I can play without crashes now. :)

As usual, backup any files before you change them, and keep in mind that changed files can lead to problems in multiplayer.
 
Thanks a bunch :D :clap: :king:

However, since I always use Ctrl-M when I want the merc screen, don't know how much good it will do... :hmm: But thanks anyway.
 
Thanks a bunch :D :clap: :king:

However, since I always use Ctrl-M when I want the merc screen, don't know how much good it will do... :hmm: But thanks anyway.
You've never moved the mouse to quickly change your science slider and accidentally hovered over the offending button? Because its a leading cause of crashes for me and its the reason I changed to autosave every turn instead of every 4 :p
 
You've never moved the mouse to quickly change your science slider and accidentally hovered over the offending button? Because its a leading cause of crashes for me and its the reason I changed to autosave every turn instead of every 4 :p
And it's the main reason why Mercenaries are the first thing I took out when I started modding RFC. ;)
 
You've never moved the mouse to quickly change your science slider and accidentally hovered over the offending button? Because its a leading cause of crashes for me and its the reason I changed to autosave every turn instead of every 4 :p

I guess that's true...but not too often...

And it's the main reason why Mercenaries are the first thing I took out when I started modding RFC. ;)

:eek::eek: You took out mercs?

surely you'll put them back in with this fix (works perfectly fine, of course...)?
 
:eek::eek: You took out mercs?
surely you'll put them back in with this fix (works perfectly fine, of course...)?
Meh... I found I don't really miss them by now.;)
 
Top Bottom