aliens

Author Topic: Mission Scripting  (Read 27222 times)

Offline robin

  • Commander
  • *****
  • Posts: 1224
  • ULTIMATE ROOKIE
    • View Profile
Re: Mission Scripting
« Reply #30 on: August 15, 2015, 09:35:38 pm »
Quote
ERROR: Error with MissionScript: XXX cannot mix terror/non-terror missions in a single command, so sayeth the wise Alaundo.
Alaundo how could you?!

:P

Offline hellrazor

  • Commander
  • *****
  • Posts: 2027
  • Deep Ruleset Digger & Bughunter
    • View Profile
    • Github Account
Re: Mission Scripting
« Reply #31 on: August 18, 2015, 06:24:47 pm »
Alaundo how could you?!

:P

Actually the mighty Mapscript is used for doing the Missionscripting. I guess Alaundo's wise words have to do with that ^^

Offline hellrazor

  • Commander
  • *****
  • Posts: 2027
  • Deep Ruleset Digger & Bughunter
    • View Profile
    • Github Account
Re: Mission Scripting
« Reply #32 on: August 21, 2015, 11:48:11 am »
Could we have this thread to be sticky?
Since it is wandering down the forums and soon will never to be seen again.

Offline Warboy1982

  • Administrator
  • Commander
  • *****
  • Posts: 2333
  • Developer
    • View Profile
Re: Mission Scripting
« Reply #33 on: August 21, 2015, 01:23:48 pm »
Actually the mighty Mapscript is used for doing the Missionscripting.

huh?

Offline hellrazor

  • Commander
  • *****
  • Posts: 2027
  • Deep Ruleset Digger & Bughunter
    • View Profile
    • Github Account
Re: Mission Scripting
« Reply #34 on: August 21, 2015, 03:30:20 pm »
huh?

I was assuming this, since when you made Missionscripting throw more verbose messages the actual commit was in the section of the Mapscript.
But maybe you just reused code were appropriate.

Offline Warboy1982

  • Administrator
  • Commander
  • *****
  • Posts: 2333
  • Developer
    • View Profile
Re: Mission Scripting
« Reply #35 on: August 21, 2015, 05:04:28 pm »
ah, yeah i reused the error message. mapscripts and missionscripts have some commonalities, but they are fundamentally two very different things

Offline Gemeaux333

  • Sergeant
  • **
  • Posts: 23
    • View Profile
Re: Mission Scripting
« Reply #36 on: October 26, 2018, 10:57:28 pm »
What are the type names for Infiltration and Base building missions ?

I would like to postpone "Base building" missions and "Infiltrations" missions to July in TFTD
« Last Edit: October 27, 2018, 03:18:52 am by Gemeaux333 »

Offline Hobbes

  • Commander
  • *****
  • Posts: 2102
  • Infiltration subroutine in progress
    • View Profile
Re: Mission Scripting
« Reply #37 on: October 27, 2018, 03:40:53 am »
What are the type names for Infiltration and Base building missions ?

I would like to postpone "Base building" missions and "Infiltrations" missions to July in TFTD

The strings are STR_ALIEN_BASE and STR_ALIEN_INFILTRATION but they're spawned through the mission table, which is defined in regions.rul

Offline Gemeaux333

  • Sergeant
  • **
  • Posts: 23
    • View Profile
Re: Mission Scripting
« Reply #38 on: October 27, 2018, 06:22:00 pm »
So, is there a way to postpone them ?

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9094
    • View Profile
Re: Mission Scripting
« Reply #39 on: October 27, 2018, 07:17:45 pm »
So, is there a way to postpone them ?

Yes, the mission script governs all mission generation... you can customize it any way you like.
It takes a bit of time and experimentation, but it is easy once you understand the basics.

PS: also please avoid necro-posting, opening a new thread is easy

Offline Gemeaux333

  • Sergeant
  • **
  • Posts: 23
    • View Profile
Re: Mission Scripting
« Reply #40 on: October 27, 2018, 08:05:55 pm »
Should I start a new topic to increase my chances of having more detailed answers ?

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9094
    • View Profile
Re: Mission Scripting
« Reply #41 on: October 27, 2018, 08:38:57 pm »
Should I start a new topic to increase my chances of having more detailed answers ?

Depends what kind of answer you're looking for... do you want us to write the mod for you... or give you advice where to look?

If you want me to write it for you, I have to politely decline.

If you want pointers, I'll repeat where the information is stored:
1. mission race weights are stored in alienMissions.rul
2. mission generation information is stored in missionScripts.rul
3. there are two basic modes of mission generation: mission-table-based and scripted... mission tables are located in regions.rul; mission scripts are located directly in missionScripts.rul
4. mission tables approach is inherently random, you can't affect what comes first/next/last
5. if you want more control, you'll need to use mission scripts; or combination of both
6. many mods have changed mission generation, you can find almost any example you can think of by studying vanilla ruleset and other mods

There are several ways how to achieve postponing some missions, the easiest in your case is probably to use scripted missions for a first few months and after that revert to using mission tables. At least, that's how I would do it.

Second quite easy option would be removing these 2 missions from mission tables completely, and only generate them via scripts.
« Last Edit: October 27, 2018, 08:47:19 pm by Meridian »

Offline Gemeaux333

  • Sergeant
  • **
  • Posts: 23
    • View Profile
Re: Mission Scripting
« Reply #42 on: October 27, 2018, 09:02:53 pm »
By studying regions.rul, I guess i see the probabilities of each mission to happen... so I could simply change the probabilities of these missions to happen...

Am I right ?

P.S: Don't worry, I don't expect you to do everything at my place, but if anyone willingly propose himself to write it, I am open to it... but I guess I would have more merit doing it myself.
« Last Edit: October 27, 2018, 09:05:26 pm by Gemeaux333 »

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9094
    • View Profile
Re: Mission Scripting
« Reply #43 on: October 27, 2018, 09:22:21 pm »
By studying regions.rul, I guess i see the probabilities of each mission to happen... so I could simply change the probabilities of these missions to happen...

Am I right ?

Yes, that's a very easy way to do it.

Technically speaking, you are not really postponing those missions, they can still happen in month 1 if you're unlucky... but in majority of the games, it will look like as if they were postponed.

Offline Hobbes

  • Commander
  • *****
  • Posts: 2102
  • Infiltration subroutine in progress
    • View Profile
Re: Mission Scripting
« Reply #44 on: October 27, 2018, 09:58:45 pm »
Yes, that's a very easy way to do it.

Technically speaking, you are not really postponing those missions, they can still happen in month 1 if you're unlucky... but in majority of the games, it will look like as if they were postponed.

There's another issue more relevant.

@Gemeaux333
The missions defined in regions.rul make up a deck (composed of all the missions assigned to a region), and everytime missionScripts.rul runs the 'type: recon' or 'type: invasion' lines, the script randomly chooses a mission from that deck (and using the probabilities) and removes that specific mission from the deck. Once the deck is empty of missions, it is repopulated again using the values on regions.rul.

So, on any given game the deck will be composed of X Research, Y Base, W Infiltration, V Abduction and Z Harvest missions (or their TFTD equivalents) that will take place.

If you change the odds on regions.rul so that Base and Infiltration missions have a low chance of happening, you're reducing their odds of being spawned in the first months, but once the game empties the deck of Research, Abductions and Harvest missions, then only Base and Infiltration missions will be spawned. So in the first months those two mission types will hardly appear, but as months go by it will be more likelier that only those two types will be spawned.