#item manipulation
1 messages · Page 1 of 1 (latest)
You should be able to do these things from the server side entirely
What methods do you use to apply the new items to the player?
I use
SCR_InventoryStorageManagerComponent::TryInsertItem when equipping new cloth [executed on Owner]
BaseWeaponManagerComponent::SetSlotWeapon when equipping new weapons [executed on Owner]
SCR_InventoryStorageManagerComponent::TrySpawnPrefabToStorage when adding items to any storage (this one works fine executed from client/owner side) [executed on Owner]
SCR_InventoryStorageManagerComponent::TryRemoveItemFromInventory and SCR_EntityHelper::DeleteEntityAndChildren when deleting entities [executed on Owner]
Something I observed, items are duplicated if you don't specify a storage container AND don't use the appropriate storage purpose. I use deposit
I specify those things, yes. I did not hehe. But I'm not having this problem
Good! Just figured I'd share some knowledge in the event you find the weirdness I did. Was driving me nuts.
Those should all work from the server side. Try only calling them there.
Probably rather an issue of you executinmg the code on client AND server accidentially.
That is what I thought, but the methods were printing out for clients that it exited since it wasn't the owner/authority. The server would execute.
The fix I had was to specify the container to add items to AND swap the purpose from ANY to deposit and that stopped duplicating items. I feel like there's something bugged in that system because that's the only thing I changed which stopped the dupe bug
if you can make a simple example to reproduce please put it onto the feedback tracker and we will have a look
good idea, I have a scenario I made for testing I can create a doc on how I tested it
Does require a player to be live, on the map beforehand. Otherwise player joins/spawns and things are synced properly
ok, will try tonight. Thx
Works on my test script, now i'm going to test it on my application.
I think that i tried this a while ago, and didn't work. Something changed in some update?
Seems to be "working fine", i forgot to say that y use SCR_InventoryStorageManagerComponent::TryRemoveItemFromInventory to, and is failing when executed on server. Should i use another one?
Some of the scripted ones might be designed for client side usage. look at the base class, those all work from the sever side.
And yes we updated the inventory to allow server side manipulation a while ago during one of the 0.9.X updates
I tested it with TryRemoveItemFromStorage and TryDeleteItem but both fail when testing on localHost + PeerTool or dedicated server
