Author Topic: Mission generation question.  (Read 4710 times)

Offline Nord

  • Commander
  • *****
  • Posts: 912
  • The Gate will open... someday.
    • View Profile
Re: Mission generation question.
« Reply #15 on: January 24, 2017, 10:39:03 am »
One more question: how to force missions to stop spawn only if it was successful? So if you lose - you can try again next month, but if you reach objective (kill all enemys) this mission will not appear anymore.

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 5477
  • Aaand we're back!
    • View Profile
    • My Wiki
Re: Mission generation question.
« Reply #16 on: January 24, 2017, 11:01:22 am »
Exactly as described cannot be done atm.

But you can get near-ish by placing a unique object on the map, which will be recovered when mission is successful.
Afterwards player would research this object, which would stop the mission.

Offline Nord

  • Commander
  • *****
  • Posts: 912
  • The Gate will open... someday.
    • View Profile
Re: Mission generation question.
« Reply #17 on: January 24, 2017, 11:03:30 am »
Afterwards player would research this object, which would stop the mission.
And this research can not be finished automatically, i guess.

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 8840
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: Mission generation question.
« Reply #18 on: January 24, 2017, 12:46:49 pm »
And this research can not be finished automatically, i guess.

Unfortunately, no... I would welcome this feature myself, I had to work around this issue so many times.

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 5477
  • Aaand we're back!
    • View Profile
    • My Wiki
Re: Mission generation question.
« Reply #19 on: January 24, 2017, 01:47:10 pm »
@both: write a feature request that has at least 10 lines and doesn't contain word 'automagically' and we'll see...

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 8840
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: Mission generation question.
« Reply #20 on: January 24, 2017, 06:19:36 pm »
@both: write a feature request that has at least 10 lines and doesn't contain word 'automagically' and we'll see...

Lol, I just wrote a PM to Nord with exactly the same suggestion... :) I'll comment when/if it's ready.

Offline Nord

  • Commander
  • *****
  • Posts: 912
  • The Gate will open... someday.
    • View Profile
Re: Mission generation question.
« Reply #21 on: January 24, 2017, 09:39:32 pm »
Though i am not using OXCE, it might be useful for others.
About "automagical" (nice word, should be remembered) research: Dont know exactly how research code works, but presume each hour check of research status. Easiest way as i see is to check inactive, but available researches, searching zero cost. And if zero cost found - mark research as completed. But if it will slow down system, check can be performed once a day or after tactical mission ends.
 And if not use research - i dont know code, we need some global variable, which will change by winning mission. And command in missionscripts to check it. Maybe "objectivesRequired" from alienDeployements will fit.
Sorry, i just dont know exactly what we have in gamecode, and what we do not have.  :-[

Offline ohartenstein23

  • Commander
  • *****
  • Posts: 1711
  • Flamethrowers fry cyberdisk circuits
    • View Profile
Re: Mission generation question.
« Reply #22 on: January 24, 2017, 10:01:12 pm »
Maybe this could be done by having a definition in alienDeployments to grant a specific research at the end of a mission containing that deployment?  In ruleset, this could look like
Code: [Select]
alienDeployments:
  - type: STR_SOME_DEPLOYMENT
    ...
    unlockedResearch: STR_SOME_RESEARCH
    ...
where the research item defined is treated like it was unlocked by another research item completed the next time midnight rolls around?

Another option that I could see is to add a tag (stopMissionRepeat: true?) to alienDeployments that on completing a mission, it would cause the engine to look for the running mission script/mission table entry that spawned that particular mission and had a second tag on that mission script (stopAfterMissionComplete: true?), and remove it from the table/mark that mission script to stop running.

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 8840
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: Mission generation question.
« Reply #23 on: January 24, 2017, 10:16:06 pm »
I like the alienDeployment option (the former) best. It's clear and in-line with how things work in OXC.

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 5477
  • Aaand we're back!
    • View Profile
    • My Wiki
Re: Mission generation question.
« Reply #24 on: February 16, 2017, 12:20:44 pm »
Implemented: https://openxcom.org/forum/index.php/topic,4187.msg79243.html#msg79243

EDIT:

Gives:
 - topic itself (regardless of any prerequisites/dependencies)
 - score
 - all unlocked zero-cost research (and their score)

Doesn't give:
 - get-one-free bonuses

Does NOT trigger:
 - ufopedia
 - cutscenes
 - we can now research popup
 - we can now manufacture popup
 - we can now buy popup
« Last Edit: March 03, 2017, 02:59:18 pm by Meridian »

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 8840
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: Mission generation question.
« Reply #25 on: February 19, 2017, 01:26:20 am »
One question: if the research has prerequisites (dependencies) which are not met yet, will it also be unlocked? (It should.)

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 5477
  • Aaand we're back!
    • View Profile
    • My Wiki
Re: Mission generation question.
« Reply #26 on: February 19, 2017, 01:36:40 am »
Yes

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 8840
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: Mission generation question.
« Reply #27 on: February 19, 2017, 01:52:52 am »
Thank you!