Author Topic: [Documentation] Up-/Downgrading Facilities  (Read 6843 times)

Offline ohartenstein23

  • Commander
  • *****
  • Posts: 1756
  • Flamethrowers fry cyberdisk circuits
    • View Profile
Re: [EXE] Up-/Downgrading Facilities
« Reply #15 on: March 10, 2018, 10:00:46 pm »
The issue with the 4 day removal time is that it's longer than the original facility build time, I think that's why there's an issue.  It works just fine with -1, 1, or 2.  The sprites problem happens with spriteShape - it determines both part of the completed sprite and the in-construction sprite.  You have spriteShape: 0 on the corridor, which is the sprite for the empty base tile.  That means when the facility is completed normally, it has an 'extra' empty tile drawn on top of the one already there.  When the facility is in construction, the spriteShape used is spriteShape + 3; you can see from the vanilla BASEBITS.PCK that this is the sprite for "+"-shaped facilities.  If you want the corridor to have no spriteShape drawn, then you need to add an empty basebit image at an index and then again at that same index + 3.

Offline The Reaver of Darkness

  • Commander
  • *****
  • Posts: 1297
    • View Profile
Re: [EXE] Up-/Downgrading Facilities
« Reply #16 on: March 10, 2018, 10:41:38 pm »
That works, thanks.

I have one final question. Is there a way to change the portion of the small facility build time used for placing a large facility over it? I want to use something more like half, rather than one quarter. When I build a large living quarters over 4 small living quarters, I want it to reduce the build time by as much as 2 living quarters, or at least more than just one.

Offline ohartenstein23

  • Commander
  • *****
  • Posts: 1756
  • Flamethrowers fry cyberdisk circuits
    • View Profile
Re: [EXE] Up-/Downgrading Facilities
« Reply #17 on: March 10, 2018, 10:58:40 pm »
No, there's no way of changing that.  My intention was that this would be balanced by the difference between the normal build time of the facilities.

Offline The Reaver of Darkness

  • Commander
  • *****
  • Posts: 1297
    • View Profile
Re: [EXE] Up-/Downgrading Facilities
« Reply #18 on: March 11, 2018, 12:59:43 am »
Slightly off topic, but is there an easy way to create a facility that is just a dirt patch? I want to have some facilities take time to deconstruct, but they go to dirt. I suppose I could built a false dirt patch that looks the same and has no maintenance fee, but I feel it's overly complicated and might lead to problems down the line.

Offline Biggieboy

  • Colonel
  • ****
  • Posts: 228
    • View Profile
Re: [EXE] Up-/Downgrading Facilities
« Reply #19 on: March 11, 2018, 03:08:19 pm »
I need this mod too, but i try the Base Testing, but its not not its work, i think its just sample. (i cant write mod!)

Somebody can create working mod? I think enough double capacity for living room, work shop etc.

Thank you!

(Sry for my english!)

Offline The Reaver of Darkness

  • Commander
  • *****
  • Posts: 1297
    • View Profile
Re: [EXE] Up-/Downgrading Facilities
« Reply #20 on: March 11, 2018, 08:05:24 pm »
Try this code:

Code: [Select]
facilities:
  - type: STR_LIVING_QUARTERS
    spriteShape: 1
    spriteFacility: 18
    buildCost: 400000
    buildTime: 16
    monthlyCost: 10000
    personnel: 50
    mapName: XBASE_01
    canBeBuiltOver: true
  - type: STR_LIVING_QUARTERS_UPGRADE
    spriteShape: 1
    spriteFacility: 18
    buildCost: 600000
    buildTime: 24
    monthlyCost: 15000
    personnel: 75
    mapName: XBASE_01
    buildOverFacilities:
      - STR_LIVING_QUARTERS

If you look in any working mod, or the base ruleset, you should be able to find the STR_LIVING_QUARTERS in the facilities section. The first half of the code I put here is just a re-iteration of that facility, plus one added line at the bottom. Just replace the STR_LIVING_QUARTERS segment with the two segments I included here--preferably inside a mod, rather than changing your base ruleset.

Offline Biggieboy

  • Colonel
  • ****
  • Posts: 228
    • View Profile
Re: [EXE] Up-/Downgrading Facilities
« Reply #21 on: March 11, 2018, 08:55:50 pm »
Try this code:

Code: [Select]
facilities:
  - type: STR_LIVING_QUARTERS
    spriteShape: 1
    spriteFacility: 18
    buildCost: 400000
    buildTime: 16
    monthlyCost: 10000
    personnel: 50
    mapName: XBASE_01
    canBeBuiltOver: true
  - type: STR_LIVING_QUARTERS_UPGRADE
    spriteShape: 1
    spriteFacility: 18
    buildCost: 600000
    buildTime: 24
    monthlyCost: 15000
    personnel: 75
    mapName: XBASE_01
    buildOverFacilities:
      - STR_LIVING_QUARTERS

If you look in any working mod, or the base ruleset, you should be able to find the STR_LIVING_QUARTERS in the facilities section. The first half of the code I put here is just a re-iteration of that facility, plus one added line at the bottom. Just replace the STR_LIVING_QUARTERS segment with the two segments I included here--preferably inside a mod, rather than changing your base ruleset.

I try your code, and when i try to build empty place, its builded the upgraded Living room (with 75 personel, not 50). I think need first the standard living room, and after place the upgraded version.

Thank you!

Offline The Reaver of Darkness

  • Commander
  • *****
  • Posts: 1297
    • View Profile
Re: [EXE] Up-/Downgrading Facilities
« Reply #22 on: March 12, 2018, 01:27:47 am »
You should be able to build the basic one first, and upgrade it with the other one. It will also let you start with the upgraded version. That's a choice you can make, and I don't have the power to take it away.

Offline Biggieboy

  • Colonel
  • ****
  • Posts: 228
    • View Profile
Re: [EXE] Up-/Downgrading Facilities
« Reply #23 on: March 12, 2018, 01:38:42 am »
You should be able to build the basic one first, and upgrade it with the other one. It will also let you start with the upgraded version. That's a choice you can make, and I don't have the power to take it away.

So, it was not possible to set the condition for the standard building?

Offline The Reaver of Darkness

  • Commander
  • *****
  • Posts: 1297
    • View Profile
Re: [EXE] Up-/Downgrading Facilities
« Reply #24 on: March 12, 2018, 04:05:24 am »
I don't understand what you want. You should be able to build the upgraded living quarters on top of the basic living quarters. Is that not what you wanted?

Offline Biggieboy

  • Colonel
  • ****
  • Posts: 228
    • View Profile
Re: [EXE] Up-/Downgrading Facilities
« Reply #25 on: March 12, 2018, 08:40:36 am »
(Sorry for my english)

So, i can build Living quarters for 400.000, and after 600.000 the upgrade (and its take x+y days)

But if i build the UPGRADED version to EMPTY place, its only 600.000 and Y days for build (not both with standard). Dont have criterion, the standard living room.

Offline The Reaver of Darkness

  • Commander
  • *****
  • Posts: 1297
    • View Profile
Re: [EXE] Up-/Downgrading Facilities
« Reply #26 on: March 12, 2018, 01:12:17 pm »
That's how it's written. Building on top of a facility reduces completion time but it does not reduce the cost.

Offline Biggieboy

  • Colonel
  • ****
  • Posts: 228
    • View Profile
Re: [EXE] Up-/Downgrading Facilities
« Reply #27 on: March 12, 2018, 01:16:15 pm »
That's how it's written. Building on top of a facility reduces completion time but it does not reduce the cost.

Its ok, but it can build to empty place, and its cheaper and faster than upgrade the standard living room.

You understand what i mean? Sorry my bad english.

Offline ohartenstein23

  • Commander
  • *****
  • Posts: 1756
  • Flamethrowers fry cyberdisk circuits
    • View Profile
Re: [EXE] Up-/Downgrading Facilities
« Reply #28 on: March 12, 2018, 02:03:00 pm »
You can make upgrading cost less by setting a refundValue on the facility that is being replaced; this value will be subtracted from the cost of placing the new facility.

Offline The Reaver of Darkness

  • Commander
  • *****
  • Posts: 1297
    • View Profile
Re: [EXE] Up-/Downgrading Facilities
« Reply #29 on: March 12, 2018, 07:42:32 pm »
Its ok, but it can build to empty place, and its cheaper and faster than upgrade the standard living room.

You understand what i mean? Sorry my bad english.
I understand how it's cheaper. But it should take the same amount of time either way.
Code: [Select]
    refundValue: 300000If you add this line to your STR_LIVING_QUARTERS, it will give you a 75% refund upon upgrading the facility.


You can make upgrading cost less by setting a refundValue on the facility that is being replaced; this value will be subtracted from the cost of placing the new facility.
Excellent! Does this also pay out when the facility is removed?