Planetary bombardment question

Post Reply
Arctodus
Private First Class - Opel Blitz
Private First Class - Opel Blitz
Posts: 3
Joined: Sun Oct 30, 2016 10:55 pm

Planetary bombardment question

Post by Arctodus » Sun Oct 30, 2016 11:23 pm

Hello all.

Really enjoy the game, reminds me quite a bit of one of my old favorites, Pax Imperia.

Anyway I'd like to mod planetary bombardment so that bombing a colony to destruction doesn't apply negative modifiers to the planet once the colony on it is destroyed.

I found HandleGetBombingResult in invasion.a, which calls UFMakePlanetDestruction in userfunc.a, which in trun passes the call on to the planet like so:

Code: Select all

ThisPlanet->MakeDestruction(0.01f*(float)PercentDestruction, 0.01f*(float)PercentMilitaryDestruction, 0.01f*PercentPopulationKill, Yes_==KeepColonialModuleAndSpaceport);
I modified this call to:

Code: Select all

ThisPlanet->MakeDestruction(0.0f, 0.01f*PercentMilitaryDestruction, 0.01f*PercentPopulationKill, Yes_==KeepColonialModuleAndSpaceport);
I then rebuilt my rtq.* files, and copied the .cht, .gen, .pht, and .rht output into my mod folder. However this has not had the expected result. Colonies i destroy still end up with negative production modifiers. It seems they are less than they were previously (from 2-7% negatvie instead of 15-25%), but they are still there.

Questions:
Did I make the correct change here? in other words my mod works as it should and the smaller negative values I'm seeing are just the result of the minig/extraction that had been done by the previous occupants?

Is my change wrong?

is the change incomplete? Like the military and population overkill are getting applied to produce the negative modifiers I'm seeing?

Something else?


I'd appreciate any information/feedback that those of you more knowledgable about this would care to provide.

Thanks!

Ufnv
SoftWarWare
SoftWarWare
Posts: 688
Joined: Sun Oct 25, 2015 9:19 pm

Re: Planetary bombardment question

Post by Ufnv » Mon Oct 31, 2016 9:16 am

Hi!

There are two problems:

1) invasion.a is a deprecated file and all functions there a commented out and not used. Bombing mechanics is now implemented in the game code.
2) everything inside userfuncs is not changeable, so you can use userfuncs but not modify their content.

So I afraid it is not that easy to modify bombing mechanics, but if you formulate more specific how it should look like, I can think how it can be done.

Arctodus
Private First Class - Opel Blitz
Private First Class - Opel Blitz
Posts: 3
Joined: Sun Oct 30, 2016 10:55 pm

Re: Planetary bombardment question

Post by Arctodus » Tue Nov 01, 2016 2:25 am

Thanks for the reply!

So i just got lucky on some lesser values and attributed it to my change, bummer :(

My only goal is that planetary bombardment should not erode/degrade the resources of a planet. Such that it still kills all the people and destroys all the buildings, but any mineral wealth should be unaffected.

If I bomb a colony to extinction currently, afterwards when i go to colonize I typically see negative modifiers like -25% organics, -20% metals, etc.

My impression (perhaps mistakenly?) is that planetary bombardment causes this degradation of a planet's resources.

Ufnv
SoftWarWare
SoftWarWare
Posts: 688
Joined: Sun Oct 25, 2015 9:19 pm

Re: Planetary bombardment question

Post by Ufnv » Tue Nov 01, 2016 9:12 am

Arctodus wrote:If I bomb a colony to extinction currently, afterwards when i go to colonize I typically see negative modifiers like -25% organics, -20% metals, etc.

My impression (perhaps mistakenly?) is that planetary bombardment causes this degradation of a planet's resources.
Bombing does not cause the degradation, the reason for it is most likely the planet was exploited for quite a long period of time and thus its resources were a bit exhausted. All planets exhaust over time, if this setting is not switched off.

Arctodus
Private First Class - Opel Blitz
Private First Class - Opel Blitz
Posts: 3
Joined: Sun Oct 30, 2016 10:55 pm

Re: Planetary bombardment question

Post by Arctodus » Wed Nov 02, 2016 3:21 am

Ahhhh! I didn't realize that was a setting, but since you mentioned it I went and found it :)

Thank you so much for the replies, I will happily get busy bombing all who oppose me!

Post Reply

Return to “Modders Corner”