#Inventory Management Optimization Advice

1 messages · Page 1 of 1 (latest)

grim mica
#

"List contains" chip?

hushed spoke
#

thanks dyno

#

I literally said no bad words at all

#

I was going to help but no, nevermind i guess not

#

how the fuck are we still getting that issue here

#

Fuck you dyno.

grim mica
#

The players list and the item itself, compare if you already have it in your inventory.

#

If true then you can't have another gun. If false then add to your inventory.

sudden hornet
#

ez

uncut flame
#

sorry if this is dumb, but why do you need to be constantly checking? Why not just check when an item is picked up?

polar zenith
uncut flame
#

I was thinking of the pick-up event for props, but I suppose custom stuff might not have that

hushed spoke
#

I know for a fact there are pickup/drop events, i just forgot what they are called

#

They were what I suggested in my response that Dyno deleted

hushed spoke
#

I believe its On Object Grabbed, or Player Grabbed Object

ember geode
hushed spoke
#

your system is horrible

#

I believe the event is global but, its easy to localize

#

I would advise a system like this for grab detection, as the event is received a little early

#

Actually, its probably even better to use For Each instead of just acting on the first element every frame

#

But yeah, you could keep track of what objects are held/not held using grab events, and you could also record the type of object using a second List<String> variable

#

then, when an object is picked up, if its type is "Gun" and gun is already contained, unequip it

hushed spoke
#

If Equals

#

If Match = 0, output here

Because the only case is 0, the "Failed" output is only executing if the list count is greater than 0, because if it was 0, it would attempt to go through the 0 exec, which is connected to nothing

ember geode
#

If the value is 0 it goes through that exec port

hushed spoke
#

yes

ember geode
#

Failed means it’s none of the values on the right that’s being detected

hushed spoke
#

Up to 63

#

fuck around and find out

#

Go to the search menu, go to the circuits menu, and just scroll through all the circuits and see if one catches your eye

#

then you can fuck around, go "oh shit thats cool" and find out

#

On Player Grabbed Object fires earlier than it should, if you try and unequip an object instantly after this is received, it will fail

#

So, instead, we do it the next frame

uncut flame
hushed spoke
#

And I care about reliability, not difficulty

hushed spoke
#

yes

#

but its the same as Update

hushed spoke
#

List Clear when done

#

oh wait, what method are you using?

#

For Each = List clear when done
First element per frame = Remove element 0 when done

#

My system should be the exact same, assuming rec room has no weird interactions

Add items into a list on grab, remove items from list on release

If an item is grabbed and you already have a gun, drop it

#

im just biased against Player Get Equipped Objects

#

I hate dominant/offhand + I hate the way its formatted