Page 3 of 3

Re: add planet destroyer cannon ?

Posted: Sat Sep 30, 2017 4:37 pm
by dbenage-cx
The Silent One wrote:So if it has is an unresearched unresearchable prereq, a partially unlocked tech should not show?
Yes, to reword it a little less precisely for others (because it is even confusing to type): A tech with a hidden prereq should also be hidden.

Re: add planet destroyer cannon ?

Posted: Sun Oct 01, 2017 2:45 pm
by Vezzra
dbenage-cx wrote:A tech with a hidden prereq should also be hidden.
Yep, definitely!

Re: add planet destroyer cannon ?

Posted: Thu Oct 05, 2017 2:14 pm
by The Silent One
dbenage-cx wrote:Yes, to reword it a little less precisely for others (because it is even confusing to type): A tech with a hidden prereq should also be hidden.
Done.
dbenage-cx wrote:Something I was not expecting was the requirement to click Destroy at the planet each turn, especially after the special is placed.
I've started working on this, but need a little help. My plan is to refresh a planet destruction order if (a) the ship has not been destroyed, (b) still in the system, and (c) the planet hasn't been destroyed. (In all other cases, the ship's or planet's destruction status is reset.) The code for this should execute at the start of a new turn - not sure where to put it, maybe here: ServerApp::PostCombatProcessTurns()? If I put it there, however, I can't issue a new order for destruction, adding #include "../client/human/HumanClientApp.h" needed to issue an order leads to a dozen of "unresolved externals"? Current status of code is on github.

Re: add planet destroyer cannon ?

Posted: Thu Oct 05, 2017 5:53 pm
by o01eg
dbenage-cx wrote:Something I was not expecting was the requirement to click Destroy at the planet each turn, especially after the special is placed.
I've started working on this, but need a little help. My plan is to refresh a planet destruction order if (a) the ship has not been destroyed, (b) still in the system, and (c) the planet hasn't been destroyed. (In all other cases, the ship's or planet's destruction status is reset.) The code for this should execute at the start of a new turn - not sure where to put it, maybe here: ServerApp::PostCombatProcessTurns()? If I put it there, however, I can't issue a new order for destruction, adding #include "../client/human/HumanClientApp.h" needed to issue an order leads to a dozen of "unresolved externals"? Current status of code is on github.[/quote]

I built code without any issues on graphics-less system even with uncommented

Code: Select all

CleanUpDestructionStateInfo();
. Which errors you gets?

Re: add planet destroyer cannon ?

Posted: Thu Oct 05, 2017 7:06 pm
by The Silent One
I get lots of these:

Code: Select all

1>ServerApp.obj : error LNK2001: Nicht aufgelöstes externes Symbol ""public: static class HumanClientApp * __cdecl HumanClientApp::GetApp(void)" (?GetApp@HumanClientApp@@SAPAV1@XZ)".
1>ServerApp.obj : error LNK2001: Nicht aufgelöstes externes Symbol ""public: virtual void __thiscall GG::BeveledCheckBoxRepresenter::Render(class GG::StateButton const &)const " (?Render@BeveledCheckBoxRepresenter@GG@@UBEXABVStateButton@2@@Z)".
1>ServerApp.obj : error LNK2001: Nicht aufgelöstes externes Symbol ""public: __thiscall GG::BeveledCheckBoxRepresenter::BeveledCheckBoxRepresenter(struct GG::Clr)" (??0BeveledCheckBoxRepresenter@GG@@QAE@UClr@1@@Z)".
1>ServerApp.obj : error LNK2001: Nicht aufgelöstes externes Symbol ""public: virtual void __thiscall GG::BeveledRadioRepresenter::Render(class GG::StateButton const &)const " (?Render@BeveledRadioRepresenter@GG@@UBEXABVStateButton@2@@Z)".
1>ServerApp.obj : error LNK2001: Nicht aufgelöstes externes Symbol ""public: __thiscall GG::BeveledRadioRepresenter::BeveledRadioRepresenter(struct GG::Clr)" (??0BeveledRadioRepresenter@GG@@QAE@UClr@1@@Z)".
1>ServerApp.obj : error LNK2001: Nicht aufgelöstes externes Symbol ""public: virtual void __thiscall GG::GL3DVertexBuffer::activate(void)const " (?activate@GL3DVertexBuffer@GG@@UBEXXZ)".
"Nicht aufgelöstes externes Symbol" = unresolved external symbol

Code: Select all

#include "../client/human/HumanClientApp.h"
What's the trouble with this?

Re: add planet destroyer cannon ?

Posted: Thu Oct 05, 2017 7:40 pm
by o01eg
The Silent One wrote:I get lots of these:

Code: Select all

1>ServerApp.obj : error LNK2001: Nicht aufgelöstes externes Symbol ""public: static class HumanClientApp * __cdecl HumanClientApp::GetApp(void)" (?GetApp@HumanClientApp@@SAPAV1@XZ)".
1>ServerApp.obj : error LNK2001: Nicht aufgelöstes externes Symbol ""public: virtual void __thiscall GG::BeveledCheckBoxRepresenter::Render(class GG::StateButton const &)const " (?Render@BeveledCheckBoxRepresenter@GG@@UBEXABVStateButton@2@@Z)".
1>ServerApp.obj : error LNK2001: Nicht aufgelöstes externes Symbol ""public: __thiscall GG::BeveledCheckBoxRepresenter::BeveledCheckBoxRepresenter(struct GG::Clr)" (??0BeveledCheckBoxRepresenter@GG@@QAE@UClr@1@@Z)".
1>ServerApp.obj : error LNK2001: Nicht aufgelöstes externes Symbol ""public: virtual void __thiscall GG::BeveledRadioRepresenter::Render(class GG::StateButton const &)const " (?Render@BeveledRadioRepresenter@GG@@UBEXABVStateButton@2@@Z)".
1>ServerApp.obj : error LNK2001: Nicht aufgelöstes externes Symbol ""public: __thiscall GG::BeveledRadioRepresenter::BeveledRadioRepresenter(struct GG::Clr)" (??0BeveledRadioRepresenter@GG@@QAE@UClr@1@@Z)".
1>ServerApp.obj : error LNK2001: Nicht aufgelöstes externes Symbol ""public: virtual void __thiscall GG::GL3DVertexBuffer::activate(void)const " (?activate@GL3DVertexBuffer@GG@@UBEXXZ)".
"Nicht aufgelöstes externes Symbol" = unresolved external symbol
Looks like you trying to do something with UI in server process.
The Silent One wrote:

Code: Select all

#include "../client/human/HumanClientApp.h"
What's the trouble with this?
It will break headless compilation.

Re: add planet destroyer cannon ?

Posted: Sat Oct 07, 2017 5:26 pm
by The Silent One
dbenage-cx wrote:Something I was not expecting was the requirement to click Destroy at the planet each turn, especially after the special is placed.
I'd like to do something about this, but I'm unsure how to tackle it. Basically, the information about ongoing planet destructions must be stored somewhere, since old orders are discarded at the end of the turn. What would be the right location for that? Maybe in the empire class, with something like empire->LastTurnPlanetDestructionOrders()?
And secondly, orders must be recreated/refreshed at the start of next turn. Also not sure where in the code this should happen. Can someone who's more familiar with the code than me give me a hint?

Re: add planet destroyer cannon ?

Posted: Sat Oct 07, 2017 6:07 pm
by o01eg
Do you want to decrement countdown by Order system?

Is it possible to have a planet trait "Destroy Countdown n" which automatically move to "Destroy Countdown n-1" each turn?

Re: add planet destroyer cannon ?

Posted: Sun Oct 08, 2017 7:27 am
by The Silent One
o01eg wrote:Is it possible to have a planet trait "Destroy Countdown n" which automatically move to "Destroy Countdown n-1" each turn?
I'm looking for a solution that can be used for bombardment as well.

Re: add planet destroyer cannon ?

Posted: Sun Oct 08, 2017 2:14 pm
by LGM-Doyle
The Silent One,
You could try this. I don't know if it will work for sure, but it is where I would start.

In Orders.h add a protected virtual function shouldOrderPersist() with a default implementation similar to UndoImpl() that by default does not persist an order (i.e. returns false). Orders like bombard, colonize and destroy would then implement an override that checks their particular conditions for persistence and returns true when the order is still not completed, but possible to complete.

Then in OrderSet.h add a function ResetNonPersistenOrders() that removes all orders that return shouldOrderPersist() false.

Then in ClientApp::HandleTurnPhaseUpdate() change the Message::WAITING_FOR_PLAYERS case from m_orders.Reset() to be m_orders.ResetNonPersistentOrders().

Re: add planet destroyer cannon ?

Posted: Sun Oct 08, 2017 4:23 pm
by The Silent One
Thank you, I'll try that.