Author Topic: [SUGGESTION] YS tags instead of researches as campaign progression  (Read 2723 times)

Offline Finnik

  • Commander
  • *****
  • Posts: 508
  • Finnik#0257
    • View Profile
Probably, I can also rise another topic:
Currently, modders widely use researches as a progression triggers, very decent amount of researches in many mods are never shown to the player. It's being supported by devs with a very wide API, where you can add research as discovered at the background with arcs, events, deployments. They are used as triggers for arc/event/mission scripts to run campaign logic. We can get researches in YS, which is awesome, and we can disable research. We can interrupt ongoing missions and events with research being discovered. For many cases, it is enough, but I would like to know if that is the desired way for OXCE and you guys would like to keep expanding it.

For instance, I've looked into UFO:AL, they use LUA scripts to process campaign logic. In OXCE we have YS, that already has tags in SaveGame. There we can have any variable in form of integer or string value, not just boolean (is this research discovered?). I had cases where I was needed integer value for mission triggers, and I had to solve it with multiple copies of research and scripts. Also, we are limited to setting trigger variable (research) to false, as we can't set it back to true (disabled researches cant be discovered in any way) I can see it is not a small task and would require to add hooks for, many places where we check or discover/disable researches, but with this we would get a much more flexible system.

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9105
    • View Profile
Re: [SUGGESTION] YS tags instead of researches as campaign progression
« Reply #1 on: December 29, 2021, 11:14:54 pm »
For many cases, it is enough, but I would like to know if that is the desired way for OXCE and you guys would like to keep expanding it.

There is no desired way or master plan.
I look at requests as they come and enhance OXCE as needed, step by step.

What I can say is that existing features will not be removed, because that would break existing mods.
So no, I won't be replacing researches with YS tags... but maybe we could use both, if there is a good use case.

disabled researches cant be discovered in any way

Disabled researches can be re-enabled.

Offline Finnik

  • Commander
  • *****
  • Posts: 508
  • Finnik#0257
    • View Profile
Re: [SUGGESTION] YS tags instead of researches as campaign progression
« Reply #2 on: December 29, 2021, 11:27:30 pm »
Oh, OFC I do not suggest remove features, it would break everything. This should be backward-compatible!

maybe we could use both, if there is a good use case.

How about this case - you have an array of missions (say, five missions) and when you complete 3 of them you will get aces to further missions or some events spawn. It's easy to do that with integer variable, but very hard with current research logic...

Disabled researches can be re-enabled.

Really? Looks like I've missed that. I remembered you said it can't be. Well, that's good.

Online Yankes

  • Global Moderator
  • Commander
  • *****
  • Posts: 3350
    • View Profile
Re: [SUGGESTION] YS tags instead of researches as campaign progression
« Reply #3 on: December 30, 2021, 07:10:02 pm »
Overall this request is bit moot. First of all when we have script that could alter this logic,
they will work based on current system as they are extension not replacement.
And if we have script then it can in realty use any data that game have, like number of soldier or items in storage.
Using its own tags is simply special case of that.

Beside alien mission have its own counters that will be probably exposed, and is very probably script will have direct access to them,
using them will be lot more robust as there is already lot of logic linked to them.

Offline Finnik

  • Commander
  • *****
  • Posts: 508
  • Finnik#0257
    • View Profile
Re: [SUGGESTION] YS tags instead of researches as campaign progression
« Reply #4 on: December 30, 2021, 08:53:34 pm »
Well, I agree that YS should not change geoscape data directly from scripts, that are not related to the game entity, that calls the script. Here is some example case I can imagine:

We call `SavedGame::addFinishedResearch()` because, for example, we discover it manually on the base. In the end of the method, we call scripts from the hook. We can define some tags for the `research` entity, and the script reads the tags from it. In this particular research project, we do have the tag that has scripted logic to update geoscape tag, that would be saved (say, geoscapeTag += 1).
Then, mission script being processed, and in the end of the decision if all its conditions are happy it should run scripts from own hook. The script loads tags from `missionScripts` entity, and can access to geoscape tags. For instance, it gets our geoscapeTag and checks if it is > 5. If true, it returns false, so it prevents the mission from spawning.

Otherwise, I'm not sure what is the purpose of tags in the end of geoscape game save file...


Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9105
    • View Profile
Re: [SUGGESTION] YS tags instead of researches as campaign progression
« Reply #5 on: December 31, 2021, 10:22:05 am »
Really? Looks like I've missed that. I remembered you said it can't be. Well, that's good.

It was added by your request (from Discord, November 29th 2020)

Offline Finnik

  • Commander
  • *****
  • Posts: 508
  • Finnik#0257
    • View Profile
Re: [SUGGESTION] YS tags instead of researches as campaign progression
« Reply #6 on: December 31, 2021, 10:29:22 am »
Oh, thanks. I had some break from modding/coding, so I think I missed that...