Jump to content
Reaxgrim

UpdateValues Function Not Running? UI Issue.

Recommended Posts

The UI updates fine at the start with default values all set apart from when i "Add" to the float it does not add it to the ui when on a Peer Client.


The Issue
Been trying to get my ui to update its values on a peer client but getting nowhere.

Script runs perfectly fine on workbench client. but foodbar widget wont update itself on a peer client even tho the float is changed properly.
 

class SCR_playerHungerNotifications: SCR_InfoDisplay
Script is component of the Character

 

When i put a Print in the UpdateValues Function. it does not even print it when on a peer client. but it does print it on workbench client.

 

unknown.png

unknown.png

 

Then when i want to add to the hunger value i call AddHunger(float value) in class SCR_HungerSystemComponentClass : ScriptComponentClass  that is on the character


unknown.png


It seems to update the value from seeing it change in console. but then the class SCR_playerHungerNotifications: SCR_InfoDisplay never updates it on the peer client. (works fine on workbench client)

 

Any ideas or help would be great.

Cheers

Reax.

Share this post


Link to post
Share on other sites
19 hours ago, Reaxgrim said:

but foodbar widget wont update itself on a peer client even tho the float is changed properly.

How do you know the float is updated properly on the client?

 

19 hours ago, Reaxgrim said:

It seems to update the value from seeing it change in console.

Where? on the workBench client? So on the Authority.

 

Sounds like a replication problem.

You show no replication for your properties or RPCs for your methods.

Only going off of what I have read, currently do not own Reforger to test( skint ). You need to either...

  • Update vCurrentHunger on the OWNER, maybe RplProp with onRplName and do BumpMe to force broadcast when the value changes on the AUTHORITY, with onRplName updating the UI on the owner
  • Do a RpcDo to the OWNER for onHungerChanged to update vCurrentHunger and update owners UI.
  • Or a mixture of both, RplProp to update vCurrentHunger and RpcDo to update UI.

RpcMethods

RplProp

Also, see examples at bottom of that page that demonstrates replicating data to proxies/owners and RPC calls.

 

Again just ideas from what I have read as I do not currently own the game.

Share this post


Link to post
Share on other sites

Yeah most of all that just went over my head 🙂 but at least i have a direction to go now.
You are correct. there is zero replication stuff in my code. 


Complete newb at this stuff so learning as i go. will have a read at what you linked.

 

thanks for the info 🙂

Share this post


Link to post
Share on other sites

Sorted now 😄 thanks to this post and also help from AK-40oz i understand the rpl stuff a bit better lol

 

 

  • Like 1

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×