Jump to content
Sign in to follow this  
rejenorst

backpackspacefor (anyone got this working?)

Recommended Posts

I've been trying to use this command and I am having no luck with it, I may be doing something wrong

_jk = backpack _unit

_jk backpackspacefor "AK_74"

I've also tried magazines

You can fit weapons into the backpack, but anyway I can anyone point me in the right direction on how to properly use the command? I get config error messages popping up on screen when I use it.

Its highlighted in red on the biki: http://community.bistudio.com/wiki/Master85%27s_Sandbox

Is this still being implemented?

Share this post


Link to post
Share on other sites

From the comref:

backpack backpackSpaceFor weapon or magazine type

Operand types:

backpack: Object

weapon or magazine type: String

Compatibility:

Version 5501 required.

Type of returned value:

Array

Description:

Returns how much space is in backpack for given weapon or magazine.

Example:

[weapons, magazines] = backpack backpackSpaceFor "m16"

Share this post


Link to post
Share on other sites

I think the command is implemented but it's currently buggy.

e.g. if you check for "m16A2GL" it throws an error (only the first time used in the mission) because it doesn't find a magazine with the name "m16A2GL"

but the returned result [1,14] is correct (at least the first part)

-> 1 m16a2gl fits into the backpack

e.g. if you check for "timebomb" it (throws an error and) returns for an empty czech backpack: [14,7]

->7 timebombs fit into the backpack

e.g. if you check for "m136" it (doesn't throw an error and) returns for an empty czech backpack: [1,2]

->1 m136 (weapon) or 2 m136 magazines fit into the backpack

it looks like if the magazine/weapon name is not known that the according part of the result is the number of free slots in the backpack.

Share this post


Link to post
Share on other sites
I think the command is implemented but it's currently buggy.

e.g. if you check for "m16A2GL" it throws an error (only the first time used in the mission) because it doesn't find a magazine with the name "m16A2GL"

but the returned result [1,14] is correct (at least the first part)

-> 1 m16a2gl fits into the backpack

e.g. if you check for "timebomb" it (throws an error and) returns for an empty czech backpack: [14,7]

->7 timebombs fit into the backpack

e.g. if you check for "m136" it (doesn't throw an error and) returns for an empty czech backpack: [1,2]

->1 m136 (weapon) or 2 m136 magazines fit into the backpack

it looks like if the magazine/weapon name is not known that the according part of the result is the number of free slots in the backpack.

This seems to be the case. I continually get errors, tried pipebomb, AK_74, M4A1 etc. I sometimes get the space in the hint but still get the error.

Thanks for the reply.

Share this post


Link to post
Share on other sites

Because we lack scripting commands to check what's already in it. I've barely tested the command, and didn't experience any errors then. Could have been lucky though I guess.

Share this post


Link to post
Share on other sites

I usually die before I even get a chance to access my backpacks anyway! :p

Share this post


Link to post
Share on other sites
Why bother with a broken command when you already know how much a bag can carry?

Because I am making or testing a mission concept where the AI can place weapons in a backpack and pull them out again if needs be. Do not question my intelligence lol joke :)

Share this post


Link to post
Share on other sites

I've added a ticket for this over at DH.

http://dev-heaven.net/issues/19235

It seems the command will return correctly if the weapon classname is the same as the magazine classname (like "Javelin" or "Stinger")

RPT spam is generated when the command is used on something like "100Rnd_762x51_M240", where there is no equivalent cfgWeapon (or "AK_107_kobra" where there is no equivalent cfgMagazine).

Has anyone else had any different (or similar) observations?

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  

×