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"

Posses a pawn as a client on dedicated server

How do I posses a pawn as a client human controller when connected to a dedicated sever? My setup works in single player and on a hosting player but as I understand my RPC calls don't work in a dedicated server environment because the pawns are owned by the server. How are you supposed to create enter-able vehicles that are owned by the server?

Product Version: Not Selected
Tags:
more ▼

asked Sep 02 '14 at 06:56 PM in Blueprint Scripting

avatar image

Wobbleyheadedbob
68 6 9 8

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

3 answers: sort voted first

Took me long enough to respond :P

I got it sorted in the end. Using an interface I was able to request control of a player pawn from the Client to the Server.

more ▼

answered May 13 '16 at 01:32 PM

avatar image

Wobbleyheadedbob
68 6 9 8

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

You can have server function call from Player Controller to Posses the vehicle.

This is my set up, you can do something similar to the way i do to switch vehicle, but right now it got error when exit the car.

https://answers.unrealengine.com/questions/82960/network-vehicle-bug-when-switching-between-vehicle.html

more ▼

answered Sep 03 '14 at 07:07 AM

avatar image

Duncan Dam
3.1k 121 50 164

avatar image Wobbleyheadedbob Sep 03 '14 at 08:36 AM

Thanks, I'll give that a try.

avatar image Wobbleyheadedbob Sep 07 '14 at 12:01 AM

I just realised something, this solution wont really work long-term as I'd have to define a million different interaction variations within my player controller. I want to use my "Use" key for pushing buttons, opening doors, pulling levers, entering vehicles etc. Surely this graph should be defined within the object you wish to possess?

avatar image Duncan Dam Sep 08 '14 at 02:14 PM

Yes, this just fast prototype, I have a special solution for this but it require coding though, i make some special interact component for any object i want to interact, then in object blueprint i can create a new event and bind that to special function in component, when player walk over it will allow player to press interact key then trigger that special function along with event bind into it.

For blueprint only you can do this too, make event dispatcher in player controller blueprint, every time you press it will call that function and from other object you can bind that function with object blueprint event, it will do the same. You will wanna to add overlap comp so when you walk over it will bind event and end overlap it will unbind it, so you only activate whatever you want.

Kind of long explain but i suggest you look for how to use event dispatcher, it's super useful.

avatar image Wobbleyheadedbob Sep 08 '14 at 03:17 PM

Thanks, that sounds a lot like the solution I've been mulling over in my head but wasn't sure how to trigger an event in the player controller on overlap of the vehicle/button trigger volume. I'll have a look into event dispatcher and let you know how I get on.

avatar image Atheist91 Jul 29 '16 at 02:21 PM

How about make an interface . Inside of it, make a function "Interact" (or w/e you want), and then every object you'd want to be able to interact with (openning it, picking it up, moving, etc) would have just to implement this interface and its functions. Each class would have its own implementation of that (or these) functions from your interface and would handle interaction on its own.

avatar image Wobbleyheadedbob Jul 29 '16 at 02:22 PM

I have this working now. I was trying to resolve the question.

PS: thanks for your response though, my solution has this in place :)

avatar image Atheist91 Jul 29 '16 at 02:28 PM

Oh.. didn't see your last comment. xD

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

Well I managed to make some progress but things are still not quite there, my characters are able to enter/exit the vehicles but the vehicle movement doesn't seem to be replicated to the other client despite the server actually carrying out the movement operations. If I make the players swap vehicles after having moved them the true(server) location suddenly updates on the client. WTF?!?!

If I set the vehicle as the default player pawn in a custom game-mode everything works perfectly which suggests there is still something wrong with the way I'm doing the possession.

more ▼

answered Oct 08 '14 at 11:41 PM

avatar image

Wobbleyheadedbob
68 6 9 8

avatar image Wobbleyheadedbob Oct 09 '14 at 12:50 PM

Seems the vehicles that I was remotely controlling were too far away in my level. I moved them A LOT closer to the origin and suddenly I can see the vehicle moment and fired projectiles appearing on both client's. Seems proximity is a factor? Proximity to what though?

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
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