I have a question - how to check if unit is using high or low trajectory?
Or (better) how to check if guardian and similar stuff use first or second weapon?
high trajectory
Moderator: Moderators
- Stealth870
- Posts: 166
- Joined: 13 Sep 2004, 00:25
Re: high trajectory
There's this thing in the UnitDef:
UnitDefs[216]["highTrajectoryType"] = 0
which I guess can be read with:
Spring.GetUnitDefID
( number unitID ) -> nil | number unitDefID
(Just looking for anything about trajectory in the Lua Wiki)
UnitDefs[216]["highTrajectoryType"] = 0
which I guess can be read with:
Spring.GetUnitDefID
( number unitID ) -> nil | number unitDefID


(Just looking for anything about trajectory in the Lua Wiki)
Re: high trajectory
This data is related to all units of specified type. I'd like to know low/high mode of every sinigle unit (if they currently use low/high traj, not if they are generally capable of)
Re: high trajectory
http://spring.clan-sy.com/wiki/Lua_Sync ... formations
The wiki is sometimes out of date, so that function may have additional values now which could mess you up, so it's probably best to doublecheck the engine source if you run into problems.
Code: Select all
Spring.GetUnitStates
( number unitID ) -> nil | {
"firestate" = number,
"movestate" = number,
"repeat" = boolean,
"cloak" = boolean,
"active" = boolean,
"trajectory" = boolean,
["autoland" = boolean,]
["autorepairlevel" = number,]
["loopbackattack" = boolean]
}