View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0002728 | Spring engine | Unit Scripting | public | 2011-11-12 04:31 | 2011-11-12 16:26 |
| Reporter | Google_Frog | Assigned To | |||
| Priority | normal | Severity | major | Reproducibility | always |
| Status | closed | Resolution | no change required | ||
| Summary | 0002728: beamlaser ignores script.AimWeapon return value | ||||
| Description | Turreted beamlasers always fire regardless of script.AimWeapon. The following script.AimWeapon should prevent a unit from firing. function script.AimWeapon(num, heading, pitch) return false end The result of this is beamlasers fire before the unit has finished aiming. Occurs with both cob and lua scripts. Seems to be since https://github.com/spring/spring/commit/572aa92211a9dc9f57339ae3dbc2ee8ef15d52c1 | ||||
| Additional Information | Engine 83.0.1-96-gd8e23a8 | ||||
| Tags | No tags attached. | ||||
| Checked infolog.txt for Errors | |||||
|
|
For Lua animation scripts, the return value of AimWeapon is NOT** used. Instead you are supposed to call Spring.SetUnitWeaponState(unitID, weaponID, "aimReady", true) but this requirement was hidden prior to my commit. ** these source comments explain why: - Because in current design CBCobThreadFinish can impossibly be called, certain state changes which normally happen immediately when script returns should be triggered through a call to a callOut when using Lua scripts. This applies to: * Spring.SetUnitShieldState(unitID, false|true) replaces return value 0|1 of COB's AimWeaponX function for plasma repulsers. * Spring.SetUnitWeaponState(unitID, weaponNum, "aimReady", 0|1) replaces return value 0|1 of COB's AimWeaponX function for all other weapons. |
|
|
Kloot: LUS gadget handles calling SetUnitWeaponState after AimWeapon returns true. (so return value is used, but not by engine) |
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2011-11-12 04:31 | Google_Frog | New Issue | |
| 2011-11-12 11:39 | Kloot | Note Added: 0007582 | |
| 2011-11-12 11:39 | Kloot | Status | new => feedback |
| 2011-11-12 11:54 | Kloot | Note Edited: 0007582 | |
| 2011-11-12 11:55 | Kloot | Status | feedback => closed |
| 2011-11-12 11:55 | Kloot | Resolution | open => no change required |
| 2011-11-12 12:26 | Kloot | Status | closed => feedback |
| 2011-11-12 12:26 | Kloot | Resolution | no change required => reopened |
| 2011-11-12 12:26 | Kloot | Note Edited: 0007582 | |
| 2011-11-12 12:26 | Kloot | Status | feedback => closed |
| 2011-11-12 12:26 | Kloot | Resolution | reopened => no change required |
| 2011-11-12 16:26 | tvo | Note Added: 0007586 |