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.The Silent One wrote:So if it has is an unresearched unresearchable prereq, a partially unlocked tech should not show?
add planet destroyer cannon ?
Moderator: Oberlus
-
- Programmer
- Posts: 389
- Joined: Sun Feb 14, 2016 12:08 am
Re: add planet destroyer cannon ?
Re: add planet destroyer cannon ?
Yep, definitely!dbenage-cx wrote:A tech with a hidden prereq should also be hidden.
- The Silent One
- Graphics
- Posts: 1129
- Joined: Tue Jul 01, 2003 8:27 pm
Re: add planet destroyer cannon ?
Done.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.
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.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.
If I provided any images, code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0.
Re: add planet destroyer cannon ?
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]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 built code without any issues on graphics-less system even with uncommented
Code: Select all
CleanUpDestructionStateInfo();
Gentoo Linux x64, gcc-11.2, boost-1.78.0
Ubuntu Server 22.04 x64, gcc-12, boost-1.74.0
Welcome to the slow multiplayer game at freeorion-lt.dedyn.io.Version 2024-03-15.b3de094.
Donations're welcome:BTC:bc1q007qldm6eppqcukewtfkfcj0naut9njj7audnm
Ubuntu Server 22.04 x64, gcc-12, boost-1.74.0
Welcome to the slow multiplayer game at freeorion-lt.dedyn.io.Version 2024-03-15.b3de094.
Donations're welcome:BTC:bc1q007qldm6eppqcukewtfkfcj0naut9njj7audnm
- The Silent One
- Graphics
- Posts: 1129
- Joined: Tue Jul 01, 2003 8:27 pm
Re: add planet destroyer cannon ?
I get lots of these:
"Nicht aufgelöstes externes Symbol" = unresolved external symbol
What's the trouble with this?
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)".
Code: Select all
#include "../client/human/HumanClientApp.h"
If I provided any images, code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0.
Re: add planet destroyer cannon ?
Looks like you trying to do something with UI in server process.The Silent One wrote:I get lots of these:"Nicht aufgelöstes externes Symbol" = unresolved external symbolCode: 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)".
It will break headless compilation.The Silent One wrote:What's the trouble with this?Code: Select all
#include "../client/human/HumanClientApp.h"
Gentoo Linux x64, gcc-11.2, boost-1.78.0
Ubuntu Server 22.04 x64, gcc-12, boost-1.74.0
Welcome to the slow multiplayer game at freeorion-lt.dedyn.io.Version 2024-03-15.b3de094.
Donations're welcome:BTC:bc1q007qldm6eppqcukewtfkfcj0naut9njj7audnm
Ubuntu Server 22.04 x64, gcc-12, boost-1.74.0
Welcome to the slow multiplayer game at freeorion-lt.dedyn.io.Version 2024-03-15.b3de094.
Donations're welcome:BTC:bc1q007qldm6eppqcukewtfkfcj0naut9njj7audnm
- The Silent One
- Graphics
- Posts: 1129
- Joined: Tue Jul 01, 2003 8:27 pm
Re: add planet destroyer cannon ?
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()?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.
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?
If I provided any images, code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0.
Re: add planet destroyer cannon ?
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?
Is it possible to have a planet trait "Destroy Countdown n" which automatically move to "Destroy Countdown n-1" each turn?
Gentoo Linux x64, gcc-11.2, boost-1.78.0
Ubuntu Server 22.04 x64, gcc-12, boost-1.74.0
Welcome to the slow multiplayer game at freeorion-lt.dedyn.io.Version 2024-03-15.b3de094.
Donations're welcome:BTC:bc1q007qldm6eppqcukewtfkfcj0naut9njj7audnm
Ubuntu Server 22.04 x64, gcc-12, boost-1.74.0
Welcome to the slow multiplayer game at freeorion-lt.dedyn.io.Version 2024-03-15.b3de094.
Donations're welcome:BTC:bc1q007qldm6eppqcukewtfkfcj0naut9njj7audnm
- The Silent One
- Graphics
- Posts: 1129
- Joined: Tue Jul 01, 2003 8:27 pm
Re: add planet destroyer cannon ?
I'm looking for a solution that can be used for bombardment as well.o01eg wrote:Is it possible to have a planet trait "Destroy Countdown n" which automatically move to "Destroy Countdown n-1" each turn?
If I provided any images, code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0.
Re: add planet destroyer cannon ?
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().
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().
- The Silent One
- Graphics
- Posts: 1129
- Joined: Tue Jul 01, 2003 8:27 pm
Re: add planet destroyer cannon ?
Thank you, I'll try that.
If I provided any images, code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0.