OpenXcom Forum
OpenXcom Forks => OpenXcom Extended (OXCE) => OXCE Support => Topic started by: The Reaver of Darkness on August 06, 2018, 10:09:41 pm
-
I discussed this topic in the past and I believe the answer I got was that the game is hardcoded against this so it can't easily be done. I had an idea though: perhaps you can change part of the mission and leave other parts unchanged. The important part I want to change is the deployment; specifically I want to be able to set in a retaliation mission which deployment it uses. All of the other parts of the base defense scenario can be left unchanged.
I don't know how the game sets up the base defense mission on the code end, but my thinking went like this:
The game selects Retaliation Mission X and you're at the point where the final UFO got past base defenses. It draws from built-in code and your save to determine the battlescape tilesets and layout. When it comes time to spawn aliens, the game checks Retaliation Mission X for a line of code declaring the final deployment set; if no response it defaults to the standard value. It then deploys the aliens from the given deployment set, and completes other functions as standard before starting the battlescape mission.
-
This is already possible in a manner in OXCE/OXCE+; you can see many examples of this in Piratez and some in X-Com Files.
-
I coudn't describe it better than Reaver :)
This is exactly how it works in OXCE.
-
Ah, I must have missed it. Thanks.
-
Can you explain to me how it works? I see this:
- type: STR_ALIEN_RETALIATION_L
missionWeights:
0: 20
But I can't figure out what a missionWeight of 20 means??
Also, is there a way to determine, on the mission, what retaliation missions can spawn from it? Example: I have a special sectoid retaliation UFO, and I want sectoids to spawn this specific mission as retaliation, and use the special ship on the final assault.
-
I discussed this topic in the past and I believe the answer I got was that the game is hardcoded against this so it can't easily be done. I had an idea though: perhaps you can change part of the mission and leave other parts unchanged. The important part I want to change is the deployment; specifically I want to be able to set in a retaliation mission which deployment it uses. All of the other parts of the base defense scenario can be left unchanged.
I don't know how the game sets up the base defense mission on the code end, but my thinking went like this:
The game selects Retaliation Mission X and you're at the point where the final UFO got past base defenses. It draws from built-in code and your save to determine the battlescape tilesets and layout. When it comes time to spawn aliens, the game checks Retaliation Mission X for a line of code declaring the final deployment set; if no response it defaults to the standard value. It then deploys the aliens from the given deployment set, and completes other functions as standard before starting the battlescape mission.
ufos:
- type: STR_BATTLESHIP
craftCustomDeploy: STR_BATTLESHIP_OTHER_RACES
missionCustomDeploy: STR_BASE_DEFENSE_OTHER_RACES
raceBonus:
STR_SECTOID:
craftCustomDeploy: STR_BATTLESHIP_SECTOID
missionCustomDeploy: STR_BASE_DEFENSE_SECTOID
STR_FLOATER:
craftCustomDeploy: STR_BATTLESHIP_FLOATER
missionCustomDeploy: STR_BASE_DEFENSE_FLOATER
hitBonus: 15
STR_MUTON:
craftCustomDeploy: STR_BATTLESHIP_MUTON
missionCustomDeploy: STR_BASE_DEFENSE_MUTON
Also, is there a way to determine, on the mission, what retaliation missions can spawn from it? Example: I have a special sectoid retaliation UFO, and I want sectoids to spawn this specific mission as retaliation, and use the special ship on the final assault.
alienRaces:
- id: STR_SECTOID
retaliationMission: STR_ALIEN_RETALIATION_2 #mission spawned after destroying a ufo.
baseCustomDeploy: STR_ALIEN_BASE_ASSAULT_2 #override alien base default weapon deployment.
baseCustomMission: STR_MIB_BASE #override alien base construction
-
Can you explain to me how it works? I see this:
- type: STR_ALIEN_RETALIATION_L
missionWeights:
0: 20
But I can't figure out what a missionWeight of 20 means??
I'm a little new to this, was wondering this too.. the "0" should be the mission string you want connected to this script I think, but if you only had one in the list with a weight of "20" like this (or any weight for that matter), your odds of spawning this mission are 100%, right? ie you'd need two weighted list missions before the weight would have any effect?
Or are these weights hard percentages? ie only one in list w/ weight 20 means 20% chance of this mission, 80% chance of going to mission table?
-
It's an undocumented vanilla feature from March 2015: https://github.com/SupSuper/OpenXcom/commit/98a0fa30d19b4c1e94eaca41cb33ddda620491c7
It is used to give weights to retaliation missions spawned when shooting down UFOs.
Note: other mission types are NOT affected...although original commit suggests it was supposed to work for some other mission types too... it was probably changed somewhere between 2015 and 2018 (probably almost fully replaced by mission scripts).
For example, you can have 3 different retaliation missions and give them different probability based on number of game months passed.
alienMissions:
- type: STR_ALIEN_RETALIATION_EARLY
missionWeights:
0: 80
6: 20
12: 0
- type: STR_ALIEN_RETALIATION_MIDGAME
missionWeights:
0: 20
6: 60
12: 20
- type: STR_ALIEN_RETALIATION_LATE
missionWeights:
0: 0
6: 20
12: 80
-
You spoil me, Meridian! Very thorough! ;D
Thanks so much!
-
all weights must add to 100 then, inferring from example?
-
all weights must add to 100 then, inferring from example?
No, they can add up to anything.
I just used 100 to make it easier to understand.
-
Can I get some help on missionScripts? The ruleset appears to declare this much code:
- type: recurringTerror
missionWeights:
0:
STR_ALIEN_TERROR: 100
useTable: false
startDelay: 150
- type: recon
firstMonth: 1
- type: invasion
firstMonth: 6
for 98% of the missions in the game.
Can I get some info on all of the missions running automatically, and how I can edit them? I don't even know where to start, and X-Com Files doesn't make a very good example because it still doesn't explain what the original research, harvest, abduction, base, and infiltration missions are doing.
-
Most of the vanilla missions do not run by mission scripts, they run by picking one from the weighted tables defined in the regions and elsewhere. The only script that does something here is the "recurringTerror".
The "missionWeights" determines which mission this script runs: in month 0 (the first month) STR_ALIEN_TERROR has a weight of 100 (it could have been just 1 since there's no other mission), so for month 0 and all the following, this script causes STR_ALIEN_TERROR to run. If you have more than one mission, the weights don't need to add up to 100, that's just the easiest way if you want to pick missions by percentage.
The "useTable" true/false just determines whether or not running this script should use up the pick of the mission every month from the usual vanilla mission spawning. In this case, the terror missions run in addition to the one vanilla mission per month.
The "startDelay" is just how long into the month the mission should wait before starting; I think this is in minutes.
-
Thanks!
--- post merge no jutsu! ---
So how often does a region select a new mission? How would I go about making the rate of a certain mission increase later in the game?
-
Once a month, a region and mission are selected from the "alien strategy" table. You can see the relative weights for these in /path/to/openxcom/standard/xcom1/regions.rul and which races conduct these missions in alienMissions.rul. As the game progresses, mission+region combinations are removed from the table when they are chosen, and when the table is completely empty, it regenerates from the ruleset file settings. You'll notice that this means you don't really have control over which missions happen over time, only which races conduct this mission by month.
However, you can use the scripts to determine which missions are run in a given month; the missionWeights parameter allows you to create a weighted list of missions by month when this script is run, and if you have "useTable: true" on the script, the mission chosen by the script will be run instead any chosen by the alien strategy table.
-
However, you can use the scripts to determine which missions are run in a given month; the missionWeights parameter allows you to create a weighted list of missions by month when this script is run, and if you have "useTable: true" on the script, the mission chosen by the script will be run instead any chosen by the alien strategy table.
So if I make several weighted lists of missions, I can have it pick a mission from my list every month, and never choose one from the default lineup? And when my lists end, if the game continues past that point, it will continue using my last list every month?