Announcement

Collapse
No announcement yet.

Pass Client Variable to Server?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Pass Client Variable to Server?

    Hi

    I've posted this same question on the help site but it hasn't been getting any views so I figured here is a better spot to ask.
    https://answers.unrealengine.com/que...to-server.html

    All I'm trying to do is get the client to update the rendertext for all other clients.
    So far only the server can do it.


    This is the question:

    I have a 3D widget that I type stuff into.

    The stuff I type triggers this event here on another BP and sets a render text to show what I typed via the server for all clients to see.

    what happens is the text does not get updated even though the event fires.
    The owner is set to the player using it properly, that works fine.

    Click image for larger version

Name:	w5IU8eS.png
Views:	1
Size:	118.3 KB
ID:	1226023

    #2
    Hey Jimonions! "Multicast" event type is what you would be after. Currently its setting this ON the server, which may be a listen (client - Only server will see this visual update) or a dedicated (no client - no visual updates). But changing this from "On Server" to "Multicast" should easily fix this.
    Last edited by Prototype6143; 07-30-2017, 11:31 PM.
    CCG Toolkit | Mutliplayer Card Game Framework: On the Marketplace | Support Thread

    Point and Click Adventure Toolkit | Adventure Game Framework: On the Marketplace | Support Thread

    Comment


      #3
      Hey there

      When I set it to multicast the text still only changes for the client modifying it.
      Server still changes for everyone.

      This seems like such a simple thing why cant unreal handle it?

      Oh and I forgot to mention but all relevant components are set to replicate as well including the render to text.
      Last edited by Jimonions; 07-31-2017, 09:25 AM.

      Comment


        #4
        I might be overcomplicating it, but this is how I did it for my server based chat.

        1. The UI calls an even on the pawn, the event is not replicated.
        2. The event that's not replicated on the pawn calls another event, this event is replicated to "Run on Server".
        3. The "Run on server" event has a "Switch has Authority" and calls another event, this event is replicated to "Multicast".
        4. The "Multicast" event has a "Switch has Authority" and calls another event that is replicated to "Run on Owning Client".
        5. The "Run on Owning Client" calls to the chat UI to add the message.

        Comment


          #5
          Ok I tried to set it up the way you said but still no dice

          If my understanding is correct, Isn't switch authority just for checking if its client or server execution, How does it affect a situation like this? And isn't run on client just for certain single clients rather than everyone?

          also it seems to fail at the Request_Server_UpdateRenderText event for clients

          Click image for larger version

Name:	zMAp5TK.png
Views:	1
Size:	318.2 KB
ID:	1131874
          Last edited by Jimonions; 07-31-2017, 10:30 PM.

          Comment


            #6
            In which class are you on?
            If you are in a pawn, simply make "SetSpawnName" to "RunOnServer" and let the Server do a Multicast. It should work this way.

            Comment


              #7
              This is on a base actor class placed in the world.
              Last edited by Jimonions; 08-01-2017, 05:50 AM.

              Comment


                #8
                Bump still need help on this

                Comment


                  #9
                  Could you add a print string function behind all the calls to the events to see how far everything goes?

                  Comment


                    #10
                    In my setup (first picture) the server_updaterendertext event does not get fired.

                    I've just noticed this ties into some other problems I've had. I am using an interface call to trigger these events. Whenever the player "uses" something it trigger this interface event on that item.
                    What I have noticed is any server side events that need to happen just don't get get through at all.
                    In my test object I have the same kinda setup but to this time destroy the actor:

                    Click image for larger version

Name:	Y2rdF6E.png
Views:	1
Size:	167.7 KB
ID:	1132186

                    whichever chain I go through nothing happens.
                    The server_destroy event never gets fired.

                    Here is in my player controller where im using a linetrace to trigger the call.

                    Click image for larger version

Name:	idazsbZ.png
Views:	1
Size:	71.6 KB
ID:	1132187
                    Last edited by Jimonions; 08-07-2017, 11:40 PM.

                    Comment


                      #11
                      I've fixed this.

                      I just made it so that fires from the server in my player controller.
                      The weird thing was I had this setup way before but removed it and still had it work..
                      So something must have changed or I did it differently this time. Who knows, I sure dont.

                      Just basically the interface event had to be callled from the server otherwise any server related functions like destroy actor would not be fired even if they were on a seperate server custom event like my earlier screenshots.

                      Click image for larger version

Name:	3guIJnw.png
Views:	1
Size:	195.4 KB
ID:	1132261
                      Last edited by Jimonions; 08-10-2017, 01:56 AM.

                      Comment

                      Working...
                      X