2025-08-03 21:45 CEST

spring: develop 847d19d1 Diff ] Back to Repository ]
Author Committer Branch Timestamp Parent
KDR_11k KDR_11k develop 2007-12-17 15:14:29 develop 8a27afaa
Changeset * Added COB and Lua access to some more weapon variables.
New COB constants, all get-only (but not read-only):
WEAPON_RELOADSTATE 125 (frame number of the next shot/burst)
WEAPON_RELOADTIME 126 (in frames)
WEAPON_ACCURACY 127
WEAPON_SPRAY 128
WEAPON_RANGE 129
WEAPON_PROJECTILESPEED 130
All of these use the first param (starting at 1) as the weapon index whereby positive means read and negative means write the second param to the value. In the latter case the previous value is returned.

New Lua call-out (SyncedCtrl):
Spring.SetUnitWeaponState(unitID, weaponNum, stateTable)
StateTable is a table containing one or more of reloadstate, reloadtime (this time in seconds), accuracy, sprayangle, range, projectilespeed. Obviously the values will be assigned to the variables the keys refer to.

git-svn-id: https://spring.clan-sy.com/svn/spring/trunk@5035 37977431-3df6-0310-b722-df95706aa16b
mod - rts/Lua/LuaSyncedCtrl.cpp Diff ] File ]
mod - rts/Lua/LuaSyncedCtrl.h Diff ] File ]
mod - rts/Sim/Units/COB/CobInstance.cpp Diff ] File ]