Author Topic: OXCE (OpenXcom Extended) main thread  (Read 129596 times)

Offline Meridian

  • Global Moderator
  • Commander
  • ***
  • Posts: 6793
  • OXCE developer
    • View Profile
    • My Wiki
Re: OXCE (OpenXcom Extended) main thread
« Reply #780 on: March 26, 2021, 05:28:06 pm »
Unfortunately, there are maps with 15 shading. And these are the settings of the original. Try it yourself.
UFO - UBASE, MARS.
TRTD - GRUNGE, ENTRY, ALSHIP, LEVEL, CRYPT.

I know.

Setting 15 means "darker than 15", "relevant for shade higher than 15", "relevant for shade > 15", "relevant for shade higher or equal than 16" or "relevant for shade >= 16".
Hope that clarifies it.

With setting 15, OXCE will *not* automatically turn on night vision under any circumstance.
Just try it yourself.
« Last Edit: March 26, 2021, 05:32:15 pm by Meridian »

Offline Ethereal

  • Colonel
  • ****
  • Posts: 449
    • View Profile
Re: OXCE (OpenXcom Extended) main thread
« Reply #781 on: March 26, 2021, 05:38:10 pm »
Understood thanks. Found a mistake in myself, there were maps with shading 16. I will fix it.

Offline Ethereal

  • Colonel
  • ****
  • Posts: 449
    • View Profile
Re: OXCE (OpenXcom Extended) main thread
« Reply #782 on: April 19, 2021, 09:55:06 am »
Code: [Select]
[ERROR] Error processing 'STR_TANK_CANNON' in items: Vehicle weapons support only one ammo type
It's a pity. :D

Offline krautbernd

  • Commander
  • *****
  • Posts: 749
    • View Profile
Re: OXCE (OpenXcom Extended) main thread
« Reply #783 on: April 26, 2021, 04:58:01 pm »
Not sure if this is the right place, but I have recently run into trouble with prison types in XCF.

Cyberweb robotic units - robosphere/turret (or rather their respective items upon recovery) - don't have an assigned prison type. They die upon recovery if no alien containment unit exists. They however do not take up any prisoner slot in the containment unit and are not trasferred to a base having a containment unit either.

I am not sure this intended or a fall back for "vanilla" units (i.e. those without a separate prison type). What would be the correct way to define a recoverable alien unit that takes up no prison slot/type?
« Last Edit: April 26, 2021, 05:01:06 pm by krautbernd »

Offline Meridian

  • Global Moderator
  • Commander
  • ***
  • Posts: 6793
  • OXCE developer
    • View Profile
    • My Wiki
Re: OXCE (OpenXcom Extended) main thread
« Reply #784 on: April 26, 2021, 05:05:20 pm »
There is always a prison type, default is 0.

Check if you have correctly set the `liveAlien` flag.

Offline krautbernd

  • Commander
  • *****
  • Posts: 749
    • View Profile
Re: OXCE (OpenXcom Extended) main thread
« Reply #785 on: April 26, 2021, 05:12:13 pm »
There is always a prison type, default is 0.

Check if you have correctly set the `liveAlien` flag.

No, those units don't have that flag set (on purpose I guess, since they are robotic). Do all recoverd units check for a matching/existing prison type, regardless of the flag? Is it possible to skip that check?
« Last Edit: April 26, 2021, 05:14:42 pm by krautbernd »

Offline Meridian

  • Global Moderator
  • Commander
  • ***
  • Posts: 6793
  • OXCE developer
    • View Profile
    • My Wiki
Re: OXCE (OpenXcom Extended) main thread
« Reply #786 on: April 26, 2021, 05:23:48 pm »
It's simple.

Stuff with `liveAlien: false` goes into stores.
Stuff with `liveAlien: true` goes into alien containment.
Nothing else depends on this flag.
This is its only purpose, by design.

Once it has been determined that an item belongs to an alien containment... then the `prisonType` attribute kicks in and says to which particular alien containment facility should it go.

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 10099
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: OXCE (OpenXcom Extended) main thread
« Reply #787 on: April 26, 2021, 05:36:59 pm »
Sorry, it's my fault. I'll fix the problem soon.

Offline krautbernd

  • Commander
  • *****
  • Posts: 749
    • View Profile
Re: OXCE (OpenXcom Extended) main thread
« Reply #788 on: April 26, 2021, 05:37:13 pm »
It's simple.

Stuff with `liveAlien: false` goes into stores.
Stuff with `liveAlien: true` goes into alien containment.
Nothing else depends on this flag.
This is its only purpose, by design.

Once it has been determined that an item belongs to an alien containment... then the `prisonType` attribute kicks in and says to which particular alien containment facility should it go.
But that is not how it works, apparently. Regardless of the flag setting the units die if no facility with 'prisonType: 0' exists:

Code: [Select]
  - type: STR_CYBERWEB_ROBOSPHERE_TERRORIST
    categories: [STR_HUMAN_TECH, STR_ROBOTS]
    size: 0.0
    recover: true
    costSell: 50000
    listOrder: 144710

dies during recovery when no alien containment exists.

Code: [Select]
  - type: STR_CYBERWEB_ROBOSPHERE_TERRORIST
    categories: [STR_HUMAN_TECH, STR_ROBOTS]
    size: 0.0
    recover: true
    costSell: 50000
    listOrder: 144710
    liveAlien: false

also dies.

Hence my question regarding the proper way to define a recoverable alien unit/item that does not require a prison type.

Addendum to this:
The only way to recover them is to also set an existing (i.e. already built) prison type:
Code: [Select]
  - type: STR_CYBERWEB_ROBOTURRET_TERRORIST
    categories: [STR_HUMAN_TECH, STR_ROBOTS]
    size: 0.0
    recover: true
    costSell: 20000
    listOrder: 144720
    liveAlien: false
    prisonType: 1

Recovers correctly if a 'prisonType: 1' facility exists at any base.
« Last Edit: April 26, 2021, 05:41:43 pm by krautbernd »

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 10099
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: OXCE (OpenXcom Extended) main thread
« Reply #789 on: April 26, 2021, 05:50:50 pm »
Actually I want to add prison type 4 (robots), but put it on general stores, so you don't need yet another building.

Offline krautbernd

  • Commander
  • *****
  • Posts: 749
    • View Profile
Re: OXCE (OpenXcom Extended) main thread
« Reply #790 on: April 26, 2021, 05:56:33 pm »
Actually I want to add prison type 4 (robots), but put it on general stores, so you don't need yet another building.
Isn't the issue that the flag does not work correctly? Setting 'liveAlien: false' should enable players to recover them as items.

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 10099
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: OXCE (OpenXcom Extended) main thread
« Reply #791 on: April 26, 2021, 07:38:06 pm »
Isn't the issue that the flag does not work correctly? Setting 'liveAlien: false' should enable players to recover them as items.

Even if, I'd rather do this the "proper" way. :)

Offline Meridian

  • Global Moderator
  • Commander
  • ***
  • Posts: 6793
  • OXCE developer
    • View Profile
    • My Wiki
Re: OXCE (OpenXcom Extended) main thread
« Reply #792 on: April 26, 2021, 07:46:43 pm »
But that is not how it works, apparently. Regardless of the flag setting the units die if no facility with 'prisonType: 0' exists:

If everything is right, you get a live alien item.
If anything is wrong, you get a corpse item.

Hence my question regarding the proper way to define a recoverable alien unit/item that does not require a prison type.

All recoverable units need a liveAlien flag and optionally a prisonType (defaults to 0 if not defined).
Same as in OXC.
There is no such thing as "without a prison type"... that's simply not a thing.
Ask differently if you think I didn't understand the question... but the only answer to "can I have an item without a prison type" is "does not compute".

If you want to recover something completely else than a unit, there are (several) other ways how to do it.

Offline krautbernd

  • Commander
  • *****
  • Posts: 749
    • View Profile
Re: OXCE (OpenXcom Extended) main thread
« Reply #793 on: April 28, 2021, 12:10:35 am »
I think my confusion stems from this:
Stuff with `liveAlien: false` goes into stores.
Stuff with `liveAlien: true` goes into alien containment.
Nothing else depends on this flag.
This is its only purpose, by design.

Once it has been determined that an item belongs to an alien containment... then the `prisonType` attribute kicks in and says to which particular alien containment facility should it go.

From what I can tell the first thing that is checked is the prison type and whether a facility with that type exist - if it does not then a corpseItem is recovered, regardless of the 'liveAlien' flag. The flag only comes into play if a corresponding prison type exists - then it is used to dertermine if the recovered item counts towards alien containment.

Offline Meridian

  • Global Moderator
  • Commander
  • ***
  • Posts: 6793
  • OXCE developer
    • View Profile
    • My Wiki
Re: OXCE (OpenXcom Extended) main thread
« Reply #794 on: April 28, 2021, 10:40:04 am »
On some places the flag is checked first, the prison type second. For example here, if you need a proof: https://github.com/MeridianOXC/OpenXcom/blob/oxce-plus/src/Battlescape/DebriefingState.cpp#L2519
On other places the prison type is checked first, the flag second.

In both cases the outcome is the same.
See diagrams for both cases as visual explanation.

If both conditions are satisfied (regardless of the order in which they are checked), you get a prisoner... otherwise (if any condition is not satisfied), you don't get a prisoner.

« Last Edit: April 28, 2021, 10:54:31 am by Meridian »