2024-04-19 05:11 CEST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0002730Spring engineGeneralpublic2011-11-12 18:36
ReporterGoogle_Frog 
Assigned ToKloot 
PrioritynormalSeverityblockReproducibilityhave not tried
StatusresolvedResolutionfixed 
Product Version 
Target VersionFixed in Version84.0 
Summary0002730: All weapons mostly ignore "aimReady"
DescriptionThe visible effect is this. Once a unit has fired it is able to fire regardless of which way it's gun is pointing. Before it fires the normal restriction of only firing when it has finished aiming applies.

Given what tvo said in 2728 here is what it looks like happens:
 * Units spawn with aimReady = false.
 * The unit script does Spring.SetUnitWeaponState(unitID, num, "aimReady", true) to let the weapon fire when it has finished aiming.
 * Calling Spring.SetUnitWeaponState(unitID, num, "aimReady", false) appears to have no effect at all.

That probably isn't what is going on in the engine but to an outside observer (testing with lua) it looks if aimReady=true it cannot be set to false.
Additional InformationEngine 83.0.1-96-gd8e23a8
TagsNo tags attached.
Checked infolog.txt for Errors
Attached Files

-Relationships
+Relationships

-Notes

~0007587

Google_Frog (reporter)

Oops it's always reproducible I just forgot that menu. Also +83.0 should be added as an engine option.

~0007588

Kloot (developer)

Last edited: 2011-11-12 18:00

from unit_script.lua:
    local function AimWeaponThread(weaponNum, heading, pitch)
        if AimWeapon(weaponNum, heading, pitch) then
            -- SetUnitWeaponState counts weapons from 0
            return sp_SetUnitWeaponState(unitID, weaponNum - 1, "aimReady", 1)
        end
    end

so, change "if AimWeapon(...) ... then ... end" to

    return sp_SetUnitWeaponState(unitID, weaponNum - 1, "aimReady", AimWeapon(weaponNum, heading, pitch))

edit1: did this in the engine-supplied unit_script.lua now, so you do not have to override it.

edit2: just saw it also affects COB if AimWeapon spawns a thread

~0007589

Kloot (developer)

Last edited: 2011-11-12 18:36

fixed, but see the code comment how this relates to 0002685

+Notes

-Issue History
Date Modified Username Field Change
2011-11-12 17:19 Google_Frog New Issue
2011-11-12 17:21 Google_Frog Note Added: 0007587
2011-11-12 17:24 Kloot Note Added: 0007588
2011-11-12 17:25 Kloot Note Edited: 0007588
2011-11-12 17:26 Kloot Status new => feedback
2011-11-12 17:36 Kloot Note Edited: 0007588
2011-11-12 18:00 Kloot Note Edited: 0007588
2011-11-12 18:35 Kloot Note Added: 0007589
2011-11-12 18:36 Kloot Note Edited: 0007589
2011-11-12 18:36 Kloot Note Edited: 0007589
2011-11-12 18:36 Kloot Status feedback => resolved
2011-11-12 18:36 Kloot Fixed in Version => 84.0
2011-11-12 18:36 Kloot Resolution open => fixed
2011-11-12 18:36 Kloot Assigned To => Kloot
+Issue History