WeaponFired
Posted: 27 Nov 2015, 12:11
There seems to be something wrong with the WeaponFired event at least for Java AI's:
1) Listening to WeaponFired as a Java AI seems to never produce any results.
2) Documentation says that "This AI event is sent when certain weapons are fired. For performance reasons, it is not possible to send this event for all weapons. Therefore, it is currently only sent for manuall-fire weapons like for example the TA Commanders D-Gun or the Nuke.".
3) Code seems to say that WeaponFired is fired for every shot in a salvo, without checking for manualFire, and is sent to the AI which controls the team's units:
None of those statements are pairwise compatible. HALP! Does anyone know anything? Should i mantis this? Do CPP or C bots suffer from this? Is something else wrong?
1) Listening to WeaponFired as a Java AI seems to never produce any results.
2) Documentation says that "This AI event is sent when certain weapons are fired. For performance reasons, it is not possible to send this event for all weapons. Therefore, it is currently only sent for manuall-fire weapons like for example the TA Commanders D-Gun or the Nuke.".
3) Code seems to say that WeaponFired is fired for every shot in a salvo, without checking for manualFire, and is sent to the AI which controls the team's units:
Code: Select all
Weapon.cpp:512 (in UpdateSalvo, unconditionally)
owner->commandAI->WeaponFired(this, searchForNewTarget);
CommandAI.cpp:1544 (in WeaponFired, unconditionally)
eoh->WeaponFired(*owner, *(weapon->weaponDef));
EngineOutHandler.cpp:477 (in WeaponFired, unconditionally)
DO_FOR_TEAM_SKIRMISH_AIS(WeaponFired(unitId, defId), teamId);