Jump to content
Sign in to follow this  
cuel

Getting a unit's launcher ammo type.

Recommended Posts

Has anyone figured this one out?

I'm working on a save loadout script and need this in order to give the unit the correct ammo if he had a launcher. Since the RPG comes with AA and normal AT rockets.

(weapons player) returns the launcher if a unit has one.

But (magazines player) does not return if the unit has any launcher ammo.

I've also tried backPackItems, secondaryWeaponItems, vestItems, uniformItems without results.

Share this post


Link to post
Share on other sites
There is a new command that you can also try magazinesDetail

Thanks, I'll try that once I get home.

Share this post


Link to post
Share on other sites

It does not include NLAW/RPG ammo.

How do you even gave a unit launcher ammo?

Tried with

player addMagazine "NLAW_F";
player addItem "NLAW_F";
player addSecondaryWeaponItem "NLAW_F";
// even this
player addWeapon "NLAW_F";

None of them worked.

Edit: appearently it worked when added first otherwise it would be over capacity. Would be nice with a rpt error.

Now I just need to figure out how to "load" it.

Edited by cuel

Share this post


Link to post
Share on other sites

The first line of code has been linked to the commands Biki page.

Biki:

Returns either single element array, containing class name of currently loaded in the primary weapon magazine, or an empty array if unit has no primary weapon or primary weapon is not loaded. This command is used for infantry weapons only.

[url="http://community.bistudio.com/wiki/primaryWeaponMagazine"](primaryWeaponMagazine player)[/url]
(secondaryWeaponMagazine player)
(handgunMagazine player)

I'm currently searching for a solution as to how you add launcher ammo, hence how I stumbled across this post.

- NerdMod

Share this post


Link to post
Share on other sites

If you know the classname, this should work

_unit addMagazine "NLAW_F";
_unit addWeapon "launch_NLAW_F";

Or do you want to know how to find the classname?

Share this post


Link to post
Share on other sites
If you know the classname, this should work

_unit addMagazine "NLAW_F";
_unit addWeapon "launch_NLAW_F";

Or do you want to know how to find the classname?

Yeah I've tried this but it just doesn't work for me... I get the launcher, just not the ammo. I've tried running said commands on initialization, and at run-time. I've also tried a magnitude of other commands but still the launcher ammo continues to be elusive.

Share this post


Link to post
Share on other sites

Same problem with me last week. Could not add the rockets for the NLAW.

Share this post


Link to post
Share on other sites

Make sure the vest and uniform is added before.

Share this post


Link to post
Share on other sites

Don't you have to have a backpack to store rockets?

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  

×