Jump to content
Sign in to follow this  
madrussian

"Weapon direction" impossible to detect in some cases (non-turret)???

Recommended Posts

I can generally get the weapon direction for any desired turret, with a bit of help from UNN's thread here. However, it appears this technique may not work in certain cases.

Normally, to get a turret's weapon direction, you simply get the "body"/"gun" values from CfgVehicles, and use them to compute the weapon's direction (via animationPhase... detailed in UNN's thread). Normally, this technique works like a charm.

However, with Mi17_rockets_RU, the rockets ("57mmLauncher") are fired from the pilots seat (driver). They are NOT in a turret and thus do not have "body"/"gun" values. (Also, as expected, you can't simply use weaponDirection, because it's not a weapon of the main gunner, the Crew Chief in this example.)

I'm pretty stumped here. Any ideas on how to get weapon direction is this case? :)

Share this post


Link to post
Share on other sites

Well, since the launchers are hardmounted and not moveable, i think guessing that weaponDirection == vehicleDirection could do the trick. But that is just a really wild guess.

Share this post


Link to post
Share on other sites

While using the animationPhase is a convenient way of grabbing a weapons direction in degrees. It was only really relevant in the old days when we didn't have commands like weaponDirection e.t.c

It can still be used, but as you say, you would have to work your way through the turret configs to find out the animation names for multiple turrets. With weaponDirection, you can use assignedVehicleRole and the crew command, to obtain info for multiple turrets.

However, with Mi17_rockets_RU, the rockets ("57mmLauncher") are fired from the pilots seat (driver). They are NOT in a turret and thus do not have "body"/"gun" values.

For those type of weapons, if I remember correctly. There isn't any directional info associated with them, because it's assumed they always point forward. You can grab their start positions from selections, like:

memoryPointLMissile="Missile_1";

memoryPointRMissile="Missile_2";

memoryPointLRocket="Rocket_1";

memoryPointRRocket="Rocket_2";

That only applies to aircraft. If for example it was a SAM system, then you can revert back to the turret direction.

So I think it's a case of working your way through the config and deciding how each weapon is to be treated. But I think it's safe to say, if it isn't attached to a turret, it will point in the same direction as the vehicle.

Although I'm not the best person to talk to when it comes to aircraft configs.

Well, since the launchers are hardmounted and not moveable, i think guessing that weaponDirection == vehicleDirection could do the trick. But that is just a really wild guess.

Guess I wasn't far off if Myke can also confirm it.

Edited by UNN

Share this post


Link to post
Share on other sites

Thanks for the responses guys.

Myke;1874303']Well' date=' since the launchers are hardmounted and not moveable, i think guessing that weaponDirection == vehicleDirection could do the trick. But that is just a really wild guess.[/quote']
For those type of weapons, if I remember correctly. There isn't any directional info associated with them, because it's assumed they always point forward.

Seems like perhaps a reasonable assumption. Anyone know if in real life rocket tubes are 100% straight with the vehicle? Seems like maybe they might want them pitched slightly downward instead? I could make an assumption one way or the other here, but it's very hard to test this ingame without a precise way (direct or indirect) to calculate weapon direction.

While using the animationPhase is a convenient way of grabbing a weapons direction in degrees. It was only really relevant in the old days when we didn't have commands like weaponDirection e.t.c

It can still be used, but as you say, you would have to work your way through the turret configs to find out the animation names for multiple turrets. With weaponDirection, you can use assignedVehicleRole and the crew command, to obtain info for multiple turrets.

When I check the weaponDirection spec, it looks like:

Array = vehicleName weaponDirection weaponName

Please correct me if I'm wrong or there's another way of doing it, but seems pretty clear that weaponDirection only accepts a vehicle and a weapon, and not a turret path?

And the comments on the spec page below the command certainly appear to support this assumption, and point me to your thread UNN regarding the animationPhase method. :confused:

So indeed the only way I've ever been able to get a turret direction is via the animationPhase method (and yes it works perfectly after a calculation to get [x,y,z] direction, but it's always been a bit unwieldy). Is there really another more direct and convenient way???

And if it turns out there is no other way and BIS is reading this, we could really use a new turretDirection command, that accepts all possible turret paths including [-1] for the driver seat!!! :D

Again, many thanks guys for your comments and info. :)

Edited by MadRussian

Share this post


Link to post
Share on other sites
Please correct me if I'm wrong or there's another way of doing it, but seems pretty clear that weaponDirection only accepts a vehicle and a weapon, and not a turret path?

I read somewhere on the forums that you can use:

(commander <vehicle>) weaponDirection "<weapon>"

Although I haven’t tried it myself.

If so, then you can use the assignedVehicleRole and crew command to identify who is in a turret. As they will have a turret path assigned to them.

After that you just need to get their weapon, or animation source. Depending on which is easier.

Share this post


Link to post
Share on other sites

Let's see... I have indeed been using the assignedVehicleRole/crew method to determine which turret fired.

However, unfortunately as for determining weapon direction, it seems that the weaponDirection command still only operates on the main gunner. So I suppose for turrets, we are indeed stuck with the animationPhase method to determine direction, until BIS gives us something like a turretDirection command.

Anyhow, thanks again guys.

btw- Seems I'm still stumped on getting weapon direction for driver seat weapons. Are they really all bore-sighted 100% straight forward? Anyone know for sure? Any insight from BIS devs?

Share this post


Link to post
Share on other sites

I couldn't remember where I read about the weaponDirection work around. But I probably got it wrong. Think it should be something like:

_com=commander (vehicle player);
_com weaponDirection ((weapons _com) select 0);

In other words, if the unit is in a turret, you can grab the direction of his personnel weapon and that will return the actual turret direction. But again, I haven't tested it fully.

Probably won't help for the driver’s position, but worth a try.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×