Author Topic: [DONE] [Suggestion] Arc Script  (Read 381 times)

Offline Meridian

  • Global Moderator
  • Commander
  • ***
  • Posts: 4979
  • Aaand we're back!
    • View Profile
    • My Wiki
[DONE] [Suggestion] Arc Script
« on: April 27, 2019, 12:37:58 pm »
--requested by Hobbes

Hello everyone,

here's a new script that should allow you to orchestrate your arcs and missions a bit better (if you want).

The idea is that you can script when should certain events occur and in which order and use those events to affect mission scripts.
Or, you can just use it to display "a tip of the month", I don't judge :)

The arc script runs just before the mission script, i.e. February arc script does already affect February mission script.

Here's the syntax:

Code: [Select]
  - type: earlyGame                     # the type/name is used for overwriting or deleting purposes
    sequentialArcs:                     # the type of research topics to be "discovered", each month 0 or 1, processed sequentially
    randomArcs:                         # the type of research topics to be "discovered", each month 0 or 1, chosen randomly considering weights
    firstMonth: 0                       # months this command runs on, 0 runs on startup of a new game (default 0)
    lastMonth: 12                       # don't run after this month. -1 denotes no limit (default -1)
    executionOdds: 75                   # % chances of this command executing (default 100)
    maxArcs: 4                          # maximum number of arcs this command can generate (together during the whole game), -1 for infinite (default -1)
    minDifficulty: 0                    # this command only applies to difficulty levels of this or above (default 0)
    maxDifficulty: 4                    # this command only applies to difficulty levels of this or below (default 4)
    researchTriggers:                   # a list of research topics that can influence the execution of this command (default empty)
      STR_THE_MARTIAN_SOLUTION: true    # in this case, the command would only run if the player has the Martian Solution
      STR_CYDONIA_OR_BUST: false        # and does NOT have Cydonia or Bust

firstMonth, lastMonth, minDifficulty, maxDifficulty and researchTriggers should be self-explanatory.

sequentialArcs and randomArcs are meant to be either-or, but it is possible to use both at the same time if you really want.
If you use both:
 - executionOdds are done only once, same result is used for both types
 - sequential arc is generated first, random arc second
 - maxArcs always applies, e.g. if maxArcs=1 and sequential arc was generated, random arc will not be generated even if everything else was satisfied

maxArcs counts any discovered topics, even from other arc scripts or normal game; and if you have any duplicate topics within a command it will count all duplicates as separate topics too

The "discovered" research topics behave almost identically to normal research:
+ lookups, unlocking, disabling and other features affecting normal research will apply (as if this research was finished in your HQ)
+ score will be awarded
+ ufopedia article will pop up (if available)
- getOneFree DOES NOT work (intentionally, no need to report as bug)

Test download:

Feedback welcome...
« Last Edit: April 28, 2019, 01:11:40 am by Meridian »

Offline Hobbes

  • Commander
  • *****
  • Posts: 3446
  • Infiltration subroutine in progress
    • View Profile
Re: [DONE] [Suggestion] Arc Script
« Reply #1 on: April 27, 2019, 04:05:33 pm »
Since I requested it, here's are more details on how to use this new feature.

The logic behind it is that can use research topics to trigger specific events, here are a couple examples how it can be used:
* Randomly give the player research A, B or C at the beginning - each research then unlocks specific tech at game start, giving the player different starting items/research for each campaign
* Randomly give each month one research topic D, E, F... - each research then unlocks a specific mission(s) for that month
* Give tech G on month 0, tech H on month 1 and tech I on month 2 - for multimission story arcs spawning in sequence across several months
* Give tech J and spawn corresponding mission, if mission is victory receive tech K, which then unlocks additional mission next month - for making missions dependent on the previous one
* If research L is completed or if month X is achieved, give tech M at beginning of next month with the UFOPedia notification - this can be used to provide tips, tutorials, ingame message, whatever relevant info you want to give the player.

Offline Finnik

  • Sergeant
  • **
  • Posts: 36
    • View Profile
Re: [DONE] [Suggestion] Arc Script
« Reply #2 on: April 28, 2019, 12:56:00 am »
OMG! That is very promising!