To figure out which ground units are amphibious AAI checks their maxwaterdepth. Until now I thought amphib ground units have a maxwaterdepth of 255. However I noticed that the Commanders in BA (using BA 6.41 atm) have a maxwaterdepth value of 35
Though there is a amphibious=1; statement in the ARMCOM.fbi, I failed to figure out what the corresponding variable in spring is called. Has this statement become obsolete? If yes, why are the Commanders amphibious?
Detecting Amphibious Units
Moderator: Moderators
Re: Detecting Amphibious Units
The amphibious tag has never been read by the engine, it simply
checks if maxWaterDepth is > 0 (combined with waterline, etc) to
determine amphibiousness. (maxWaterDepth 50 means "this unit
can live in any water that is at most 50 elmos deep")
checks if maxWaterDepth is > 0 (combined with waterline, etc) to
determine amphibiousness. (maxWaterDepth 50 means "this unit
can live in any water that is at most 50 elmos deep")
Re: Detecting Amphibious Units
for mobile units unitdef->movedata should have a non-zero value, the unitdef->movedata->depth field seems to be more accurate than unitdef->maxWaterDepth
- Evil4Zerggin
- Posts: 557
- Joined: 16 May 2007, 06:34
Re: Detecting Amphibious Units
IIRC unitDef->maxWaterDepth determines where a unit can be built (e.g. by engineers), and unitDef->movedata->depth determines where the unit can actually move. Same for minWaterDepth and maxSlope.
Re: Detecting Amphibious Units
There's a large class in NTai full of checks on the unitdef structure such as this. Including amphibious units floating units, underwater structures, submarines, and floating structures.