Author Topic: [SUGGESTION] Deployment switch by research  (Read 171 times)

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 9730
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
[SUGGESTION] Deployment switch by research
« on: August 10, 2020, 04:49:04 pm »
I would like to suggest a following feature:


Code: [Select]
  - type: STR_SMALL_SCOUT
    researchSwitch:
      STR_LASER_RIFLE:
        - STR_SMALL_SCOUT_WITH_LASER_RIFLES

STR_SMALL_SCOUT_WITH_LASER_RIFLES is another, separate deployment. If you don't have STR_LASER_RIFLE researched, the deployment is loaded as normal; but if you do, the game uses STR_SMALL_SCOUT_WITH_LASER_RIFLES instead of STR_SMALL_SCOUT.

If a deployment has multiple research switches, like in this case:

Code: [Select]
  - type: STR_SMALL_SCOUT
    researchSwitch:
      STR_LASER_RIFLE:
        - STR_SMALL_SCOUT_LASER_RIFLE
      STR_MEDI_KIT:
        - STR_SMALL_SCOUT_MEDI_KIT

and you have both prerequisites, then the game picks one of these two deployments at random.

The second-level deployment (the one the game uses instead of the basic one, because you have the necessary research) may also have researchSwitch of its own; when used, it forces the game to use yet another deployment. (This would be used to make "tiered" sets: the game normally uses deployment 1, but when you have research X it uses deployment 2, and if you have researches X and Y the game uses deployment 3.)

But what for?
In more story-driven mods, players' decisions are often represented as completing a certain research. Some such decisions may have impact on the battlescape. For example, in XCF you can either share some weapon techs with your allies or not; and if you do, they should use this tech in combat on cooperative missions (which is something the players request regularly).

Why not simply make a new mission and use scripts to differentiate between having and not having a certain research?
It's doable, but with more complex scripts becomes rather impractical. Many of my missions are launched from multiple scripts (depending on time, research projects etc.) despite having one and the same deployment. I wouldn't want to double that amount just to introduce more research conditions, if I can help it, and also make duplicates of the corresponding missions, regions and all that jazz. A simple switch on the deployment level as shown above would be a nice, simple solution (from a modder's perspective).

EDIT: Also would be nice to set some odds of the deployment switch (a chance for the switch to happen).
« Last Edit: August 10, 2020, 04:59:01 pm by Solarius Scorch »

Offline Yankes

  • Moderator
  • Commander
  • ***
  • Posts: 2337
    • View Profile
Re: [SUGGESTION] Deployment switch by research
« Reply #1 on: August 10, 2020, 05:59:33 pm »
I see that research grown more and more to STATE of game :)

From my perspective, I think it should not check one but multiple research projects:

Code: [Select]
STR_SMALL_SCOUT_WITH_LASER_RIFLES:
  - STR_LASER_RIFLE
STR_SMALL_SCOUT_WITH_LASER_RIFLES_AND_WC:
  - STR_LASER_RIFLE
  - PERSONAL_WC
And game should find one that have more "hits", if its tie, then choose random as you wanted.

(this was only loose thoughts)

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 9730
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: [SUGGESTION] Deployment switch by research
« Reply #2 on: August 10, 2020, 11:03:22 pm »
Yep, reversing the order is much better. I won't insist on my syntax at all, this looks cleaner anyway.

Online Meridian

  • Global Moderator
  • Commander
  • ***
  • Posts: 6325
  • Aaand we're back!
    • View Profile
    • My Wiki
Re: [SUGGESTION] Deployment switch by research
« Reply #3 on: August 11, 2020, 11:13:23 am »
and you have both prerequisites, then the game picks one of these two deployments at random.

Can't do random... deployment must be known before you go on a mission, so that we can check Starting Conditions.

STR_SMALL_SCOUT_WITH_LASER_RIFLES is another, separate deployment. If you don't have STR_LASER_RIFLE researched, the deployment is loaded as normal; but if you do, the game uses STR_SMALL_SCOUT_WITH_LASER_RIFLES instead of STR_SMALL_SCOUT.

Is this about full alien deployment definition ( https://www.ufopaedia.org/index.php/Ruleset_Reference_Nightly_(OpenXcom)#Alien_Deployments )
or just about number of aliens and their weapons, similar to what 'craftCustomDeploy' attribute does today ( https://www.ufopaedia.org/index.php/Ruleset_Reference_Nightly_(OpenXcom)#Deployment_Data )?

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 9730
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: [SUGGESTION] Deployment switch by research
« Reply #4 on: August 11, 2020, 11:28:23 am »
Can't do random... deployment must be known before you go on a mission, so that we can check Starting Conditions.

Understood.
The random factor isn't important for me, it was simply a suggested way to solve issues with having multiple deployments and researches... But Yankes' suggestion eliminates that need, if I understand correctly.

Is this about full alien deployment definition ( https://www.ufopaedia.org/index.php/Ruleset_Reference_Nightly_(OpenXcom)#Alien_Deployments )
or just about number of aliens and their weapons, similar to what 'craftCustomDeploy' attribute does today ( https://www.ufopaedia.org/index.php/Ruleset_Reference_Nightly_(OpenXcom)#Deployment_Data )?

Ranks and weapons alone would be nice, but nicer would be also having access to modify civilians (mostly to enable better allies if you share tech with them).

Offline Finnik

  • Colonel
  • ****
  • Posts: 140
    • View Profile
Re: [SUGGESTION] Deployment switch by research
« Reply #5 on: August 11, 2020, 12:21:27 pm »
I already have a similar feature in FtA if anybody cares, though syntaxis is simpler. In my realization, deployment is switched near the point when it altered because of _UNDERWATER and it alters not just data, but also all map generated. Not sure if its the best way (actually, I think you can do it much better, so would be interesting to compare it in learning purposes), but works just fine to player choose the way how to assault an alien base (I have 4 cases for my Advent regional HQ).

UPD:
I see that research grown more and more to STATE of game :)
So true, some times it is hard for new modders to realize how powerful a tool it is. In FtA, I think? ~1/3 or researches would be just technical, used only to set up scenarios to trigger missions, events, and triggered with deployments, events, arcs, covert operations, etc, etc. I thought if I should make a new entity for stuff like that, but for now, it's fine, having all that rich API. IMO next logical step is binding discovering of research (not just normal research with scientists, but from any source) to a y-script hook, for all that stuff affects the battlescape. With the topic's feature it would allow, us, for example, also manage additional effects to make story missions even more interesting and unique.
« Last Edit: August 11, 2020, 02:37:49 pm by Finnik »

Offline Precentor Apollyon

  • Commander
  • *****
  • Posts: 722
    • View Profile
Re: [SUGGESTION] Deployment switch by research
« Reply #6 on: August 12, 2020, 08:42:31 am »
It would be nice to have a separate Aliendeployment for Missionsite generated for ufos.

  - type: STR_SMALL_SCOUT_MISSIONSITE

  - type: STR_SMALL_SCOUT_UNDERWATERMISSIONSITE

For examples.

So when Alien lands to start a mission, you intercept and a Battlescape mission starts. One can have mini-terror missions, civillian rescue missions and etc.

So the vanilla UFO Aliendeployment is reserved for ufo crash sites only, this will allow me to add an element of realism by having UFO crashed in various random configurations, and add more engine cores for more random damage and appearance.

Online Meridian

  • Global Moderator
  • Commander
  • ***
  • Posts: 6325
  • Aaand we're back!
    • View Profile
    • My Wiki
Re: [SUGGESTION] Deployment switch by research
« Reply #7 on: August 12, 2020, 10:35:48 am »
It would be nice to have a separate Aliendeployment for Missionsite generated for ufos.

This is normal vanilla functionality, e.g. terror ships can generate terror mission sites.

Offline Precentor Apollyon

  • Commander
  • *****
  • Posts: 722
    • View Profile
Re: [SUGGESTION] Deployment switch by research
« Reply #8 on: Today at 05:28:18 am »
This is normal vanilla functionality, e.g. terror ships can generate terror mission sites.

Understandable. My request is to extends from vanilla functionality.

Pure Terror missions has their own aliendeployments.

My request is to split the vanilla Aliendeployment for ufos, when landing on a map, is to have Crash site and mission site distinguished separately and exclusively.

Where missionsites for ufos are not pure terror missions. More like a UFO landing, one can script mini-missions relating to the Alien UFO's mission behaviour. Eg for abductions, one can find a ufo landing in a farm, with civilians. For Alienbase, one can find half constructed alien buildings at where the ufo has landed.

This can compliment to what Solarius is asking.

Crashsites is where one can find the UFO mostly destroyed, in pieces or whole, with dead aliens everywhere, not in participating in any alien mission. 

 
 

Online Meridian

  • Global Moderator
  • Commander
  • ***
  • Posts: 6325
  • Aaand we're back!
    • View Profile
    • My Wiki
Re: [SUGGESTION] Deployment switch by research
« Reply #9 on: Today at 10:23:48 am »
I don't see anything new.
Just like you can do terror sites, you can also do alien abduction sites, alien base building sites, etc.

Offline Precentor Apollyon

  • Commander
  • *****
  • Posts: 722
    • View Profile
Re: [SUGGESTION] Deployment switch by research
« Reply #10 on: Today at 01:14:19 pm »
Okay, I get the picture. It is a no here.

Online Meridian

  • Global Moderator
  • Commander
  • ***
  • Posts: 6325
  • Aaand we're back!
    • View Profile
    • My Wiki
Re: [SUGGESTION] Deployment switch by research
« Reply #11 on: Today at 01:34:16 pm »
I said YES.
Which part of "it is already available" did you not understand?