Page MenuHomeFeedback Tracker

Request to add scripting command to lock inventory access.
Closed, ResolvedPublic


I would like to request a scripting command that would disable inventory access locally for specified vehicle, it should hide "Inventory" option from action menu. This scripting command will open broad possibilities for both singleplayer and multiplayer scenarios allowing mission designer to manage what player should be able to interact with and what should not. Command should accept a vehicle and boolean inventory lock state. I suggest following syntax:

<vehicle> lockInventory <bool>


Legacy ID
Feature Request
Additional Information

Reason why there is still a need for such command even when InventoryOpened and ContainerOpened event handlers is that there are still "Take" and "Rearm" actions available on container even if you try to forbid access to it through event handlers.

Event Timeline

SaMatra edited Steps To Reproduce. (Show Details)Sep 20 2013, 8:19 PM
SaMatra edited Additional Information. (Show Details)
SaMatra set Category to Feature Request.
SaMatra set Reproducibility to N/A.
SaMatra set Severity to None.
SaMatra set Resolution to Fixed.
SaMatra set Legacy ID to 82699884.May 7 2016, 4:50 PM

LOL at whoever downvoted this, having a bad day?

@KillZone Kid
Maybe he don't know how to script... He just wants his F-35... ;)

Upvoted for great justice!

Xeno added a subscriber: Xeno.May 7 2016, 4:50 PM
Xeno added a comment.Sep 23 2013, 9:16 AM

LOL at whoever downvoted this, having a bad day?

Maybe because you can do this already quite easily without a specific eventhandler?

SaMatra added a subscriber: SaMatra.May 7 2016, 4:50 PM

@SaMatra this event handler should be called HandleInventory since you indicate to the engine whether or not proceed with default behaviour.

Well it was just a suggestion, it can be called anything.

I think this event handler needs to be done first and properly then we might not need disableSwitchClothes commands.

Tajin added a subscriber: Tajin.May 7 2016, 4:50 PM

Xeno, regardless of the eventhandler I don't think the full extend of a "lockInventory" command can be achieved right now.

To name just one: Locking the inventory of an object also involves that it doesnt show up on the actionmenu. (open/rearm/take)
Locked weaponholders also shouldn't show up in the "ground" inventory.

So how do you emulate event handler with current tools? Have a key handler for pressing inventory key if cursorTarget vehicle is not supposed to be open? If yes then what about selecting "Inventory" from menu with the mouse? What about opening Inventory from the map?

Could really do with HandleInventory EH right now to allow/deny transferring of an inventory item.

Possible passed params to the script

[unit, from, to, item, type, action]

unit - EH assigned to
from - originating weaponholder
to - target weaponholder
item - classname or even object of the item
type (optional) - weapon, magazine, item or container
action - PUT or TAKE or THROW??

if EH script returns true the transfer is interrupted otherwise proceed.

Resolved awhile ago with inventory EH that could be overriden