Can't switch capitals
Moderator: Oberlus
Can't switch capitals
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.
- eleazar
- Design & Graphics Lead Emeritus
- Posts: 3858
- Joined: Sat Sep 23, 2006 7:09 pm
- Location: USA — midwest
Re: Can't switch capitals
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.
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
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.
- eleazar
- Design & Graphics Lead Emeritus
- Posts: 3858
- Joined: Sat Sep 23, 2006 7:09 pm
- Location: USA — midwest
Re: Can't switch capitals
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.
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
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:
Released under the GNU GPL 2.0 and Creative Commons Attribution-ShareAlike 3.0 licenses.- Geoff the Medio
- Programming, Design, Admin
- Posts: 13587
- Joined: Wed Oct 08, 2003 1:33 am
- Location: Munich
Re: Can't switch capitals
The code for comparing meter values to the low and high end limits is: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).
Code: Select all
return m_low <= value && value <= m_high;
- eleazar
- Design & Graphics Lead Emeritus
- Posts: 3858
- Joined: Sat Sep 23, 2006 7:09 pm
- Location: USA — midwest
Re: Can't switch capitals
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.
I see some odd crashes with this patch applied, when the identical sequence of actions doesn't cause a crash without it.
- Attachments
-
- logs.zip
- (347.32 KiB) Downloaded 58 times
- Geoff the Medio
- Programming, Design, Admin
- Posts: 13587
- Joined: Wed Oct 08, 2003 1:33 am
- Location: Munich
Re: Can't switch capitals
I can't reproduce this. Exactly how did you?eleazar wrote:Weird. My testing confirms.
- Geoff the Medio
- Programming, Design, Admin
- Posts: 13587
- Joined: Wed Oct 08, 2003 1:33 am
- Location: Munich
Re: Can't switch capitals
Hrm.. well, perhaps that's not the issue in this case, although it could potentially be fore float-valued things like meters.eleazar wrote:How can there be 0.1 imperial palaces?
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
What sequence of actions? The log isn't very helpful...I see some odd crashes with this patch applied, when the identical sequence of actions doesn't cause a crash without it.
- eleazar
- Design & Graphics Lead Emeritus
- Posts: 3858
- Joined: Sat Sep 23, 2006 7:09 pm
- Location: USA — midwest
Re: Can't switch capitals
Using the 5689 binary with updated scripting...Geoff the Medio wrote:What sequence of actions? The log isn't very helpful...eleazar wrote:I see some odd crashes with this patch applied, when the identical sequence of actions doesn't cause a crash without it.
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.
- Geoff the Medio
- Programming, Design, Admin
- Posts: 13587
- Joined: Wed Oct 08, 2003 1:33 am
- Location: Munich
Re: Can't switch capitals
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
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.Once troop ships were there, clicking on the system to bring up the side panel crashed it twice in a row
- Geoff the Medio
- Programming, Design, Admin
- Posts: 13587
- Joined: Wed Oct 08, 2003 1:33 am
- Location: Munich
Re: Can't switch capitals
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.unjashfan wrote:...I thought the check wasn't inclusive...