Jump to content
Sign in to follow this  
lexx

How to check the active vehicle weapon

Recommended Posts

Some vehicles have multiple weapons, such as the helicopters. The player can cycle between them. I'd like to check if weapon x is active right now, but I seriously have no idea how to achieve that and if it's possible at all.

It would be super fancy if someone could give me a hint or two. :)

Share this post


Link to post
Share on other sites

https://community.bistudio.com/wiki/currentWeapon

you could use this code in the init of a vehicle to see the class names so you can copy them:

_nil = [] spawn {while {true} do {hintsilent (currentweapon vehicle player); sleep .1;};};

second hint, this page [https://community.bistudio.com/wiki/Category:Scripting_Commands_Arma_3] will be your friend, read it for fun : )

Share this post


Link to post
Share on other sites

I am reading the scripting commands page since one week now. ;) I did quite a lot stuff already, but some things just aren't very obvious to me (I am not a programmer guy- and somehow I totally overlooked currentWeapon...).

Thanks for the code, it is pretty useful.

But while I am at it, I have a different, but somehow related question now: I'd like to have the player manually opening the weapon bays of the Blackfoot helicopter via the menu list. The idea is, that the player won't be able to launch rockets unless the weapon bays are opened.

Now the question is, how would I open / close the bays via script? Does this work via some animation call?

Edited by Lexx

Share this post


Link to post
Share on other sites

How elusive! Works with an unmanned Blackfoot too which is cool. Nice find, Ed!

Share this post


Link to post
Share on other sites

Yeah, could be a nice workaround. But there is a problem: As soon as you switch back to the gatling, the doors are closing again, as said above.

Now I can think of two ways how to deal with it:

1. If missile bays are open, you can't activate the gatling - rather bad, for usability and from a logical kind of way.

2. If missile bays are open and you activate the gatling, the bays automatically close - bad as well, because why do you need to open the bays manually and then they close automatically?

Best solution would be to force the doors to be open / closed, regardless of the selected weapon.

Share this post


Link to post
Share on other sites

You already can't fire without them opening right? I guess I'm confused at what you're trying to do any why you want to limit these kinds of things?

Share this post


Link to post
Share on other sites

I want to be able to manually open / close them. Right now, they automatically open as soon as you select a missile weapon and close when you switch back to the gatling. Depending on the weapon bay state I want to trigger a specific script. Right now, I am doing this simply based on the weapon the player has selected, but this also means, that the player can accidentally fire the script. I'd like to avoid that and instead have the player manually opening them.

Share this post


Link to post
Share on other sites

Hmm.. think the best bet would be to leave feed back that we want control over the weapon bays via an animation we have access to. :) Or someone to figure out what animation source it is. Didn't see anything in the config that worked.

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  

×