This was an old post without apparent solution.
With getDir you get your heading, but you dont know where your weapon is really pointing at (some degrees left from your heading, a bit low, etc). Firing a bullet and catching its velocity vector was not an option (you should not fire any round).
Now I have a possible solution based on two drop commands and selection names.
A drop command for soldier righthand selection name using righthandgetpos.sqs as the script for particle end of life and a life of 0.2 seconds for the particle.
And a drop command for soldier weapon selection name using weapongetpos.sqs as the script for particle end of life and a life of 0.2 seconds for the particle.
These scripts should get the [x,y,z] pos of respective particles in "this" after 0.2 seconds, so the angles between righthand and weapon would be quite easy to calculate.
But whatever selection name I use, the particles always summon near the feet of the soldier.
_soldier = _this select 0
drop ["cl_basic", "", "Billboard", 1, 0.2, "pruka", [0,0,0], 0,25.50,20,0, [0.1], [[1,1,1,1]], [0], 0, 0, "", "righthandgetpos.sqs", _soldier]
drop ["cl_basic", "", "Billboard", 1, 0.2, "zbran", [0,0,0], 0,25.50,20,0, [0.1], [[1,1,1,1]], [0], 0, 0, "", "weapongetpos.sqs", _soldier]
Am I missing the correct selection names or something?
Got the selection names from here:
Lowlands warrior soldier model selection reference