This is a function which spawns in a dino, which you can play, it is triggered by a button in a widget . This function is Excecuted on server and Reliable. In the editor I tested it on Dedicated and Non-Dedicated with 2 players. The Client and Server were both able to spawn a dino.
People who play the mod tried it on a Non-Dedicated server. Only the Server was able to spawn the dino, the Client couldn’t do anything. How do I get it to work in game? Will it work on a Dedicated server, or will it be the same as on Non-Dedicated?
This function is called when clicking RMB. The function is Excecuted on server and Reliable. It simply tames all Direwolves in a range when playing as a Direwolf. (You howl and wolves will join your pack). First it checks if the Direwolves aren’t tamed by any other player yet.
I tested it in the Ark Dev Kit by placing 2 Direwolves in the TestMap and pressing RMB, this worked and the Direwolves were tamed. Sometimes it did’t work at the exact moment, but after pressing RMB 2/3 times. I thought this was caused by all the loops.
In game I tested it, but the wolves were not tamed, instead the attacked me like usual. I also could not see the message at the end of the code because that part of my HUD has disapeared, but that another thread/problem. So I am not sure if the last piece of code is excecuted.
I think the problem is caused by the last piece of the code, but I am not sure. What is wrong with the code?
Thanks in advance for answering! If you found some other improvements in the code, please let me know.
I would try adding those first. They might not be the whole problem but so far that is the only thing i can think of that could be wrong here.
About the “Server Client Notification”: I noticed that despite the description saying: “run on owning client(if server)” you will need to call this function through its own “run on owning client” custom event. Calling it directly on the server will work in the editor but not ingame.
So I need to place a ‘Switch Has Authority’ node in the widget’s blueprint and connect the Authority output to the rest to the rest of the code? Then I need to change the Replication setting of the function to ‘Multicast’?
I think your probably going to want to re-evaluate where you have your “Client Set HUD” call. It says to replicate on owning client (if server), however where you have it, it is attempting to run on the client’s end. You could also change it so that this event isn’t set up to replicate and it’ll spawn the HUD immediately after sending the RPC to the server.
Unfortunately, I can’t read the second picture because the font is too small for me.
Yes, if you could zoom in the screenshots one more step it would be much easier to read On the first screenshot i noticed two other things:
There is a connection that seems to go a weird way not sure if im not seeing this correct but it looks like one target of “Clear Rider” is connected to “as Dino Character PAD” way later in the execution. Not sure if this would just be empty and ignored but it looks like its just a little mistake.
I would be interested to see where the “Player” variable that gets passed to the “Spawn Dino” event comes from.
Tried to mark those two thing in here(sorry for my bad paint skills):