high trajectory

high trajectory

Discuss Lua based Spring scripts (LuaUI widgets, mission scripts, gaia scripts, mod-rules scripts, scripted keybindings, etc...)

Moderator: Moderators

Post Reply
aragon
Posts: 14
Joined: 20 Jan 2008, 13:44

high trajectory

Post 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?
User avatar
Stealth870
Posts: 166
Joined: 13 Sep 2004, 00:25

Re: high trajectory

Post 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)
aragon
Posts: 14
Joined: 20 Jan 2008, 13:44

Re: high trajectory

Post 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)
Gnomre
Imperial Winter Developer
Posts: 1754
Joined: 06 Feb 2005, 13:42

Re: high trajectory

Post 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.
aragon
Posts: 14
Joined: 20 Jan 2008, 13:44

Re: high trajectory

Post by aragon »

thanks
Post Reply

Return to “Lua Scripts”