aliens

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

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 8627
    • View Profile
Re: [EXE] Up-/Downgrading Facilities
« Reply #30 on: March 12, 2018, 07:51:03 pm »
Excellent! Does this also pay out when the facility is removed?

It's paid out already when upgrading... why would it refund twice?

When the new facility is removed, the refund from this new facility is applied, not from the old one.

Offline ohartenstein23

  • Commander
  • *****
  • Posts: 1931
  • Flamethrowers fry cyberdisk circuits
    • View Profile
Re: [EXE] Up-/Downgrading Facilities
« Reply #31 on: March 12, 2018, 08:21:20 pm »
To be clear, refundValue was originally added as cash back when dismantling a facility, then I made sure this refund also applies when building over the existing building, so it's only ever applied once per facility.

Offline Biggieboy

  • Colonel
  • ****
  • Posts: 220
    • View Profile
Re: [EXE] Up-/Downgrading Facilities
« Reply #32 on: March 12, 2018, 09:48:51 pm »
I think 2 solution:

1. The upgraded living room can not build to empty slot (i think this is the better)

2. Or refund all Standard living room price, because:

Living Room price: 400.000
Upgrade: 600.000

All its 1.000.000

But:

Build empty slot the Upgaded Living room, and its only 600.000 (and buildtime less too)

Offline ohartenstein23

  • Commander
  • *****
  • Posts: 1931
  • Flamethrowers fry cyberdisk circuits
    • View Profile
Re: [EXE] Up-/Downgrading Facilities
« Reply #33 on: March 12, 2018, 10:30:55 pm »
The first one doesn't make sense to me, since placing the 'upgraded' facility on an empty square can be seen as equivalent to putting down the basic facility and then upgrading it all at once.  When writing the code, I decided that it should be up to the modder to balance the build time and refund when upgrading; the cost of convenience of just being able to place one building over top another is the difference between cost and refund value.

Also, the first would require editing the engine code, the second is just writing a mod.

Offline Biggieboy

  • Colonel
  • ****
  • Posts: 220
    • View Profile
Re: [EXE] Up-/Downgrading Facilities
« Reply #34 on: March 12, 2018, 10:52:36 pm »
The first one doesn't make sense to me, since placing the 'upgraded' facility on an empty square can be seen as equivalent to putting down the basic facility and then upgrading it all at once.  When writing the code, I decided that it should be up to the modder to balance the build time and refund when upgrading; the cost of convenience of just being able to place one building over top another is the difference between cost and refund value.

Also, the first would require editing the engine code, the second is just writing a mod.

I understand, thanks your answer!

Offline The Reaver of Darkness

  • Commander
  • *****
  • Posts: 1510
    • View Profile
Re: [EXE] Up-/Downgrading Facilities
« Reply #35 on: March 13, 2018, 12:21:02 am »
To be clear, refundValue was originally added as cash back when dismantling a facility, then I made sure this refund also applies when building over the existing building, so it's only ever applied once per facility.
That's what I meant. Thanks.

Also, it makes sense for realism that there is a monetary loss in the upgrade. At minimum, there is structural redesigning to be done, but you can also expect some of the equipment to be replaced. Of course the modder can decide how much loss there is.
« Last Edit: March 13, 2018, 06:23:16 am by The Reaver of Darkness »

Offline Biggieboy

  • Colonel
  • ****
  • Posts: 220
    • View Profile
Re: [EXE] Up-/Downgrading Facilities
« Reply #36 on: March 13, 2018, 12:53:26 pm »
Hi guys!

I create the mod with your helps :)

Can upgrade:
- Living Quarters
- General Stores
- Workshop
- Laboratory
- Psionic Laboratory (psionic research needed!)

store capacity x1,5
monthly cost: x1,5
price: x1,5*

*When build on to the standard building, you need to pay just the difference (example: Living quarters 400000, the upgrade need just +200000). The buildng time its same, need wait just the difference (example: Living Quarters build time 16 days, the upgrade need just +8 days)
When build empty slot, need pay the full price and need wait full time.

Please test it, and give me some feedback!

Thank you!



Offline The Reaver of Darkness

  • Commander
  • *****
  • Posts: 1510
    • View Profile
Re: [EXE] Up-/Downgrading Facilities
« Reply #37 on: March 13, 2018, 04:12:44 pm »
Please test it, and give me some feedback!

You should make a new thread for your mod in the Modding > Work In Progress forum. Many of us use the 'Show unread posts since last visit.' link at the top left of the page, so we'll see your thread no matter where you post it.
« Last Edit: March 13, 2018, 04:15:33 pm by The Reaver of Darkness »

Offline Biggieboy

  • Colonel
  • ****
  • Posts: 220
    • View Profile
Re: [EXE] Up-/Downgrading Facilities
« Reply #38 on: March 13, 2018, 04:58:45 pm »
You should make a new thread for your mod in the Modding > Work In Progress forum. Many of us use the 'Show unread posts since last visit.' link at the top left of the page, so we'll see your thread no matter where you post it.

Ok, i do, thanx!

Offline Biggieboy

  • Colonel
  • ****
  • Posts: 220
    • View Profile
Re: [EXE] Up-/Downgrading Facilities
« Reply #39 on: April 23, 2018, 03:04:18 am »
New feature documentation time!  With a recent code addition to OXCE+, you can now 'upgrade' existing facilities by building over them, and you can also make it such that removing a facility can 'downgrade' it to another facility.

The rules for this feature are as follows:

When a facility is removed, the ruleset is checked for a list of facility names leaveBehindOnSell
  • If the first facility on the list is equal to the size of original, then that facility is placed over the previous one
  • If the list contains all size 1 facilities, then the list is iterated over, placing facilities until the size of the previous is reach
  • If the sizes don't match one of the above conditions, an exception is thrown letting the player/modder know the sizes don't match up
The facilities left behind are given a build time according to the previous facility's removalTime:
  • If removalTime: 0, then the facility is instantly built (default behavior)
  • If removalTime: -1, then the build time is set to the new facility's normal build time
  • If removalTime is a number greater than 0, then the build time for the new facility is set to that number


Hi!

I wanna large facality overbuild with Hangar, but the removalTime doesnt work. i try -1, 0, 1,2,3 ect, but nothing changed.. I check the Base testing mod, but same problem, if changed the removal time, nothing changed!

Thank you!

Offline ohartenstein23

  • Commander
  • *****
  • Posts: 1931
  • Flamethrowers fry cyberdisk circuits
    • View Profile
Re: [EXE] Up-/Downgrading Facilities
« Reply #40 on: April 23, 2018, 05:49:57 am »
Are you putting removalTime on the hangar or the other facility? It should be on the other facility.

Offline Biggieboy

  • Colonel
  • ****
  • Posts: 220
    • View Profile
Re: [EXE] Up-/Downgrading Facilities
« Reply #41 on: April 23, 2018, 09:49:12 am »
Are you putting removalTime on the hangar or the other facility? It should be on the other facility.

Hi!

This is:

Code: [Select]
  - type: STR_LARGE_GBUILDING
    spriteShape: 1002
    spriteFacility: 1002
    buildCost: 160000
    buildTime: 12
    monthlyCost: 0
    mapName: GBUI_01
    canBeBuiltOver: true
    removalTime: -1
    size: 2

Hangar build time 25, if i build over with Hangar the Large General building, only 3 days reduce the building time ( i need more)

If you need the full mod, just please tell me, i attach!

Thank you!

Offline ohartenstein23

  • Commander
  • *****
  • Posts: 1931
  • Flamethrowers fry cyberdisk circuits
    • View Profile
Re: [EXE] Up-/Downgrading Facilities
« Reply #42 on: April 23, 2018, 04:42:04 pm »
Ah, okay.  That is an intended feature, that the 'refund' in building time is divided by the number of squares in the new building.  You should either use a positive removal time for STR_LARGE_GBUILDING, or just us small buildings as the precursor facility.

Offline Biggieboy

  • Colonel
  • ****
  • Posts: 220
    • View Profile
Re: [EXE] Up-/Downgrading Facilities
« Reply #43 on: April 23, 2018, 09:44:55 pm »
Ah, okay.  That is an intended feature, that the 'refund' in building time is divided by the number of squares in the new building.  You should either use a positive removal time for STR_LARGE_GBUILDING, or just us small buildings as the precursor facility.

I try many numbers, but noghing  changed, same buildtime for Hangar every time :(

I attach the rul file, can you check for me?

Thank you!

Offline ohartenstein23

  • Commander
  • *****
  • Posts: 1931
  • Flamethrowers fry cyberdisk circuits
    • View Profile
Re: [EXE] Up-/Downgrading Facilities
« Reply #44 on: April 23, 2018, 10:05:46 pm »
Ah, sorry, I mis-remembered what the feature was.  The removalTime is only used when directly removing a facility, it isn't checked for building over another facility, only the buildTime of the previous facility is checked.  In order to get what you want, the LARGE_GBUIDLING needs to have a buildTime much longer than 12 days - my suggestion would be to create a copy of the LARGE_GBUILDING with the long build time you want to speed up large facility placement, but not have it be built directly.  Rather, have your current LARGE_GBUILDING leave behind this new copy when you 'dismantle' it.