Client side code only works for host in MP

I know this is (likely) the wrong way to do this, but I don't know the right way to go about it. This doesn't need to be replicated at all, this is an entirely client-side bit of functionality. This setup works for the MP host, but not for clients, and I'm not quite sure where to start with solving this.
No description
Solution:
Should I mark this thread as solved and make a new one, seeing as I originally misdiagnosed the problem? It's not that client side code doesn't execute, it's that custom bindings aren't working on a select number of keys for clients in a multiplayer session....
Jump to solution
45 Replies
D4rk
D4rk3mo ago
Where did you put that code? I usually run keybind logic from a client-only subsystem https://discord.com/channels/555424930502541343/601030071221878784/1285736187792851005
The Urban Goose
The Urban GooseOP3mo ago
This one is in an actor (which will probably be it then) But my other mod uses a subsystem to process the input and has the same issue, so IDK Oh I just realised I am spawning that subsystem on the server
D4rk
D4rk3mo ago
Is this for the train mod?
The Urban Goose
The Urban GooseOP3mo ago
Gonna try that other mod with the subsystem set to client only, and if that works, I'll rework the orignal thing to also be client only Yeh
D4rk
D4rk3mo ago
For trains, you only need to create a mapping context and set its parent context to MC_Trains. THe context will be valid when the player possess a train
The Urban Goose
The Urban GooseOP3mo ago
First person vehicles uses the subsystem, the train interiors mod still the input logic in an actor that gets spawned as a child actor of the train That's all already in
D4rk
D4rk3mo ago
If the keys are on the child actor you might have to add the mapping context manually, not sure about that
The Urban Goose
The Urban GooseOP3mo ago
It worked for me as the host, I believe the problem is that things are set to replicate, testing with the subsystem right now
The Urban Goose
The Urban GooseOP3mo ago
Yeah, I don't get what I'm doing wrong This is in the Vehicle Camera Switch subsystem, spawned on client only, and yet it still only works for me as the host. If another player joins me, with the same version of the mod installed, they cannot switch camera perspective, and there is no log output for any of this.
No description
The Urban Goose
The Urban GooseOP3mo ago
No description
The Urban Goose
The Urban GooseOP3mo ago
I know I have a different cast to node, that's because I couldn't get the one without the exec pins (I'm also not sure it's strictly necessary)
D4rk
D4rk3mo ago
What does setting that bool actually do? Where does your code get that value and make the change
The Urban Goose
The Urban GooseOP3mo ago
That's the entire subsystem. The bool gets called like this from another BP
No description
D4rk
D4rk3mo ago
This is probably an authority issue and you'll have to call or set something through an RCO for the clients to have the ability to make the change. It only works for the host (server) because they always have the authority
D4rk
D4rk3mo ago
Multiplayer :: Satisfactory Modding Documentation
Although not all mods need special code to handle multiplayer, it’s important to create your mods with multiplayer in mind. Adding s...
The Urban Goose
The Urban GooseOP3mo ago
Could it be because I'm changing the camera with a component that moves the camera? The component is attached to the vehicles with an SCS hook I've been to that page and I don't understand it.
D4rk
D4rk3mo ago
I recommend logging both the server and client and see where the execution is failing for the client
No description
D4rk
D4rk3mo ago
Which parts do you not understand?
The Urban Goose
The Urban GooseOP3mo ago
So both me and the person joining me got Server begin play here:
No description
The Urban Goose
The Urban GooseOP3mo ago
Just realised that that text in the log is entirely wrong for what I'm testing lmao I was just inputting something
The Urban Goose
The Urban GooseOP3mo ago
This one just doesn't work on the client
No description
D4rk
D4rk3mo ago
That is from a client only subsystem?
The Urban Goose
The Urban GooseOP3mo ago
I think so parent class is mod subsystem How do I check to make sure?
D4rk
D4rk3mo ago
This.. and it looks correct
The Urban Goose
The Urban GooseOP3mo ago
Yeah Works for me, doesn't work for clients
D4rk
D4rk3mo ago
Then I have to assume the mapping context is not valid for the failing client
The Urban Goose
The Urban GooseOP3mo ago
Any ideas on why? I got nothing
The Urban Goose
The Urban GooseOP3mo ago
Input Action and Mapping Context:
No description
No description
D4rk
D4rk3mo ago
You might try logging this somewhere in the client subsystem, but I'm not sure what to trigger it from. The key event doesnt work and begin play is too early
No description
D4rk
D4rk3mo ago
Also, try switching parent contxt from MC_Vehicles to MC_Trains
The Urban Goose
The Urban GooseOP3mo ago
Oh, sorry to clarify: this is for vehicle first person right now (I only have a subsystem set up for that) The train first person mod still isn't using a subsystem
The Urban Goose
The Urban GooseOP3mo ago
Oh also the get display name for the player controller returns different IDs for both me, and the person joining my game
No description
D4rk
D4rk3mo ago
Ya, that's normal, each player has their own controller. Different actor different name.
The Urban Goose
The Urban GooseOP3mo ago
That's what I'm saying Different player controller, as expected So why isn't the input working on clients?
D4rk
D4rk3mo ago
No the client subsystem should spawn ForEach player, it should work for all of them.
The Urban Goose
The Urban GooseOP3mo ago
But it doesn't though
D4rk
D4rk3mo ago
So you dont see a begin play log for each client?
The Urban Goose
The Urban GooseOP3mo ago
One sec, I'll try it one more time. resetting keybindings on the client It seems to be related to the fact it's bound to V? Ok this is weird, I believe it might be a conflict between vehicle first person and train first person The client was now able to go into first person
D4rk
D4rk3mo ago
lol classic keybind confilct Try checking ReserveAllMappings in the input action
The Urban Goose
The Urban GooseOP3mo ago
WHAT??? Ok So It's V specifically that doesn't work on clients Some other keys work Yes Ok so the host can set any key, clients can only set keys not used in other contexts V and B don't work
D4rk
D4rk3mo ago
V is bound to SetPath in the parent (MC_Vehicles). You cannot override the parent. If you insist on using that key, you'll have to null the parent context, add the mapping context manually, and give it a higher priority
The Urban Goose
The Urban GooseOP3mo ago
I think F worked (person I'm testing with is AFK and I forgor) Default is N, the client rebound set path And again, it works for the host if you do the rebinding The client rebound Set Path to N and change perspective to V That does not work Set path on V and change perspective on N does work Both work for the host V is also the scanner, maybe that's why? But still, why does it work for the host and not clients?
D4rk
D4rk3mo ago
Thats a player action bind, and should be overriden when in vehicles I don't know, never encountered that before.
The Urban Goose
The Urban GooseOP3mo ago
hmm Switched the train mod over to a subsystem, that now works as well, but has the same issue where keys like V and B don't work I still think it may have something to do with the fact that those keys are used on foot I still have absolutely no clue what could be causing this still, if anyone's got any ideas, feel free to tell me, I'm happy to hear any suggestions
Solution
The Urban Goose
The Urban Goose2mo ago
Should I mark this thread as solved and make a new one, seeing as I originally misdiagnosed the problem? It's not that client side code doesn't execute, it's that custom bindings aren't working on a select number of keys for clients in a multiplayer session.
Want results from more Discord servers?
Add your server