Author Topic: [Solved] provideBaseFunc not functioning as intended?  (Read 1421 times)

wcho035

  • Guest
[Solved] provideBaseFunc not functioning as intended?
« on: January 03, 2020, 03:15:52 am »
Hi, today I am retesting my coding for facilities. I found an anomaly. In my small hanger coding for facilities.rul I have

  - type: STR_SMALL_HANGAR
    provideBaseFunc: [SMALLCRAFT]
    spriteShape: 1
    spriteFacility: 575
    buildCost: 1
    buildTime: 1
    monthlyCost: 1
    crafts: 1
    mapName: XBASE_SMHANGER

So from the coding above provideBaseFunc provide "SMALLCRAFT" services.

My skyranger coding.

  - type: STR_SKYRANGER
    requiresBuyBaseFunc: [LARGECRAFT]    <------
    sprite: 0   
    fuelMax: 1500   
    damageMax: 150   
    speedMax: 760   
    accel: 2   
    soldiers: 14   
    vehicles: 3   
    costBuy: 500000   
    costRent: 500000 
    forceShowInMonthlyCosts: true   
    refuelRate: 50   
    transferTime: 72   
    score: 200   
    battlescapeTerrainData:     
      name: PLANE     
      mapDataSets:     
        - BLANKS       
        - PLANE     
      mapBlocks:       
        - name: PLANE
          width: 10       
          length: 20

Uses "LARGECRAFT" services only a 2X2 hanger provides.

Yet please see screenshot.

Have I used the services from those functions correctly?
« Last Edit: February 11, 2023, 11:36:46 pm by Meridian »

Offline ohartenstein23

  • Commander
  • *****
  • Posts: 1931
  • Flamethrowers fry cyberdisk circuits
    • View Profile
Re: provideBaseFunc not functioning as intended?
« Reply #1 on: January 03, 2020, 05:05:20 am »
There is no bug or code issue here, just you expecting a feature that doesn't exist. Your skyranger requires a large hangar to buy by baseFuncs, and you have three at that base. Therefore, you can buy a skyranger at the base. That's all the baseFuncs do.

There are no different "types" of hangar - the facility is either a hangar or not a hangar. If it doesn't have a craft in it, then it's eligible for a new craft to be placed there. baseFuncs do not have anything to do with whether the craft is placed in that facility.

wcho035

  • Guest
Re: provideBaseFunc not functioning as intended?
« Reply #2 on: January 03, 2020, 05:55:34 am »
Thank you Ohartenstein23, I was retesting a old feature I had disabled. From memory, large craft can’t be purchase with small hanger but large. However if the large hanger get sold, only large craft get transfer to which ever available hanger including a small one.

I may have misunderstood the requirebuybaseFunc