View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||
---|---|---|---|---|---|---|---|---|---|
0003219 | Spring engine | General | public | 2012-07-23 17:12 | 2012-07-23 18:10 | ||||
Reporter | gajop | ||||||||
Assigned To | Kloot | ||||||||
Priority | normal | Severity | major | Reproducibility | always | ||||
Status | closed | Resolution | no change required | ||||||
Product Version | 89.0 | ||||||||
Target Version | Fixed in Version | ||||||||
Summary | 0003219: AllowWeaponTarget is ignored for most units | ||||||||
Description | Tried it in BA and BAR. Most ground, water and air units seem to ignore if AllowWeaponTarget retuns false, and attack the unit anyhow. The only exception is the com, who respects that until something fires at it, at which point it will return fire. Buildings never attack first, but they, much like the com will still fire back. | ||||||||
Steps To Reproduce | Create a gadget with these two methods. Add one a com and a builder (different teams), com will not attack the builder. Add any dmg-capable vehicle. It will attack the com and the com will fire back. function gadget:AllowWeaponTarget(attackerID, targetID, attackerWeaponNum, attackerWeaponDefID, defaultPriority) return false, 1000 end function gadget:AllowWeaponTargetCheck(attackerID, attackerWeaponNum, attackerWeaponDefID) return true end | ||||||||
Tags | No tags attached. | ||||||||
Checked infolog.txt for Errors | |||||||||
Attached Files |
|
![]() |
|
gajop (developer) 2012-07-23 17:22 |
Also, would like to add that BA and BAR don't have any gadgets that contain AllowWeaponTarget and AllowWeaponTargetCheck. Also, I've added some Spring.Echo-lines in the springcontent.sdz, in those two functions to verify that I'm getting the correct results, and indeed, AllowWeaponTarget is passing false for both units. |
Kloot (developer) 2012-07-23 18:04 |
you don't seem to understand what returning false from AllowWeaponTarget does and does not do... IT DOES: * block a specific target from being considered during a weapon's periodic auto-targeting sweep IT DOES NOT: * prevent a weapon from auto-generating a target for itself (that's the job of the AllowWeaponTargetCheck callin / commandfire WeaponDef key / unit states other than fire-at-will), unless false is always returned for all targets * prevent a unit from returning fire at its last attacker (that's what the hold-fire unit state is for) * prevent a unit's command "AI" from picking a target when the unit is idle (which is again controlled by a unit's fire- and movestate) |
![]() |
|||
Date Modified | Username | Field | Change |
---|---|---|---|
2012-07-23 17:12 | gajop | New Issue | |
2012-07-23 17:22 | gajop | Note Added: 0009078 | |
2012-07-23 18:04 | Kloot | Note Added: 0009079 | |
2012-07-23 18:10 | Kloot | Status | new => closed |
2012-07-23 18:10 | Kloot | Assigned To | => Kloot |
2012-07-23 18:10 | Kloot | Resolution | open => no change required |