View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0000675 | Spring engine | General | public | 2007-11-10 18:33 | 2007-11-14 20:55 |
| Reporter | KDR_11k | Assigned To | imbaczek | ||
| Priority | normal | Severity | feature | Reproducibility | N/A |
| Status | resolved | Resolution | fixed | ||
| Summary | 0000675: [patch] BlockShotX can force a retarget | ||||
| Description | This patch adds a third argument to BlockShotX that, like the second, reacts to being changed in the function itself. If this argument is changed to true the weapon will avoid the target BlockShotX was called on, i.e. it acts as if the target was in the badTargetCategory: Retarget regularly and greatly reduce their targetting priority. This is very useful for any script that wants to prevent a weapon from shooting at certain targets without having it lock down completely every time an unwanted target is chosen (because it can't shoot at the target but the weapon keeps aiming at it), e.g. when BlockShotX enforces minimum ranges. | ||||
| Additional Information | BlockShotX gets called when the list of targets is compiled now to affect the weighting. | ||||
| Tags | No tags attached. | ||||
| Attached Files | |||||
| Checked infolog.txt for Errors | |||||
|
|
IMO this should be a separate function, say BlockTargetChoice or something similar. BlockShot is too suggestive and should do just what its name implies. Anything more will be confusing. Other than that I like the idea. A more complete patch also should provide a Lua call-in (perhaps also a call-out to register receivers of a call-in for performance reasons) so modders won't have to change BOS of every unit they want this behaviour on - but that's more of a suggestion. |
|
|
BlockTarget would also have to be able to block shots since there are loads of cases where the same condition should cause a blocked shot and a changed target. I thought of it more in that context, i.e. "stop shooting and look for something else". |
|
|
Maybe BlockTarget should be called before any BlockShotX and somehow change/discard the attack command that the unit is executing? |
|
|
Okay, I restarted the idea from scratch. Now it introduces the COB call-in TargetWeight(targetID, weight), weight defaults to 65536 which represents 1.0 and is multiplied with the target's value to determine priorities. It also adds the set constant CHANGE_TARGET: set CHANGE_TARGET to x makes weaponX pick a new target. |
|
|
Added a minor change that gives less priority (instead of the default, more) to the last target when set CHANGE_TARGET was used, this improves the behaviour for weapons without TargetWeight. |
|
|
I quite like the idea, does what it says it does. I'll check this out Tuesday or so. |
|
|
unfortunately it seems that the patch has suffered from bitrot already. please resubmit? |
|
|
Must have been corrupted on your end, tombom reports he can use it just fine and Diff says it's identical to the file I uploaded. Or do you mean I should take it against a newer revision or something? |
|
|
yes, I mean it conflicts in newer revisions (apparently trepan changed some COB stuff in r4781.) |
|
|
Okay, fixed it. Trepan changed some whitespaces in the area. |
|
|
applied and compiled cleanly. testing now. |
|
|
committed this. I can't seem to get repeatable behavior with TargetWeightX (I didn't try to dig deep into target selection code though.) Gave it the benefit of doubt; it doesn't break existing functionality. r4788. |
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2007-11-10 18:33 | KDR_11k | New Issue | |
| 2007-11-10 18:33 | KDR_11k | File Added: blockTarget.patch | |
| 2007-11-10 19:15 | imbaczek | Note Added: 0001408 | |
| 2007-11-10 20:12 | KDR_11k | Note Added: 0001409 | |
| 2007-11-10 21:49 | imbaczek | Note Added: 0001410 | |
| 2007-11-10 22:09 | KDR_11k | File Added: changeTarget.patch | |
| 2007-11-10 22:19 | KDR_11k | Note Added: 0001411 | |
| 2007-11-11 08:38 | KDR_11k | File Added: changeTarget1.patch | |
| 2007-11-11 08:40 | KDR_11k | Note Added: 0001412 | |
| 2007-11-12 01:02 | imbaczek | Note Added: 0001417 | |
| 2007-11-14 16:02 | imbaczek | Note Added: 0001422 | |
| 2007-11-14 16:34 | KDR_11k | Note Added: 0001424 | |
| 2007-11-14 17:06 | imbaczek | Note Added: 0001425 | |
| 2007-11-14 17:24 | KDR_11k | File Added: changeTarget_updated.patch | |
| 2007-11-14 17:25 | KDR_11k | Note Added: 0001427 | |
| 2007-11-14 19:27 | imbaczek | Note Added: 0001428 | |
| 2007-11-14 20:54 | imbaczek | Status | new => resolved |
| 2007-11-14 20:54 | imbaczek | Resolution | open => fixed |
| 2007-11-14 20:54 | imbaczek | Assigned To | => imbaczek |
| 2007-11-14 20:55 | imbaczek | Note Added: 0001431 |