aliens

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

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9136
    • View Profile
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...
« Last Edit: March 31, 2016, 02:26:02 pm by Meridian »

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9136
    • View Profile
Re: Starting conditions (was: Enviros)
« Reply #1 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
« Last Edit: January 26, 2018, 01:15:37 pm 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 #2 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.

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9136
    • View Profile
Re: Starting conditions (was: Enviros)
« Reply #3 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?

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11775
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: Starting conditions (was: Enviros)
« Reply #4 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.
« Last Edit: March 29, 2016, 06:39:56 pm by Solarius Scorch »

Offline yrizoud

  • Commander
  • *****
  • Posts: 1014
    • View Profile
Re: Starting conditions (was: Enviros)
« Reply #5 on: March 29, 2016, 08:41:49 pm »
And then a prequel! Then a reboot! Don't forget the tie-in merchandise!

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11775
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: Starting conditions (was: Enviros)
« Reply #6 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?

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9136
    • View Profile
Re: Starting conditions (was: Enviros)
« Reply #7 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.

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9136
    • View Profile
Re: Starting conditions (was: Enviros)
« Reply #8 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.

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9136
    • View Profile
Re: Starting conditions (was: Enviros)
« Reply #9 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.

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11775
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: Starting conditions (was: Enviros)
« Reply #10 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.)

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9136
    • View Profile
Re: Starting conditions (was: Enviros)
« Reply #11 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.

Offline Eddie

  • Commander
  • *****
  • Posts: 560
    • View Profile
Re: Starting conditions (was: Enviros)
« Reply #12 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.

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11775
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: Starting conditions (was: Enviros)
« Reply #13 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.

Offline Dioxine

  • Commander
  • *****
  • Posts: 5465
  • punk not dead
    • View Profile
    • Nocturnal Productions
Re: Starting conditions (was: Enviros)
« Reply #14 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) :)