OpenXcom Forum

Modding => OpenXcom Extended => Topic started by: Finnik on April 08, 2019, 01:07:25 pm

Title: [DONE][Suggestion] Additional item trigger for mission scripts
Post by: Finnik on April 08, 2019, 01:07:25 pm
I think it could be very useful for modders to have an additional option in mission script to check if the player has specified item. The script will check if the player has listed items and if conditions are met, it will run mission. Probably, syntax could look like that:

Code: [Select]
missionScripts:
  - type: treasureHunting
    missionWeights:
      0:
        STR_TREASURE_HUNTING: 100
    executionOdds: 100
    itemDependency:
      - item: STR_TREASURE_MAP
        needed: true #default is true
      - item: STR_TREASURE_CHEST
        needed: false #that means if already has an item, mission will not spawn
Title: Re: [SUGGESTION] Additional item trigger for mission scripts
Post by: Solarius Scorch on April 08, 2019, 01:16:18 pm
I support this idea. It can be used in a variety of ways, for example having a commander in your base could provoke additional retaliations, as the aliens try to recover them. Or it would prevent missions from spawning if you already have the item they're meant to give you.
Title: Re: [SUGGESTION] Additional item trigger for mission scripts
Post by: krautbernd on April 08, 2019, 01:16:57 pm
This carries the risk that important items are sold, lost or destroyed and might not be recoverable. It's already possible to tie missions to research triggers and unlock research topics via completed missions. While i can see this having a niche use, somebody who actually knows the ins and outs of mission design should have look at this.
Title: Re: [SUGGESTION] Additional item trigger for mission scripts
Post by: Finnik on April 08, 2019, 01:27:05 pm
Its not ment to be instead research triggers, it should add extra flexability to mission desighn when you are speaking of somethin rare and special, but ment to be repeatable, so cant be configured with research triggers
Title: Re: [SUGGESTION] Additional item trigger for mission scripts
Post by: Solarius Scorch on April 08, 2019, 02:08:16 pm
If you lose the item, them the mission starts spawning again.
Title: Re: [SUGGESTION] Additional item trigger for mission scripts
Post by: Finnik on April 08, 2019, 02:16:30 pm
or vice versa if so intended  ;)
Title: Re: [SUGGESTION] Additional item trigger for mission scripts
Post by: krautbernd on April 08, 2019, 02:56:45 pm
As long as we are discussing additional triggers for mission sapwns, can we also implement a way to tie base functions to missions? Like building scanner/radar base modules to enable certain missions? Or building a 'support/hangar' module to enable underwater missions?

Title: Re: [SUGGESTION] Additional item trigger for mission scripts
Post by: Nord on April 08, 2019, 03:18:38 pm
As long as we are discussing additional triggers for mission sapwns, can we also implement a way to tie base functions to missions? Like building scanner/radar base modules to enable certain missions? Or building a 'support/hangar' module to enable underwater missions?
It can be done allready by specific research, allowed by facility special function.
Title: Re: [SUGGESTION] Additional item trigger for mission scripts
Post by: krautbernd on April 08, 2019, 04:44:55 pm
It can be done allready by specific research, allowed by facility special function.

No, it can't be ->

It's already possible to tie missions to research triggers and unlock research topics via completed missions. While i can see this having a niche use, somebody who actually knows the ins and outs of mission design should have look at this.
Its not ment to be instead research triggers, it should add extra flexability to mission desighn when you are speaking of somethin rare and special, but ment to be repeatable, so cant be configured with research triggers

You can't enable/disable research triggers in the same way you'd be able to with items or base functions.
Title: Re: [DONE][Suggestion] Additional item trigger for mission scripts
Post by: Meridian on September 18, 2019, 08:24:32 pm
Done.

Code: [Select]
missionScripts:
  - type: treasureHunting
...
    itemTriggers:
       STR_TREASURE_MAP: true
       STR_TREASURE_CHEST: false

Items considered are ONLY items directly in base stores.

Not considered are:
1. weapons, ammo, vehicles and items in crafts
2. items in transfer
3. weapons, ammo, vehicles and items in crafts in transfer
4. items worn by soldiers (armor)
5. items being researched
6. potential manufacture refunds
7. potential facility dismantle refunds
8. anything else I forgot

And as a bonus, there is also a possibility to define minimum and maximum required score (from the previous month), similar to how the difficulty constraint works.
The score constraint is NOT checked at the beginning of the game (before first month).

Code: [Select]
missionScripts:
  - type: xxx
...
    minScore: -1000
    maxScore: 200

Test build: https://lxnt.wtf/oxem/builds//Extended/Extended-5.6.4-4e8202a0f-2019-09-18-win32.7z

EDIT: there is also a possibility to define minimum and maximum required funds (from the current month, i.e. after monthly rating), similar to how the difficulty constraint works.
The funds constraint is NOT checked at the beginning of the game (before first month).

Code: [Select]
missionScripts:
  - type: xxx
...
    minFunds: -1000
    maxFunds: 200
Title: Re: [DONE][Suggestion] Additional item trigger for mission scripts
Post by: Meridian on May 14, 2020, 08:06:52 pm
Added one more attribute (in OXCE v6.5).
Similar to research and item triggers, there are base facility triggers.

Code: [Select]
missionScripts:
  - type: xxx
...
    facilityTriggers:
       STR_FACILITY1: true
       STR_FACILITY2: false

Facilities from all bases are considered.