Hi ! In my game you can equip items from a item struct. The Item struct of the equiped item is set to replicated. Each time i equip or unequip a item a custom event gets fired that is set to “Run on Server”. This is where the game crashes. If i run the game in singleplayer the crash will not happen. I can build the game with no error and the game does not crash when i equip a item. So it has to be a error in the editor.
Show your code. And no, it doesn’t have to be an editor error. Not crashing in single player is a far cry from “it must work in multiplayer or its the editor’s fault.”
no. If i untatch the itemstruct it dosent crash ether. I had this problem before but fixed it by removing the itemstruct entirely and readding it. After that i modifyed the level and the problem was back again. I dunno if unreal just cant replicate item structs or not.
You should be able to. I do it all the time in c++. What I will suggest, which may fix your bug and improve the security of your game, is to change where and what you send to the server.
Currently, you’re doing all of your equip logic on the client and then just telling the server the result. I suggest you change your On Use function to a server event. Then you only need to replicate a slot id and you get the opportunity to tell the client what he’s doing isn’t allowed before he does it.
You’d need to then set your equipped item and hold type values to be replicated (not with an event, just regular replication.)
Most of it. The inventory is client side. It dosent really matter to be honest because its a coop game. If they want to cheat they can. Things like Combat are managed by the server. I found out that my Itemstruct i causing the problem. I try to change it to only send the item ID
I fixed it now ! I only send the item ID now. It looks like that ue4 dont like replicated structs. I basicly send the ID to the animBP and the animBP gets the item struct using the id. I will mark the post as solved. Thanks for the help pal !