ti_on_weapon_attack is all well and good, but sometimes there are just too many ranged weapon tuples to add such a trigger into. However, the hardcoded two-parameter script game_missile_launch, which is normally called whenever any agent fires or throws a weapon, can be used as an easier solution:
PS. besides, pos0 gives the weapon's position.
PPS. Thanks to Swyter and The_dragon for hinting at the possibility to use hardcoded scripts/presentations in the MS.
PPPS. Locked for now because it's already known.
("game_missile_launch",
[
(store_script_param, ":p1", 1), # agent
(store_script_param, ":p2", 2), # weapon that the missile is fired from
[do whatever you want with them]
]),
[
(store_script_param, ":p1", 1), # agent
(store_script_param, ":p2", 2), # weapon that the missile is fired from
[do whatever you want with them]
]),
PPS. Thanks to Swyter and The_dragon for hinting at the possibility to use hardcoded scripts/presentations in the MS.
PPPS. Locked for now because it's already known.