Reset Civ4lerts Module?

Afforess

The White Wizard
Joined
Jul 31, 2007
Messages
12,239
Location
Austin, Texas
RevDCM and RevDCM based mods get a lot of keyErrors whenever the active player switches to a new civilization. These errors all stem from Civ4lerts, and if I disable the alerts, the errors go away; but that's too steep a price to pay to get Revolutions to work. So how would I go about resetting Civ4lerts when the active player changes?
 
If you can give me some more background I might be able to help. Why does the active player switch and how? I don't mean for you to justify the behavior--just explain precisely what's going on. In HotSeat games the active player changes, and Civ4lerts uses a new BUG event onHotSeatPlayerChange or something like that. Maybe you can piggy-back off it.

Also, can you post stack traces for the errors you get?
 
Here's the traceback:

Code:
Traceback (most recent call last):
  File "BugEventManager", line 361, in _handleDefaultEvent
  File "Civ4lerts", line 829, in onBeginActivePlayerTurn
  File "Civ4lerts", line 865, in check
KeyError: 9
Traceback (most recent call last):
  File "BugEventManager", line 361, in _handleDefaultEvent
  File "Civ4lerts", line 904, in onBeginActivePlayerTurn
  File "Civ4lerts", line 942, in check
KeyError: 9

As for what is happening, IDK, I'm unfamiliar with RevDCM's code, but since Phungus left, if I don't fix this, it won't be fixed for a long time.
 
Well, I am in the middle of rewriting the Civ4lerts code as it is, so maybe what I'm doing will end up fixing this issue. Unfortunately, my BUG time has become more limited lately, and I'm not sure when I can finish it. It is a large chunk of code, and my rewrite is enhancing it quite a bit.
 
If you can give me some more background I might be able to help. Why does the active player switch and how? I don't mean for you to justify the behavior--just explain precisely what's going on. In HotSeat games the active player changes, and Civ4lerts uses a new BUG event onHotSeatPlayerChange or something like that. Maybe you can piggy-back off it.

Also, can you post stack traces for the errors you get?
Player's civ can switch to another during revolutions (RevDCM feature) by choosing option to defect or lead the rebels when revolution happens. In this case you loose the control of your empire and start as a newly formed rebel civ which will be in war with your old empire. Basically it's a situation where empire falls into civil war and splits into 2 empires.
 
Okay, it sounds like I need to add a new event to BUG for RevDCM: ActivePlayerChanged. Civ4lerts and Reminders would move the data from one player to another when that event is received. BUG wouldn't fire it normally; it would be up to RevDCM and other mods to fire the event. Would this work?
 
Top Bottom