Jump to content
HereIsJones

Event to trigger an inventory count?

Recommended Posts

Each time a player adds a specific item to inventory, I need to fire a COUNT to determine if that player has n number of that item in inventory. When they player finally has n of the item in inventory, the mission will end.

 

I can write the COUNT code, but I can't figure out what would call it. An event handler for "adding to inventory" would work, so that each time a player picked up an item COUNT would fire for the specific object, but it doesn't look like that event exists. An Open Inventory handler exists, but not sure that will work as it's possible to pick items up using the "fast grab" key.

 

Is this just a game trigger that I set on the map and fire with some kind of game logic? And how would that fire the COUNT code every time a player added something to inventory?

 

I feel like this has been probably been done before, but I haven't been able to find anything, so if you just want to point me somewhere that would be awesome.

 

EDIT: I tried putting this in the CONDITION field of a trigger, but no luck -

 

{ _x == "FirstAidKit" } count items player  == 2

Share this post


Link to post
Share on other sites

The take event handler should do what you need.  And I suggest using inventory closed instead of opened. From both of them call a function with your count code.

  • Like 1
  • Thanks 1

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

×