58
« on: April 11, 2020, 09:27:32 pm »
In XCF, we want to go hybrid (create new textures on our globe to represent the seabed, using the texture property fakeUnderwater: true and setting the terrains of these textures to a depth of > 0). However, we faced a problem:
We want to limit the player's use of crafts to different types of environments. Let's say we have cars and helicopters, and naturally we don't want to use them for submarine missions (where the depth is > 0). But we will also have cargo planes to transport submarines, and it will be quite silly to use it for land deployments and obviously will be quite detrimental for the immersion.
Yes, it is possible to limit the player from using craft with startingConditions, but they were originally designed for more specific scenarios, like special missions in Piratez. In this way, we would have to specify it for absolutely all our deployments, and also change absolutely all existing startingConditions, which are already quite complex. This is not a very elegant solution, so maybe it's possible to make a different addition to the code?
How it would work: when you try to go to the mission, the game checks whether the depth on the deployment is acceptable for this craft. And if not, the game displays a window describing that you cannot use this craft for this mission.
(I have discussed it with Finnik, who offered to code this; basically he is leading this idea, but I confirm that it would be useful.)
Perhaps it would be good to use approximately the same syntax as we already use for craftWeapons. You can make two binary parameters: underwaterOnly and landOnly, or make underwaterOnly, for example, as an integer, where -1 means that the depth is not important (the default), 0 only for deployment with depth = 0 and 1 for depth > 0. The current fakeUnderwater parameter for facilities also works similarly. Of course, naming is not the crucial point, so it can be whatever else is necessary.