x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Replicated Stamina

Hello,

I made a multiplayer game in which the player has a stamina value changing when he runs. The variable is in the player bp and I'm calling a server event to change it.. However, when the Host loses stamina, the client loses some too; and when the client loses some, nothing happens; it's resetting to 100%.

What am I doing wrong? Thanks.

Product Version: UE 4.13
Tags:
more ▼

asked Dec 22 '16 at 10:31 AM in Using UE4

avatar image

paulchartres
12 3 6 6

avatar image Dartanlla Dec 22 '16 at 01:52 PM

This happens when your client is not using an RPC call to update the server, so then the server just overwrites the value on the client. Can you post a screenshot of how you are calling the server from the client when the client loses stamina?

avatar image paulchartres Dec 23 '16 at 07:56 AM

Here are the pics. Sorry it's a.zip file, couldn't put em all here.

bp.zip (611.7 kB)
(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

Ok, here is what seems odd to me. In Capture4,png Gain Endurance and Lose Endurance are set to replicate to server, but you are already on the server side. This could either not work entirely or create a timing issue. Try changing these two events to not replicate. I'm not sure what Endurance to Blur does, so I don't know if that is affecting you.

The delay in your Lose Endurance event could also be causing you timing issues. I would try changing the Gain Endurance and Lose Endurance events first, but if that doesn't work, take a look at the Delay node. Try removing it for testing. If that fixes it, try changing the Delay to a Set Timer node.

Also, just a personal preference of mine, but I do not use Event Tick. In theory I guess there might be times when you need it, but I have always found a way to do the same thing without using Event Tick. If used incorrectly, Event Tick can be a performance nightmare. So just something to keep in mind if you run into performance issues. In your case it probably isn't having any effect.

more ▼

answered Dec 23 '16 at 02:30 PM

avatar image

Dartanlla
2.6k 62 26 281

(comments are locked)
10|2000 characters needed characters left
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question