OpenXcom Forum

Modding => OpenXcom Extended => OXCE Suggestions DONE => Topic started by: Meridian on March 26, 2016, 08:18:48 pm

Title: [DONE] [Suggestion] Starting conditions, environmental effects
Post by: Meridian on March 26, 2016, 08:18:48 pm
So, I will start soon with the "enviros" feature requested by Solarius and Dioxine.
(more initial info in this thread: https://openxcom.org/forum/index.php/topic,4187.msg58871.html#msg58871)

This is an example of how the ruleset could look like:

<removed... see next post>

Let me know if there is something obviously wrong there...
Title: Re: Starting conditions (was: Enviros)
Post by: Meridian on March 29, 2016, 03:23:00 pm
Something WAS obviously wrong ;)

After a discussion on IRC, it became clear that they are not interested in environmental conditions/restrictions at all... just in starting conditions/restriction. After the mission begins, there are no more restrictions/conditions.

I reworked the ruleset and also added some more clarification text.
Here it is:

Code: [Select]
alienDeployments:
  - type: STR_JACKIE_CHAN_MISSION
    startingCondition: STR_PISTOLS_AND_ARMANI_SUITS_ON_JETBIKE_ONLY
...
startingConditions:
  - type: STR_PISTOLS_AND_ARMANI_SUITS_ON_JETBIKE_ONLY
# temporarily (for the duration of the mission) replace left-side armor with right-side armor
# motivation:
#   for example replace helmetless variants with the ones including helmets
    armorTransformations:
      STR_TAC_ARMOR_UC: STR_PERSONAL_ARMOR_UC
# temporarily (for the duration of the mission) replace any unsupported armor with default armor
# motivation:
#   for example if you want to allow only "MiB suits", don't allow anything and set "MiB suit" as default armor
    defaultArmor:
      STR_SOLDIER: STR_NURSE_OUTFIT_UC
# if this is not empty, only armors listed here are allowed
# other armors will be temporarily replaced by default armor
# after a mission:
#   - surviving soldiers will change to their original armor again
#   - armor from dead soldiers will NOT be lost (i.e. will be recovered as item)
    allowedArmors:
      - STR_NONE_UC
      - STR_RUNT_OUTFIT_UC
      - STR_NURSE_OUTFIT_UC
# if this is not empty, only items listed here are available at the start of the mission (in equip phase)
# other items will be "sent back to base"
# when the craft returns to base, it will re-equip original items automatically
# IMPORTANT: if you find any other items during the mission, you *CAN* use them without restrictions
    allowedItems:
      - STR_OLD_PISTOL
      - STR_OLD_PISTOL_CLIP
      - STR_SHORT_SWORD
      - STR_ELECTRO_FLARE
# if this is not empty, only craft listed here are allowed to go to such missions
# check is done already when selecting a target:
#   - if the target's starting condition is not compatible, you CANNOT send such craft there at all
    allowedCraft:
      - STR_JETBIKE

Or vanilla test sample:

Code: [Select]
alienDeployments:
  - type: STR_MEDIUM_SCOUT
    startingCondition: STR_TEST
  - type: STR_TERROR_MISSION
    startingCondition: STR_TEST
  - type: STR_ALIEN_BASE_ASSAULT
    startingCondition: STR_TEST
startingConditions:
  - type: STR_TEST
    armorTransformations:
      STR_FLYING_SUIT_UC: STR_POWER_SUIT_UC
    defaultArmor:
      STR_SOLDIER: STR_NONE_UC
    allowedArmors:
      - STR_NONE_UC
      - STR_POWER_SUIT_UC
    allowedItems:
      - STR_PISTOL
      - STR_PISTOL_CLIP
      - STR_LASER_PISTOL
      - STR_ELECTRO_FLARE
    allowedItemCategories:
      - STR_MELEE_CATEGORY
    allowedCraft:
      - STR_SKYRANGER

Changes:
 - some renaming of attributes to better describe the requirement/functionality
 - removed all negative clauses
     * i.e. you can't say anymore "allow everything except for blaster launchers", you must specify all allowed items/armor/craft explicitly
 - now also clips and other ammunition must be explicitly enabled/disabled... before only weapons were necessary

Meridian

EDIT: added allowedItemCategories
Title: Re: Starting conditions (was: Enviros)
Post by: Solarius Scorch on March 29, 2016, 05:13:20 pm
Yes, I like this!

One question, probably a stupid one: if I set STR_POWER_SUIT to be replace with STR_SHORT_SHORTS, and a soldier wearing STR_SHORT_SHORTS dies, what will be recovered from the body? I expect it to be STR_POWER_SUIT, but I thought I'd ask. :)

BTW would you accept if I credit you as a mod co-author? You've put so much good work into this. OTOH your code can be used by many mods, so I'm not sure if it's OK, but I'm inclined to do so anyway.
Title: Re: Starting conditions (was: Enviros)
Post by: Meridian on March 29, 2016, 05:43:22 pm
One question, probably a stupid one: if I set STR_POWER_SUIT to be replace with STR_SHORT_SHORTS, and a soldier wearing STR_SHORT_SHORTS dies, what will be recovered from the body? I expect it to be STR_POWER_SUIT, but I thought I'd ask. :)

That one is easy, STR_POWER_SUIT will be recovered.
STR_SHORT_SHORTS will perish... just like every other automagically summoned piece of armor.


More interesting is, when you:
- replace A with B
- default is C
- A is not supported
- B is supported (I will probably add it to supported even if it isn't... it makes no sense for it not to be supported)

In this case, the transformation takes place first... not the default armor clause.
So soldier will wear armor B and keep armor A in the craft.
If he dies, armor A will be recovered.

BTW would you accept if I credit you as a mod co-author? You've put so much good work into this. OTOH your code can be used by many mods, so I'm not sure if it's OK, but I'm inclined to do so anyway.

Sure, go ahead.
If you need a better reason, I can produce a few lines of ruleset code for you once you release an alpha... speaking of which... any ETA?
Title: Re: Starting conditions (was: Enviros)
Post by: Solarius Scorch on March 29, 2016, 06:37:27 pm
Thanks for the answer.

ETA? I'm hoping to release a 0.1 version in a month or two, but it will be very incomplete.
I'm going to do it in "arcs", the first two arcs being early cults (already mostly done) and monster hunting (done). I'll release 0.1 when I'm done, as a demo of sorts (but a pretty big demo). They we'll get to deeper layers of conspiracy, drama and shameless shoutouts.
Title: Re: Starting conditions (was: Enviros)
Post by: yrizoud on March 29, 2016, 08:41:49 pm
And then a prequel! Then a reboot! Don't forget the tie-in merchandise!
Title: Re: Starting conditions (was: Enviros)
Post by: Solarius Scorch on March 30, 2016, 10:53:58 am
And then a prequel! Then a reboot! Don't forget the tie-in merchandise!

With time. I'm not a modern-type entertainment company and the actual product comes first. :P

Meridian, what's ETA on the enviros? Can I assume it'll be done in a month or so?
Title: Re: Starting conditions (was: Enviros)
Post by: Meridian on March 30, 2016, 10:55:16 am
With time. I'm not a modern-type entertainment company and the actual product comes first. :P

Meridian, what's ETA on the enviros? Can I assume it'll be done in a month or so?

It will be done this week.
Title: Re: Starting conditions (was: Enviros)
Post by: Meridian on April 01, 2016, 08:32:52 pm
Done.
Download available at usual location.

PS: there's about 741.6 billion combinations to test, I tested about 20-30... help with testing would be appreciated.
Title: Re: Starting conditions (was: Enviros)
Post by: Meridian on April 03, 2016, 12:08:16 pm
Added support for vehicles, e.g.

Code: [Select]
startingConditions:
  - type: STR_TEST
    allowedVehicles:
      - STR_NONE

Specifying the vehicle is enough, no need to enable/disable its ammo.
Title: Re: Starting conditions (was: Enviros)
Post by: Solarius Scorch on April 09, 2016, 01:02:38 pm
Sorry, how do I restrict HWPs from being used in a given startingCondition? I recall it was being discussed, but can't find it.
(Omitting them from allowedItems doesn't work.)
Title: Re: Starting conditions (was: Enviros)
Post by: Meridian on April 09, 2016, 03:58:27 pm
Sorry, how do I restrict HWPs from being used in a given startingCondition? I recall it was being discussed, but can't find it.
(Omitting them from allowedItems doesn't work.)

It's literally one post above yours.
Title: Re: Starting conditions (was: Enviros)
Post by: Eddie on April 09, 2016, 04:20:59 pm
Correct me if I'm wrong, but I think these starting conditions can be used to finally have different loadouts for TFTD land/water missions. For example when on land, replace all jet harpoons with rifles and replace diving suit with coverall.
Title: Re: Starting conditions (was: Enviros)
Post by: Solarius Scorch on April 09, 2016, 04:29:40 pm
It's literally one post above yours.

....sorry, I.m sick and dazed. :/

Correct me if I'm wrong, but I think these starting conditions can be used to finally have different loadouts for TFTD land/water missions. For example when on land, replace all jet harpoons with rifles and replace diving suit with coverall.

I think it's possible to replicate TFTD terrors and such. But you can't specify different enviros for a UFO that crashed/landed on land and one that crashed/landed underwater, because they have the same deployments.
Title: Re: Starting conditions (was: Enviros)
Post by: Dioxine on April 09, 2016, 05:07:02 pm
Maybe there could be a workaround - like switching 'impossible to engage overland' flag for said Aqua ufos (USOs) :)
Title: Re: Starting conditions (was: Enviros)
Post by: Eddie on April 09, 2016, 05:13:55 pm
I think it's possible to replicate TFTD terrors and such. But you can't specify different enviros for a UFO that crashed/landed on land and one that crashed/landed underwater, because they have the same deployments.

I was thinking for a game of TFTD, you can finally have replacement weapons when fighting on land. Not for a Piratez game. In TFTD all terrormissions are on land while all USO assaults are underwater so mission specific variable can be used to good effect.
Title: Re: Starting conditions (was: Enviros)
Post by: Eddie on April 25, 2016, 10:02:27 pm
So I want to make a mod for TFTD that replaces the underwater weapons with the corresponding xcom:eu weapons for terror missions. I've seen there is the parameter "armorTransformations" which I will use to replace diving suits with coveralls. Is there also a "itemTransformations" that I can use to replace jet harpoons with rifles?
Title: Re: Starting conditions (was: Enviros)
Post by: Dioxine on April 26, 2016, 05:44:42 pm
Just add rifles normally and prohibit their use underwater.
Title: Re: Starting conditions (was: Enviros)
Post by: Eddie on April 26, 2016, 10:38:18 pm
Yes, that works. But I thought it would be neat if you didn't have to reequip your squad and weapons just got swapped.
Title: Re: Starting conditions (was: Enviros)
Post by: Dioxine on April 27, 2016, 10:09:39 am
Personally I'd rather prefer to re-equip than have my loadouts swapped for some random stuff... But that might be just me.
Title: Re: Starting conditions (was: Enviros)
Post by: legionof1 on April 27, 2016, 10:23:35 am
I wouldn't mind a swapout if it was dynamic to your tech level. Just let player know it will happen that way beforehand. Unexplained stuff yeilds oh so much whingeing for the most miniscule shit.
Title: Re: Starting conditions (was: Enviros)
Post by: Meridian on May 20, 2016, 12:24:21 pm
Added support for allowed item categories:

E.g.
Code: [Select]
    allowedItemCategories:
      - STR_BAT_CAT_INFILTRATION

If both allowed items and allowed item categories are empty, everything is allowed.
If any of them is not empty, both are checked: an item is allowed either if it is enabled explicitly or if it is enabled via its category.
Title: Re: Starting conditions (was: Enviros)
Post by: Solarius Scorch on June 12, 2016, 03:21:05 pm
Meridian, I'm trying to figure out how to do this and I would like to hear your opinion.

Some missions in X-Com Files will take place underwater, using Starting Conditions. However, the problem is that a normal craft doesn't really belong to a see bottom. So I want to use this:

(https://i.imgur.com/2D0gRAv.gif)
(courtesy of Dioxine)

What do you think I should do?

Option 1: Making it a normal craft.
It's the simple way to go, but I don't like it: what would stop you from using it for normal missions? It'd be silly.

Option 2: Enforcing this craft on land.
This would give much better results, but would require some coding on your part. (Yes, this is sort of stealth request from me, sorry!) It simulates going to the mission site normally, then using the submarine to submerge.
There are generally two ways I can think of to achieve this:
a) Use an analogue of this code used for UFOs in mapScripts:
Code: [Select]
    - type: addUFO
      UFOName: STR_UFONAME
Only change addUFO to addCraft. This would effectively override your craft with this.
b) Enable switching craft with startingConditions, just like you switch armours. If you land in water, your normal craft is switched to the submarine.

Please tell me if you can help or if you have any alternate ideas.
Title: Re: Starting conditions (was: Enviros)
Post by: Dioxine on June 12, 2016, 03:27:12 pm
You don't need that. You can simply add this craft as a mapblock for your undersea map (with undersea ground added around it), with tiles that enable X-Com unit spawn (or spawn points for x-com soldiers, but the previous option is IMO better in this case, especially since it allows retreat). This works exactly like Alien Base Assault: no craft is spawned, but xcom soldiers are spawned on a special mapblock.
Title: Re: Starting conditions (was: Enviros)
Post by: Solarius Scorch on June 12, 2016, 03:29:43 pm
You don't need that. You can simply add this craft as a mapblock for your undersea map (with undersea ground added around it), with tiles that enable X-Com unit spawn (or spawn points for x-com soldiers, but the previous option is IMO better in this case, especially since it allows retreat). This works exactly like Alien Base Assault: no craft is spawned, but xcom soldiers are spawned on a special mapblock.

Hmm, you're right. But every time I tried this before I couldn't force the game to accept this block as a valid exit area - no matter what I did to the .mcds, the .rmps and the ruleset, my people would not evacuate if mission is aborted.
Title: Re: Starting conditions (was: Enviros)
Post by: Dioxine on June 12, 2016, 03:32:41 pm
You need a floor tile with special flag:59 set to 1 (X-Com Craft).
Title: Re: Starting conditions (was: Enviros)
Post by: Solarius Scorch on June 12, 2016, 03:38:25 pm
You need a floor tile with special flag:59 set to 1 (X-Com Craft).

Indeed it works! I swear it didn't before, I thought of that.
But still, this doesn't really solve my problem. The sub in question is composed of completely different tilesets than the terrain, I can't combine these and stay within the limit. (Plus I'd have to build the sub from scratch for every terrain.)
But the mechanics work for a simple grid I added to the terrain. If we can't have any viable way to add the sub, I'll forego it, at least for now. But it would be such a shame.
Title: Re: Starting conditions (was: Enviros)
Post by: Meridian on June 12, 2016, 09:45:20 pm
So, is this still a request or not?

And if yes, can you give some foolproof examples of what you want to allow and what you want to disable?

I somehow got lost in the descriptions above...
Title: Re: Starting conditions (was: Enviros)
Post by: Solarius Scorch on June 12, 2016, 10:03:00 pm
So, is this still a request or not?

Yes it is, the solution Dioxine suggested is temporary as it doesn't really allow swapping vehicles.

And if yes, can you give some foolproof examples of what you want to allow and what you want to disable?

I somehow got lost in the descriptions above...

Well, there are two options, please consider which is easier:

Option 1) Enable this formula in the mapScripts:

Code: [Select]
    - type: addCraft
      craftName: STR_SUBMARINE

Just like it works for UFOs with the addUFO command.

Option 2) Allow swapping the landed craft according to enviros, exactly like armours now:

Code: [Select]
startingConditions:
  - type: STR_UNDERWATER_GEAR
    craftTransformations:
      STR_SKYRANGER: STR_SUBMARINE

Either of these would work for me, but I think the second option (with startingConditions) would be more useful in general.
Title: Re: Starting conditions (was: Enviros)
Post by: Meridian on June 12, 2016, 10:18:25 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?

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?
Title: Re: Starting conditions (was: Enviros)
Post by: Solarius Scorch 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.
Title: Re: Starting conditions (was: Enviros)
Post by: Meridian 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.
Title: Re: Starting conditions (was: Enviros)
Post by: Solarius Scorch 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.
Title: Re: Starting conditions (was: Enviros)
Post by: Meridian 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.
Title: Re: Starting conditions (was: Enviros)
Post by: Solarius Scorch 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!
Title: Re: Starting conditions (was: Enviros)
Post by: Meridian 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
It's done. May the (Star) Gods spare my soul from eternal damnation.
Title: Re: Starting conditions (was: Enviros)
Post by: Solarius Scorch on June 17, 2016, 05:59:30 pm
I am forever indebted to you. ^^
Title: Re: Starting conditions (was: Enviros)
Post by: Meridian 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.
Title: Re: Starting conditions (was: Enviros)
Post by: Solarius Scorch on June 18, 2016, 02:38:30 pm
Everything works great!
Thanks for making my mod better. (Piratez will probably use it too.)
Title: Re: Starting conditions (was: Enviros)
Post by: Roxis231 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
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
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.
Title: Re: Starting conditions (was: Enviros)
Post by: Meridian 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
Title: Re: Starting conditions (was: Enviros)
Post by: Meridian 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.
Title: Re: Starting conditions (was: Enviros)
Post by: Meridian 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
Title: Re: [DONE] [Suggestion] Starting conditions, environmental effects
Post by: Meridian 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...
Title: Re: [DONE] [Suggestion] Starting conditions, environmental effects
Post by: Meridian 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.)
Title: Re: Starting conditions (was: Enviros)
Post by: Meridian on August 22, 2022, 09:17:17 pm
Yes it is, the solution Dioxine suggested is temporary as it doesn't really allow swapping vehicles.

Well, there are two options, please consider which is easier:

Option 1) Enable this formula in the mapScripts:

Code: [Select]
    - type: addCraft
      craftName: STR_SUBMARINE

Just like it works for UFOs with the addUFO command.

Option 2) Allow swapping the landed craft according to enviros, exactly like armours now:

Code: [Select]
startingConditions:
  - type: STR_UNDERWATER_GEAR
    craftTransformations:
      STR_SKYRANGER: STR_SUBMARINE

Either of these would work for me, but I think the second option (with startingConditions) would be more useful in general.

Option 2 now added.

If both options are defined, option 2 has priority over option 1.
Title: Re: [DONE] [Suggestion] Starting conditions, environmental effects
Post by: Solarius Scorch on August 22, 2022, 10:04:31 pm
Thank you! I can't express my joy well enough. :)
Title: Re: Starting conditions (was: Enviros)
Post by: zee_ra on April 10, 2023, 10:40:51 am
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

Is there a way to have an agent removed if a desired armor type is not available for him in the inventory?  A possible case is to require diving suits to be in inventory before they could be used in an underwater mission.
Title: Re: Starting conditions (was: Enviros)
Post by: Meridian on April 10, 2023, 11:09:27 am
Is there a way to have an agent removed if a desired armor type is not available for him in the inventory?  A possible case is to require diving suits to be in inventory before they could be used in an underwater mission.

For the start of the mission, no.
If the armor is not allowed, it will be replaced by a default armor.

For later stages of a multi-stage mission, yes: https://openxcom.org/forum/index.php/topic,10194.msg149818.html#msg149818