Page 1 of 1

Spring.SetUnitWeaponState not changing range

Posted: 27 Nov 2010, 20:48
by CarRepairer
I want to reduce the weapon range of a unit with a single weapon.

Code: Select all

echo('set range', wrange)
Spring.SetUnitWeaponState(unitID, 0, {range = wrange})
echo ( 'range is ', Spring.GetUnitWeaponState(unitID, 0, 'range') ) 
The echo shows that the number updated. However the weapon range definitely didn't change.

Re: Spring.SetUnitWeaponState not changing range

Posted: 31 Dec 2010, 23:07
by CarRepairer
**

Re: Spring.SetUnitWeaponState not changing range

Posted: 01 Jan 2011, 05:08
by FLOZi

Re: Spring.SetUnitWeaponState not changing range

Posted: 01 Jan 2011, 05:10
by jK
incorrect weaponnum?

Re: Spring.SetUnitWeaponState not changing range

Posted: 01 Jan 2011, 05:15
by FLOZi
jK wrote:incorrect weaponnum?
I was reasonably sure that weapons start at 0 myself but, I may well be mistaken.

(S44 ammo gadget seems to comply, but it's not exactly the most reliable heap of junk in the galaxy :lol: )

Re: Spring.SetUnitWeaponState not changing range

Posted: 01 Jan 2011, 05:15
by jK
still it can have NULLWEAPONs etc.

Re: Spring.SetUnitWeaponState not changing range

Posted: 01 Jan 2011, 06:44
by CarRepairer
CarRepairer wrote:single weapon
And I used 0 as you can see. And for sanity's sake I tried changing both 0's to 1's.

Re: Spring.SetUnitWeaponState not changing range

Posted: 03 Jan 2011, 18:09
by knorke
had the same problem with weapon reload time.
http://springrts.com/wiki/The_Talking_Changelog wrote: StateTable is a table containing one or more of reloadstate, reloadtime (this time in seconds),
accuracy, sprayangle, range, projectilespeed.
but actually had to use reloadTime to get it working (captial T)
Range did not work though so yeah :roll:

0 seems to be correct for a unit with only one weapon.

Re: Spring.SetUnitWeaponState not changing range

Posted: 31 Dec 2011, 10:04
by CarRepairer
I think this was fixed. It seems to work now. Maybe.