Page 1 of 1

Can't switch capitals

Posted: Wed Dec 12, 2012 2:51 am
by unjashfan
There seems to be something wrong with how the game detects the imperial palace because scrapping the imperial palace at the homeworld doesn't completely remove the effects. I see something like "Imperial palace: +5" followed by "Unknown: -5" for planetary defense. The other meters have the same thing. As of now, it's impossible to build another imperial palace.

Re: Can't switch capitals

Posted: Wed Dec 12, 2012 3:21 am
by eleazar
Do you get the ghost readings for more than one turn after you scrap it?

But I don't think scrapping is a good method. Start building a new one and it should remove the old one.

Re: Can't switch capitals

Posted: Wed Dec 12, 2012 10:36 pm
by unjashfan
Yes the ghost readings stay for more than one turn; it seems to be permanent. Building a second one before scrapping the first isn't possible either because one of the requirements for the palace is "if there are between 0 and 0 objects that is an imperial palace building and that it belongs to and was produced by the source's empire". From how I interpret this, it pretty much means that the old palace must be removed first before a second one can be built.

Re: Can't switch capitals

Posted: Wed Dec 12, 2012 11:16 pm
by eleazar
Weird. My testing confirms.
I note that the troop meter doesn't have the ghost readings after scrapping.

I wonder if it is some sort of visibility issue. When the turn is processing the about-to-be-scrapped building is shown with the scan lines for a fraction of a second.

Re: Can't switch capitals

Posted: Fri Feb 01, 2013 3:01 pm
by unjashfan
I changed the check condition from "between 0 and 0" to "between -1 and 1" and it seems to work as intended (numbers don't seem to be inclusive). Building new imperial palaces will require scrapping the old one first (I'm assuming that's how it was intended). Here's the patch:

[The extension patch has been deactivated and can no longer be displayed.]

Released under the GNU GPL 2.0 and Creative Commons Attribution-ShareAlike 3.0 licenses.

Re: Can't switch capitals

Posted: Sat Feb 02, 2013 7:23 pm
by Geoff the Medio
unjashfan wrote:I changed the check condition from "between 0 and 0" to "between -1 and 1" and it seems to work as intended (numbers don't seem to be inclusive).
The code for comparing meter values to the low and high end limits is:

Code: Select all

return m_low <= value && value <= m_high;
. It's possible that the value wasn't quite 0 though, even it appeared as such, due to rounding.

Re: Can't switch capitals

Posted: Sat Feb 02, 2013 8:16 pm
by eleazar
How can there be 0.1 imperial palaces?

I see some odd crashes with this patch applied, when the identical sequence of actions doesn't cause a crash without it.

Re: Can't switch capitals

Posted: Sat Feb 02, 2013 8:33 pm
by Geoff the Medio
eleazar wrote:Weird. My testing confirms.
I can't reproduce this. Exactly how did you?

Re: Can't switch capitals

Posted: Sat Feb 02, 2013 8:38 pm
by Geoff the Medio
eleazar wrote:How can there be 0.1 imperial palaces?
Hrm.. well, perhaps that's not the issue in this case, although it could potentially be fore float-valued things like meters.

Edit: I think the problem is that it's counting destroyed objects when finding how many of something exist. There are likely a few other places where this sort of thing is happening. /Edit
I see some odd crashes with this patch applied, when the identical sequence of actions doesn't cause a crash without it.
What sequence of actions? The log isn't very helpful...

Re: Can't switch capitals

Posted: Sat Feb 02, 2013 9:11 pm
by eleazar
Geoff the Medio wrote:
eleazar wrote:I see some odd crashes with this patch applied, when the identical sequence of actions doesn't cause a crash without it.
What sequence of actions? The log isn't very helpful...
Using the 5689 binary with updated scripting...

These tests were performed starting a new game each time. There was a nearby Scylior planet, i would send troop ships there so i had a second planet to try to build the imperial palace on. Once troop ships were there, clicking on the system to bring up the side panel crashed it twice in a row. Without the patch, no crash. I also got a crash once when opening the production window.

Re: Can't switch capitals

Posted: Sat Feb 02, 2013 9:44 pm
by Geoff the Medio
The imperial palace issue should be fixed now. This could also have been, and might probably should be, worked around in some cases by adding VisibleToEmpire conditions.

Re: Can't switch capitals

Posted: Sat Feb 02, 2013 10:56 pm
by unjashfan
Once troop ships were there, clicking on the system to bring up the side panel crashed it twice in a row
Weird. I can't replicate this, but the natives in question for me was abaddonni. I thought the check wasn't inclusive, but I was allowed to build the palace on all my colonies. Now I'm really confused :?. I must've missed something somewhere.

Re: Can't switch capitals

Posted: Sat Feb 02, 2013 10:59 pm
by Geoff the Medio
unjashfan wrote:...I thought the check wasn't inclusive...
The problem was that it counted the destroyed starting palace as an existing palace, so decided you had a palace and couldn't produce another one. Extending the range to -1 to 1 (which gets truncated to 0 to 1 internally), allowed a new palace to be produced since (it thought) you had 1 palace after scrapping the first. Had you produced and scrapped a second, it would likely not have allowed you to produce a third. Also, note that palaces you didn't produce don't count in any case, so capturing another empire's palace won't (shouldn't?) affect how many you can/can't produce.