Author Topic: [DONE] Support for fake underwater xcom bases  (Read 1407 times)

Online Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9091
    • View Profile
[DONE] Support for fake underwater xcom bases
« on: September 12, 2019, 01:31:39 pm »
(You know come to think of it, this starting condition can also be apply on base structures on the starting base. Like Surface base, which is forbidden and then the same for sea base.)

I can make distinct Surface and FakeUnderwater bases... but the first (starting) base must be a Surface base.
Is that acceptable?

PS: the reason is that technically the starting base is created and filled with facilities long before you select its position... which I can't change.
« Last Edit: February 02, 2023, 10:48:00 am by Meridian »

wcho035

  • Guest
Re: Support for fake underwater xcom bases
« Reply #1 on: September 12, 2019, 02:14:57 pm »
Sound like a great plan, Meridian. As always, I am grateful if you can give me that feature.

Online Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9091
    • View Profile
Re: Support for fake underwater xcom bases
« Reply #2 on: September 12, 2019, 06:29:28 pm »
I can make distinct Surface and FakeUnderwater bases... but the first (starting) base must be a Surface base.
Is that acceptable?

Bases build on fake water will remember they are underwater, other bases are surface bases.

Base facilities can be flagged to support both base types (fakeUnderwater: -1), or only one of them (fakeUnderwater: 0 or fakeUnderwater: 1).

The starting base cannot be built on fake water!

Example:

Code: [Select]
globe:
  textures:
    - id: 4    # sahara
      fakeUnderwater: true
    - id: 7    # below sahara
      fakeUnderwater: true

facilities:
  - type: STR_SMALL_RADAR_SYSTEM
    hyper: true
    radarRange: 5000
    radarChance: 100
############# fake underwater only
  - type: STR_ACCESS_LIFT_UNDERWATER
    spriteShape: 2
    spriteFacility: 17
    lift: true
    buildCost: 300000
    buildTime: 1
    monthlyCost: 4000
    mapName: XBASE_00
    fakeUnderwater: 1
############# surface only
  - type: STR_ACCESS_LIFT
    fakeUnderwater: 0
  - type: STR_LIVING_QUARTERS
    fakeUnderwater: 0
  - type: STR_LABORATORY
    fakeUnderwater: 0

Test build: https://lxnt.wtf/oxem/builds//Extended/Extended-5.6.3-ecaa78032-2019-09-12-win64.7z
« Last Edit: September 12, 2019, 06:32:30 pm by Meridian »

wcho035

  • Guest
Re: Support for fake underwater xcom bases
« Reply #3 on: September 12, 2019, 08:02:46 pm »
Sorry Meridian, it didn't work as planned. I have tried the code but the facility neither showing on sea or land.

Originally, I believe the best way to implement this is, the first facility you construct when you build a new base. The airlock is either land or sea type, then using provideBaseFunc from the airlock to distinguished either land or sea facilities.

However, this said, the only undersea base facility I am concentrating on having this distinguishing feature is sea pen.

If you can code the craft to have "Usebasefunc"  like the craft will only use the service the hanger provides, this will serve me
all I need. If the coding is not too much. With this, I can make submarine to use only that hanger or subpen. If the craft is transfer between bases, it will only able to use the hanger with Usebasefunc.

I won't ask anything else from you, if you can just give me this feature and solve the vaportrail problem.


Online Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9091
    • View Profile
Re: Support for fake underwater xcom bases
« Reply #4 on: September 12, 2019, 08:44:58 pm »
It's super simple.

First flag some textures as underwater or not.
Then flag some facilities as underwater or not.

Only compatible facilities can be built in a base.

What exactly doesn't work?

Sorry Meridian, it didn't work as planned. I have tried the code but the facility neither showing on sea or land.

Can you at least post the ruleset you used pls?

Originally, I believe the best way to implement this is, the first facility you construct when you build a new base. The airlock is either land or sea type, then using provideBaseFunc from the airlock to distinguished either land or sea facilities.

This works.
Just define two types of airlocks, one surface airlock and one underwater airlock.
And give them any provideBaseFunc as you want.

If you can code the craft to have "Usebasefunc"  like the craft will only use the service the hanger provides, this will serve me
all I need. If the coding is not too much. With this, I can make submarine to use only that hanger or subpen. If the craft is transfer between bases, it will only able to use the hanger with Usebasefunc.

I won't ask anything else from you, if you can just give me this feature and solve the vaportrail problem.

No, I said already I have no plans to do this. It's on Yankes' todolist, I'm not going to interfere with him.

wcho035

  • Guest
Re: Support for fake underwater xcom bases
« Reply #5 on: September 12, 2019, 09:15:19 pm »
Again! It absolutely worked! You are a miracle worker Meridian! I didn't put a check on the original airlock that is why it is not working.  Sorry I didn't make it work before. Tiredness of the day!

Anyway, thank you once more for coming through with these extra coding! I don't believe there's anything else I can ask from you.

I am quite happy with everything you did for me. I am sorry earlier for any frustation. Just fatigue.. your work again is absolutely first class.