Author Topic: [DONE][Suggestion] Additional item trigger for mission scripts  (Read 577 times)

Offline Finnik

  • Sergeant
  • **
  • Posts: 44
    • View Profile
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
« Last Edit: September 18, 2019, 08:08:56 pm by Meridian »

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 8663
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: [SUGGESTION] Additional item trigger for mission scripts
« Reply #1 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.

Offline krautbernd

  • Colonel
  • ****
  • Posts: 450
    • View Profile
Re: [SUGGESTION] Additional item trigger for mission scripts
« Reply #2 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.

Offline Finnik

  • Sergeant
  • **
  • Posts: 44
    • View Profile
Re: [SUGGESTION] Additional item trigger for mission scripts
« Reply #3 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

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 8663
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: [SUGGESTION] Additional item trigger for mission scripts
« Reply #4 on: April 08, 2019, 02:08:16 pm »
If you lose the item, them the mission starts spawning again.

Offline Finnik

  • Sergeant
  • **
  • Posts: 44
    • View Profile
Re: [SUGGESTION] Additional item trigger for mission scripts
« Reply #5 on: April 08, 2019, 02:16:30 pm »
or vice versa if so intended  ;)

Offline krautbernd

  • Colonel
  • ****
  • Posts: 450
    • View Profile
Re: [SUGGESTION] Additional item trigger for mission scripts
« Reply #6 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?


Offline Nord

  • Commander
  • *****
  • Posts: 881
  • The Gate will open... someday.
    • View Profile
Re: [SUGGESTION] Additional item trigger for mission scripts
« Reply #7 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.

Offline krautbernd

  • Colonel
  • ****
  • Posts: 450
    • View Profile
Re: [SUGGESTION] Additional item trigger for mission scripts
« Reply #8 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.
« Last Edit: April 08, 2019, 04:47:12 pm by krautbernd »

Online Meridian

  • Global Moderator
  • Commander
  • ***
  • Posts: 5255
  • Aaand we're back!
    • View Profile
    • My Wiki
Re: [DONE][Suggestion] Additional item trigger for mission scripts
« Reply #9 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