SetSfxOccupy change?

SetSfxOccupy change?

Requests for features in the spring code.

Moderator: Moderators

Post Reply
User avatar
Anarchid
Posts: 1384
Joined: 30 Nov 2008, 04:31

SetSfxOccupy change?

Post by Anarchid »

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.
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:
- 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).
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: SetSfxOccupy change?

Post by knorke »

There is
UnitEnteredWater() --> "unitID, unitDefID, teamID"
UnitEnteredAir() --> "unitID, unitDefID, teamID"
UnitLeftWater() --> "unitID, unitDefID, teamID"
UnitLeftAir() --> "unitID, unitDefID, teamID"
for gadgets, maybe see if it has the same quirks or not?
(gadget-to-unit is no problem)
Post Reply

Return to “Feature Requests”