aliens

Author Topic: New features for missions - variable timers  (Read 6959 times)

Offline Hobbes

  • Commander
  • *****
  • Posts: 2102
  • Infiltration subroutine in progress
    • View Profile
New features for missions - variable timers
« on: February 02, 2016, 04:16:15 pm »
Thanks to Warboy1982's work it is now possible to:
1) Add a turn limit where the game automatically ends after a defined X number of turns, and define how the mission ends
2) Modify the turn where the AI becomes aware of all your units (the original game has it set for turn 20, or if there's 2 or less units by turn 10)

These two variables can be set individually for each mission through alienDeployments:

Code: [Select]
alienDeployments:
  - type: STR_ESCAPE_MISSION
    turnLimit: 20
    chronoTrigger: 0
    cheatTurn: 10

Description:
* turnLimit is used to define the turn where the game ends, default is 0 (no limit). If the value is changed from default then the game will display the number of turns on the 'Hidden Movement' screens as '1/20', '2/20', etc., and the numbers will switch to red when there's less than 3 turns remaining.
* chronoTrigger is used with turnLimit and defines what happens when the turn limit is reached. There are 3 possible settings:
** 0 (default) = forces a Loss, meaning that the player loses everything if the mission isn't completed by the time the turn limit is reached. All units are declared dead or MIA when the game ends. This is ideal for bomb defusal type missions.
** 1 = forces a Abort, this is almost the same as above, with the exception that there must be at least 1 solder on an exit-only area (like the green room on the 1st stage of Cydonia) to win at the end of the turn limit.
** 2 = forces a Win, where if you have at least 1 live unit at the end of the turn limit you'll win the mission, regardless of where the soldiers are. This is meant for Survival scenarios.
** Regardless of the setting, the player can always still win by eliminating all alien units before the turn limit, or fail the mission by losing all units.
* cheatTurn allows to define the turn where the AI becomes aware of all your units (default is 20) for individual missions. Once this turn is reached the aliens will be forced to go into attack mode and engage your units. This is effectively a cheat for the AI which was present on the original game.

As you can imagine this opens a lot of possibilities for designing new missions. :)

As another example:

Code: [Select]
alienDeployments:
  - type: STR_AREA51_DESTROY_HQ_AREA51
    objectivesRequired: 16
    objectiveComplete: [STR_MISSILE_SILO_DISABLED, 750]
    objectiveFailed: [STR_MISSILE_SILO_OPERATIONAL, -750]
    objectivePopup: STR_MISSILE_SILO_DESTROYED
    turnLimit: 20
    chronoTrigger: 0
    cheatTurn: 10

This creates a Destroy mission where you have 20 turns to destroy at least 16 missiles and where the AI becomes aware of all your units after turn 10. You also have two several win conditions: you need to destroy the missiles and get back to the craft with at least 1 soldier before turn 20.
« Last Edit: February 02, 2016, 07:30:44 pm by Hobbes »

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9078
    • View Profile
Re: New features for missions - variable timers
« Reply #1 on: February 02, 2016, 04:27:23 pm »
* cheatTurn allows to define the turn where the AI becomes aware of all your units (default is 20) for individual missions. Once this turn is reached the aliens will be forced to go into attack mode and engage your units. This is effectively a cheat for the AI which was present on the original game.

Just for completeness' sake
  cheatTurn: 48
would mean aliens become aware of you on turn 48; or on turn 24 (=48/2) if there are 2 or less aliens left.

Offline Cooper

  • Colonel
  • ****
  • Posts: 150
  • Chryssalids are awesome
    • View Profile
Re: New features for missions - variable timers
« Reply #2 on: February 02, 2016, 05:11:19 pm »
Love it!

Offline Warboy1982

  • Administrator
  • Commander
  • *****
  • Posts: 2333
  • Developer
    • View Profile
Re: New features for missions - variable timers
« Reply #3 on: February 02, 2016, 07:26:09 pm »
addendum to Hobbes' example above: if the objective type is "MUST_DESTROY" (aka: alien brain) the mission will continue even after all the aliens are killed until the time limit is reached or all the objectives are destroyed (no need to escape, the mission ends there).
it won't trigger a "game over" however, due to the lack of a "winGame" or "loseGame" cutscene.

and to clarify my own statement, you CAN have a cutscene tied to mission success or failure (ie: a large explosion if you fail) as long as it's not named "winGame" or "loseGame"
« Last Edit: February 02, 2016, 08:24:53 pm by Warboy1982 »

Offline liberation

  • Captain
  • ***
  • Posts: 75
    • View Profile
Re: New features for missions - variable timers
« Reply #4 on: February 02, 2016, 10:41:36 pm »
Wow, that's great work. cant wait to get more in depth into my own mission scripting  8)

Offline hellrazor

  • Commander
  • *****
  • Posts: 2027
  • Deep Ruleset Digger & Bughunter
    • View Profile
    • Github Account
Re: New features for missions - variable timers
« Reply #5 on: February 04, 2016, 09:32:45 am »
hm... Terrormissions with timers.

UFO Misssions with a Dustoff counter (if you do not destroy UFO Navigation).

The possibilities! *sabber*

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11721
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: New features for missions - variable timers
« Reply #6 on: February 04, 2016, 10:54:03 am »
hm... Terrormissions with timers.

UFO Misssions with a Dustoff counter (if you do not destroy UFO Navigation).

The possibilities! *sabber*

Yeah, it could be a idea idea to add this mechanics to any UFO landing (not crash). After all, what's keeping them from taking off?

But I guess the number of turns would have to be randomized, for example 10-20, else it would be too metagamey.

Offline davide

  • Commander
  • *****
  • Posts: 565
    • View Profile
Re: New features for missions - variable timers
« Reply #7 on: February 04, 2016, 01:00:33 pm »
Uhm ...

Only as "Brain Storm" ...

after a new type of "turn timer trigger", Aliens got reinforcements

"location trigger type 1 - alarm trigger":
when a soldier enter in some map zone
 (array of rects map relative position from terrain script),
aliens enter in attack mode (it raise the alien cheat turn )

"location trigger type 2 - trap trigger":
when a soldier enter in some map zone,
some object explode

bye
« Last Edit: February 04, 2016, 01:06:16 pm by davide »

Offline hellrazor

  • Commander
  • *****
  • Posts: 2027
  • Deep Ruleset Digger & Bughunter
    • View Profile
    • Github Account
Re: New features for missions - variable timers
« Reply #8 on: February 06, 2016, 07:27:22 am »
Yeah, it could be a idea idea to add this mechanics to any UFO landing (not crash). After all, what's keeping them from taking off?

But I guess the number of turns would have to be randomized, for example 10-20, else it would be too metagamey.

Well only adding it towards the landing, will not be possible.
Since those values are set via the alienDeployments section and those are universal settings so to say.
It would make sense, to have it only occur on landed UFO's, since crashed ones usually have damaged engines and are unlikely to take off, because they are crashed.

It could depend on the size of the UFO and the crewsize.
For example Medium Scouts will trigger the cheat after 5 turns and will dust off after 10.
Large Scouts will trigger after 8 turn and dustoff after 16.
etc.. pp.

Offline Eddie

  • Commander
  • *****
  • Posts: 560
    • View Profile
Re: New features for missions - variable timers
« Reply #9 on: February 08, 2016, 12:15:35 am »
The available chronoTrigger options are not a good fit for an Ufo taking off. They are more fit for the activation of a self destruct device that kills everything in the area. But then again, why would the aliens destroy an undamaged Ufo instead of just taking off.