Author Topic: [DONE] [Suggestion] Starting conditions, environmental effects  (Read 33596 times)

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11775
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: Starting conditions (was: Enviros)
« Reply #30 on: June 12, 2016, 11:04:09 pm »
Hmm, sounds easy, but I can already see 7 billion problems I'll encounter.

Isn't it easier just to disallow Skyranger to "land on water"? Can probably even be done with current ruleset, much like some ships can't go too deep? Or am I simplifying it?

I think it'd be fine, but how would you restrict the submarine from landing in normal terrain? Except for making all missions in the game use some special enviro, but this doesn't sound right to me.

And not to be mean or anything... but you're giving me solutions already... too early for that ... I'd like to hear the requirement first if possible... what are you trying to achieve?

Sorry, It's just the way I think when modding. :)
OK, so let's put in simple words. This is how this is supposed to work:

Some of my missions take place underwater, in oceans. I can go to such a place with one of my normal craft, like the Skyranger. Once the mission starts, my troops start inside a submarine, not the Skyranger. (It is assumed X-Com has this sort of stuff somewhere and can bring it to the site for use in a mission.) I can retreat to the submarine and abort. When the mission ends, I return to base with the same craft I came on.
If the submarine has less space than there are people, some of them do not spawn.

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9136
    • View Profile
Re: Starting conditions (was: Enviros)
« Reply #31 on: June 14, 2016, 02:05:59 pm »
Some of my missions take place underwater, in oceans. I can go to such a place with one of my normal craft, like the Skyranger. Once the mission starts, my troops start inside a submarine, not the Skyranger. (It is assumed X-Com has this sort of stuff somewhere and can bring it to the site for use in a mission.) I can retreat to the submarine and abort. When the mission ends, I return to base with the same craft I came on.
If the submarine has less space than there are people, some of them do not spawn.

OK, understood.

Questions:

1. how did you implement the underwater missions? Is it something like in TFTD or just some hack? Are they USO landing/crash sites or are they spawned mission sites?

2. if you didn't just somehow hack it... wouldn't it make more sense that you cannot send a Skyranger to such a mission (on water) at all, but you must send a different craft (e.g. Triton) instead? Implementing a check if a craft can go to certain places or not will be MUCH easier than the other options.

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11775
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: Starting conditions (was: Enviros)
« Reply #32 on: June 14, 2016, 03:07:10 pm »
1. how did you implement the underwater missions? Is it something like in TFTD or just some hack? Are they USO landing/crash sites or are they spawned mission sites?

It was a hack of course. :) Spawned mission sites with special enviro STR_UNDERWATER.
If you want to examine the mod yourself, I just released it: https://openxcom.org/forum/index.php/topic,4595.0.html

2. if you didn't just somehow hack it... wouldn't it make more sense that you cannot send a Skyranger to such a mission (on water) at all, but you must send a different craft (e.g. Triton) instead? Implementing a check if a craft can go to certain places or not will be MUCH easier than the other options.

Yes, but unfortunately it wouldn't really fit the theme. This is still X-Com 1, only with a side arc with underwater missions, so I can't really ask the player to have a Triton at the base. But more importantly, this wouldn't make much sense to have intercontinental underwater craft around year 2000.
If the options are proposed are not possible or too work extensive, I'll stick with the current "exit grid" formula. But I believe it also would be useful for other people.

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9136
    • View Profile
Re: Starting conditions (was: Enviros)
« Reply #33 on: June 14, 2016, 06:06:04 pm »
I'll have a look, but my schedule is currently quite full.
Don't expect anything sooner than in 2-3 weeks.

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11775
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: Starting conditions (was: Enviros)
« Reply #34 on: June 14, 2016, 06:07:40 pm »
I'll have a look, but my schedule is currently quite full.
Don't expect anything sooner than in 2-3 weeks.

Thank you!

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9136
    • View Profile
Re: Starting conditions (was: Enviros)
« Reply #35 on: June 17, 2016, 08:57:40 am »
It looks like I can make some changes to addCraft command to make this "work".

However, it's such an enormous hack, that the grandchildren of my grandchildren's grandchildren will have to be ashamed of that. Not sure if that's what I want to leave behind as my legacy.

EDIT
Spoiler:
It's done. May the (Star) Gods spare my soul from eternal damnation.
« Last Edit: June 17, 2016, 11:03:34 am by Meridian »

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11775
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: Starting conditions (was: Enviros)
« Reply #36 on: June 17, 2016, 05:59:30 pm »
I am forever indebted to you. ^^

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9136
    • View Profile
Re: Starting conditions (was: Enviros)
« Reply #37 on: June 18, 2016, 12:07:19 am »
I am forever indebted to you. ^^

Download here: https://drive.google.com/open?id=0B8itkFQbhj-YU1RmR09fanNhd2c
Syntax exactly as you suggested in option 1.
Soldiers, which won't fit in the replacement craft, won't be available during the mission at all.

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11775
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: Starting conditions (was: Enviros)
« Reply #38 on: June 18, 2016, 02:38:30 pm »
Everything works great!
Thanks for making my mod better. (Piratez will probably use it too.)

Offline Roxis231

  • Colonel
  • ****
  • Posts: 484
  • Catching the feral kitten hiding in my rubish bin
    • View Profile
Re: Starting conditions (was: Enviros)
« Reply #39 on: November 10, 2016, 07:01:39 am »
I've tried to work this into my Alternate Graphics mod - But when it comes up ingame the armours end up becomeing the default ones.

Can someone please check the code and see what I've missed - been looking for six hours straight and still can't see it

Swimsuit
Spoiler:
Code: [Select]
  - type: STR_SWIMSUIT_A_SEA_UC
    spriteSheet: PIR_43.PCK
    spriteInv: MAN_SM1
    customArmorPreviewIndex: 5
    spriteFaceGroup: 6
    spriteFaceColor: [94, 94, 94, 94, 160, 160, 163, 163, 94, 94, 94, 94, 160, 163, 160, 160, 94, 94, 94, 94, 163, 160, 160, 163, 94, 94, 94, 94, 160, 163, 163, 163, 94, 94, 94, 94, 163, 163, 160, 160, 94, 94, 94, 94, 160, 160, 160, 160, 94, 95, 94, 94, 161, 160, 161, 162, 94, 94, 94, 94, 163, 163, 161, 160]
    spriteHairGroup: 9
    spriteHairColor: [224, 17, 246, 36, 38, 208, 246, 246, 36, 246, 246, 16, 16, 150, 150, 246, 178, 160, 160, 163, 38, 18, 246, 52, 246, 16, 37, 196, 161, 224, 224, 37, 16, 246, 17, 230, 86, 245, 246, 80, 34, 80, 16, 16, 246, 244, 198, 35, 38, 246, 144, 18, 246, 246, 246, 80, 80, 162, 130, 144, 224, 246, 82, 181]
    storeItem: TROLLIUM
    movementType: 1
    corpseBattle:
      - STR_CORPSE_SWIMSUIT
    corpseGeo: STR_RAIDER_CORPSE
    personalLight: 20
    stats:
       tu: -5
       reactions: -5
       firing: -10
       melee: -15
       throwing: -10
       bravery: 20
       psiStrength: 4
    visibilityAtDark: 18
    visibilityAtDay: 18
    frontArmor: 20
    sideArmor: 20
    rearArmor: 20
    underArmor: 20
    meleeDodge:
      reactions: 0.4
    meleeDodgeBackPenalty: 0.5
    recovery:
      energy:
        flatHundred: 0.08
        healthCurrent: 0.20
      morale:
        moraleCurrent: -0.2
        bravery: 0.2
      stun:
        flatHundred: -0.12
        healthCurrent: 0.1
        health: -0.05
    damageModifier:
      - 0.3
      - 1.0
      - 0.65
      - 1.5
      - 1.0
      - 0.65
      - 0.8
      - 0.75
      - 1.0
      - 0.0
    builtInWeapons:
      - INV_NULL_4X2_BACK
      - INV_NULL_4X2
      - INV_NULL_1X1_LL
      - INV_NULL_1X1_LS
      - INV_NULL_1X1_RL
      - INV_NULL_1X1_RS
    loftempsSet: [ 2 ]
startingConditions:
  - type: STR_ENVIRO_SEA
    armorTransformations:
      STR_SWIMSUIT_A_UC: STR_SWIMSUIT_A_SEA_UC

Superhero
Spoiler:
Code: [Select]
startingConditions:
  - type: STR_ENVIRO_CYDONIA
    allowedArmors:
      - STR_IRONMAN_ARMOR_A_UC
    armorTransformations:
      STR_IRONMAN_ARMOR_B_UC: STR_IRONMAN_ARMOR_A_UC
      STR_IRONMAN_ARMOR_C_UC: STR_IRONMAN_ARMOR_A_UC

Thanks.

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9136
    • View Profile
Re: Starting conditions (was: Enviros)
« Reply #40 on: January 26, 2017, 09:52:29 pm »
INFO: There will be a breaking change in the next version.

Default armor will be a weighted list, instead of just a single entry:

Old syntax:

Code: [Select]
    defaultArmor:
      STR_SOLDIER: STR_SPACE_SUIT_UC

New syntax:

Code: [Select]
    defaultArmor:
      STR_SOLDIER:
        STR_SPACE_SUIT_UC: 50 # 50% space suit
        STR_ANNIHILATOR_ARMOR_UC: 25 # 25% annihilator suit
        noChange: 25 # 25% to keep whatever you have on

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9136
    • View Profile
Re: Starting conditions (was: Enviros)
« Reply #41 on: January 25, 2018, 12:17:56 pm »
INFO: in the coming OXCE+ version, the following changes will apply:
(attached is also a sample ruleset to test this in TFTD)

StartingConditions support for multi-stage missions

- completely removed "defaultItems" feature (also from 1st stage)
- environmental conditions cannot be applied before the battle anymore (before player's turn 1)
(could cause unforeseen/unhandled situations, endless loops and crashes)

Supported features:
- mapBackgroundColor
- environmentalConditions
- armorTransformations
EDIT: also:
- inventoryShockIndicator
- mapShockIndicator

Other features are supported only for the 1st stage.
« Last Edit: June 25, 2018, 08:45:29 pm by Meridian »

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9136
    • View Profile
Re: Starting conditions (was: Enviros)
« Reply #42 on: June 25, 2018, 03:32:35 pm »
Added more attributes (for shock indicators), see here: https://openxcom.org/forum/index.php/topic,5360.msg98358.html#msg98358

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9136
    • View Profile
Re: [DONE] [Suggestion] Starting conditions, environmental effects
« Reply #43 on: May 19, 2019, 07:47:18 pm »
BREAKING CHANGES in OXCE 5.5

Starting conditions were split into:
- starting conditions: https://www.ufopaedia.org/index.php/Ruleset_Reference_Nightly_(OpenXcom)#Battle_Starting_Conditions
- and enviro effects: https://www.ufopaedia.org/index.php/Ruleset_Reference_Nightly_(OpenXcom)#Battle_Enviro_Effects

Starting conditions are defined on alien deployments only.

Enviro effects are defined on terrains and alien deployments... if both are defined, deployment's enviro effects are used. (Until now it was the other way around)

Added "forbidden" rules as alternative to "allowed" rules, e.g. you can now allow all craft except specific ones.

Added soldier type starting conditions.

All changes described in nightly ruleset reference...
« Last Edit: May 19, 2019, 08:01:27 pm by Meridian »

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9136
    • View Profile
Re: [DONE] [Suggestion] Starting conditions, environmental effects
« Reply #44 on: February 04, 2022, 02:32:15 pm »
Update in OXCE 7.5

Since OXCE v7.5 it will be possible to use armor transformations (under enviro effects) also on HWPs and summoned player units.

At the same time, any armor transformations from a 1x1 armor into a 2x2 armor are now checked and ignored.
(Only transformations into same size armor or smaller size armor are allowed.)