Page 1 of 1

high trajectory

Posted: 09 Feb 2008, 12:28
by aragon
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?

Re: high trajectory

Posted: 09 Feb 2008, 15:32
by Stealth870
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

:?: :mrgreen:

(Just looking for anything about trajectory in the Lua Wiki)

Re: high trajectory

Posted: 10 Feb 2008, 00:13
by aragon
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

Posted: 10 Feb 2008, 01:26
by Gnomre
http://spring.clan-sy.com/wiki/Lua_Sync ... formations

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]
 }
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.

Re: high trajectory

Posted: 11 Feb 2008, 01:39
by aragon
thanks