OpenXcom Forum
OpenXcom Forks => OpenXcom Extended (OXCE) => OXCE Suggestions DONE => Topic started by: Finnik on November 29, 2019, 01:11:26 pm
-
I'm planning to make some additions to XCF terrains (ofc, its free to everyone else to use it), and as it has a lot of deployments, that uses its very own UFO (that looks like cults houses, for example).
For that the use specific mapScripts with defined UFO in addUfo command. First, it leads to tons of copypasting in mapScripts. Second, it does not let them use default mapScript from the terrain, and that's an issue to my concept. Also, it's impractical to match deployment name with its UFO, as we have many-to-many relations here.
So I'd really love to have the option to define ufo directly in the deployment rule, I'm proposing such syntax:
alienDeployments:
- type: STR_MY_FAVORITE_CULT_HOUSE
width: 40
length: 40
height: 4
customUfo: STR_CULT_HOUSE # <------
terrains:
- TERRAIN_WITH_OWN_SCRIPT1
- TERRAIN_WITH_OWN_SCRIPT1
data:
...
I'm not sure if I did it all right, I guess there could be a more elegant solution, but I hope that could help a little:
https://github.com/FinnikXCF/OpenXcom/commit/12ec74f3a77f2e458b3ffb8c801dca208b73dd0f
It looks to me like its possible to merge it https://github.com/MeridianOXC/OpenXcom/compare/oxce-plus...FinnikXCF:oxce-plus
With it, map generator will look, if there is addUfo command, but we have no UFO defined in the usual way, so it gets ufo rules for optional alienDeployment property.
I would really appreciate any feedback on that, and I really want to know if such a ruleset option would become available in the upcoming release of OXCE, as I really need it in my work with terrains for compensation for recent events.
@Devs, if there is anything I can do to make it more fitting to OXCE, please, let me know, I'm really motivated in that feature.
Update by Meridian: ruleset attribute name changed to 'customUfo'. Code modified and merged.
-
It certainly looks like an improvement, as it would allow to use very complex or compoud terrains... Just gotta make a sanity check if all terrains have spawnUFO command.
-
I definitely applaud this feature. It would save us a lot of coding space, and mindless duplicates. What's more, it would eliminate the need to keep multiple versions of the same terrain for various purposes, which is a bit of a pain to control.
-
Merged.
-
Thank you!
EDIT:
It certainly looks like an improvement, as it would allow to use very complex or compoud terrains... Just gotta make a sanity check if all terrains have spawnUFO command.
As Finnik discovered, scripts can have the addUFO command even if there is no UFO, it is just ignored. So, there is no ned to put addUFO in any script.
-
As Finnik discovered, scripts can have the addUFO command even if there is no UFO, it is just ignored. So, there is no ned to put addUFO in any script.
That sentence doesn't make sense... what did you want to say?
-
That sentence doesn't make sense... what did you want to say?
I reread it and it makes perfect sense.
I meant to say that you don't need two scripts, with and without UFO (for UFO landings and terror missions). I assume it has to do with the improvement you coded on Dioxine's request to skip unplaceable UFOs, though I could be wrong.
-
So, there is no ned to put addUFO in any script.
If there was no need to put addUFO in any script... why would addUFO command even exist?
If you don't put addUFO into any script, no UFO will ever be generated.
Or am I missing something?
-
If there was no need to put addUFO in any script... why would addUFO command even exist?
If you don't put addUFO into any script, no UFO will ever be generated.
Or am I missing something?
*facepalm*
Okay... Sorry, I meant in every script.
So, previously we had two different terrains (a generic example, but also true for some mods):
- terrain URBAN (vanilla), with mapScript URBAN, for vanilla alien terror missions
- terrain URBANUFO, with mapScript URBANUFO, for crashed/landed UFOs (must be added to globe textures as possible terrains.
Both terrains consist of exactly the same mapblocks. The only difference is in the mapScript: URBANUFO has addUFO in the commands, while URBAN doesn't (because it's meant for terror missions only).
But it turned out that if there is the addUFO command in a mapScript, and there is no UFO to spawn (like in standard terror), the addUFO command is simply skipped with no ill effects. This means that we don't actually need two separate terrains and two separate mapScripts, it can be done with one and the same mapScript.
And let us rejoice :)
-
This can be done already. If you are going to create a new mapscript for URBANUFO alone. Just for the sake of an ufo added to the vanilla terror mission.
For example.
- type: URBANUFO
commands:
- type: addUFO
groups: 1
UFOName: STR_FLEET_SUPPLY_CRUISERLAND
terrain: URBAN
- type: addCraft
terrain: URBAN
groups: 1
- type: addBlock
size: 2
execution: 2
terrain: URBAN
- type: fillArea
terrain: URBAN
This will pretty much call the urban map from the terror mission and it became a ufo crash mission in the aliendeployment. May the aliendeployment can be a missionsite or ufo aliendeployment.
-
This can be done already. If you are going to create a new mapscript for URBANUFO alone. Just for the sake of an ufo added to the vanilla terror mission.
Which is what I've been talking about all the time. (Assuming I understood your point.)
-
Sorry, I should have written, it can be done already, before the addufo feature was added to oxce.
-
Sorry, I should have written, it can be done already, before the addufo feature was added to oxce.
If you mean customUFO, then yes.