SetSfxOccupy change?
Posted: 08 Dec 2012, 01:54
Can we change that callin so that instead of arbitrary 5 elmo depth, it would report a consistent set of states for the unit, such as:setSFXoccupy ( number curTerrainType ) -> nil
Called when terrain type changes. Terrain type is calculated with the following rules (in this order):
If unit is being transported -> curTerrainType = 0
If ground height < -5 and unit is always upright -> curTerrainType = 2
If ground height < -5 and unit is not always upright -> curTerrainType = 1
If ground height < 0 and unit is always upright -> curTerrainType = 1
Otherwise -> curTerrainType = 4
Where is curTerrainType = 3 ?
Candidate to be changed to something saner later on.
- completely submerged
- partially submerged
- fully out of water
And ignore the upright/not upright tag?
My reason is purely egoist: i want to make a set of amphibious units and i find having to poll for submersion and surfacing totally hideously bad (almost like upspring).