#multiplayer

1 messages ยท Page 390 of 1

sharp pagoda
#

You're RPCing the server, so this code will run with authority anyways

#

So first, make sure this works if you are the host

sharp spire
#

if you are the host, you can see each players equipped weapon, but each client doesnt see any equipped weapons on any players including their own

#

even when the listenserver sees thenm

#

them*

sharp pagoda
#

Alright, that's the expected behavior. So what you need to do now is move that code into a Multicast RPC

#

Called from the server RPC, that is

sharp spire
#

so a server calling a multicast directly?

#

one sec

sharp pagoda
#

Yep

sharp spire
#

something went wrong again @sharp pagoda lol

#

client gets sent to a weird camera angle almost as if the pawn was destroyed

sharp pagoda
#

That's odd behavior, I'll take a look at it when I have the time

sharp spire
#

no problem thank you for all your help

glacial pollen
#

@sharp spire ah yea. That bit me in the ass too

#

While im at it, let me give yall another PSA

#

Both times they told me to make a (private, no one will see it, so its useless for others with the same issue) report via their new tracking system

sharp spire
#

@glacial pollen do you know why the last tidbit i posted causes clients to lose its pawn?

glacial pollen
#

skeletal mesh is replicated right?

sharp spire
#

topdowncharacter and both mesh and socket component are replicated

glacial pollen
#

May not help with this, but its beautiful

#

It auto breakpoints anytime there is a null ref

sharp spire
#

ill try

#

it didnt do anything lol

glacial pollen
#

Hey not everyone has the authority to change another players mesh?

#

You should just change the mesh for that character on the server copy

#

component replication for that mesh should automatically send it to the players

sharp spire
glacial pollen
#

You have to make sure that whoever calls that function actually has authority over that object

#

or the server will say f u, and ignore it

#

unless you have clients changing other peoples characters

sharp spire
#

its being ran from the controller, using getControlledPawn and breaking down the itemStruct for the mesh

#

getControlledPawn is the Pawn pin being sent in, and New Mesh is the itemStruct Mesh

glacial pollen
#

is the new mesh replicated?

#

You may have to re-set replication on that component after changing the mesh?

sharp spire
#

its part of an Structure idk how to set that to replicated without promoting

#

hm

glacial pollen
#

well you are sending a reference from a local controller that the server is not aware of

#

Are you storing that structure on the server side controller?

#

Cause then you could just replicate the structure and reference it locally

#

And then the server will be like, Ah yea, I got that right here

sharp spire
#

so going with that theory, the Struct is actually part of an Array attached to the player controller again lol

#

but the pawn holds the Socketed Skeletal Mesh. should i consider moving my equip event to PlayerState?

glacial pollen
#

Which side does the Struct reside? Server side/ Local Side?

#

Like does the Server create the struct for you, or are you creating it locally?

#

PlayerControllers have "two sides"

#

But server is authoritive, so you can't send data backwards on a replicated variable, without explicitly sending and setting it server side

#

For example, if I have float_test = 0, in my playercontroller, and I change it to 20 LOCALLY, and then try to reference float_test, in a server side controller's function, it will see 0

#

You have to send 20, to the server, and tell the server to set float_test = 20; before you can reference the updated variable

#

Or people would just be able to cheat all day long

#

People can still hijack the RPC call and put whatever value they want in there, but there you just run sanity checks

sharp spire
#

okay i think i understand

#

so any variables being sent to the server from a controller need to be replicated first otherwise itll grab the local number instead?

glacial pollen
#

kind of

#

variables that are replicated : when changed on server, server will tell owning client automatically

sharp spire
#

so for example my equip function sets the array element(0) to be the struct, then sends that element to be a replicated component. but techincally its not working because the server sees the equipment array(0) as nothing still?

glacial pollen
#

However, if you modify a replicated variable LOCALLY, the server will not see it

sharp spire
#

sorry that was a terrible explaination on my end lol. yes im modifying my array locally and not on the server so the server still sees a blank array, right?

glacial pollen
#

Its okay, this is speaking of References

#

Hard values are okay to send

sharp spire
#

even if im sending my local changes to the server to replicate, its blocking it for obvious cheating reasons?

#

hard values as in not replicated?

glacial pollen
#

Like I can send character CLASS "Char_Base"
but I could NOT send character REFERENCE "Char_Base"
Because the server does not have THAT reference you have

#

Hard values, as in anything that is NOT an object

#

int/float/string

#

class/name

sharp spire
#

im not actually creating any references before the RPC :\

glacial pollen
#

Whenever you reference ANYTHING during a server function, it will only see the server version

sharp spire
#

ooh during..

glacial pollen
#

(if it even exist)

#

y7ea

#

if you want the server to "see" it, you needs to "send" it

sharp spire
#

so my issue is using the controller pin to reference my top down character; it isnt going to work

glacial pollen
#

the controller pin is valid because the server always has a copy

#

the mesh however

sharp spire
#

im referencing it durintg the server call from a controller pin

glacial pollen
#

unless the server knows what mesh reference...

sharp spire
#

aah

#

got it

#

well, mentally lol

glacial pollen
#

I'm still wrapping my head around it

#

ALSO, MAPs and SETs do not replicate, even in a struct ect

#

If you use em, split em up, and send them in pieces and reconstruct on the other side

sharp spire
#

what if im splitting them up, then sending a piece i need from it. that would work wouldnt it ?

#

ill send my whole function one sec

glacial pollen
#

You are not using MAPs or SETs that I can tell, I was just giving you a heads up

glacial pollen
#

You are sending the server a REFERENCE to an object (New Mesh)

sharp spire
#

so i need to promote item to a replicated variable and break that down instead?\

glacial pollen
#

And here the local controller is REFERENCING a local copy of a struct, that is referencing a mesh

#

Just make the struct replicated, but you need to create the struct on the server

sharp spire
#

so where i set the array element, it should be set on the server instead?

glacial pollen
#

yes

#

whatever you put into that array needs to exists on the server side, and then you put it into a server side array (all replicated of course, so the client knows whats going on)

#

And since you are using multicast, you might want to look into using RepNotify instead of regular replication

sharp spire
#

right so when the equipment array gets changed by the server, itll change the skeletal mesh aswell?

#

i was curious how that worked, is the repnotify's function automatically replicated?

#

or ran through the server* i should say

glacial pollen
#

if someone is too far away to be bothered by whatever change happened (say a chest was opened on the other side of the map) the player wont know until he gets close enough, but regular replication would skip him (too far away)
repnotify will wait till he gets closer, and then tell him "oh btw this was already opened, let me show the open_chesh_mesh so you don't think its closed"

#

When your replicated array gets changed on the server, it will tell the client, and when the client says "hey server, get this mesh reference from your array and change my mesh to that"

sharp spire
#

hmmm....

glacial pollen
#

the server will look at its local copy, find the reference, and pull the local copy of that mesh, and set it

sharp spire
#

sounds so much more simple than i arranged it to be

glacial pollen
#

Just keep the mindset that everything you want to do, usually is actually done by the server

sharp spire
#

ill change that in just a moment and give it a go, thank you for sheding so much light on the topic. so to answer my question directly, RepNotify will run the function to all clients when theyre within range?

glacial pollen
#

yes

sharp spire
#

and a noob question, what decides when theyre within "range"

#

is there a cull distance?

glacial pollen
#

its hardcoded in the engine I believe?

winged badger
#

NetCullDistanceSquared under replication

glacial pollen
#

replication is a one way street, just think of that too

winged badger
#

there is also AActor::IsNetRelevantFor() and APawn::IsNetRelevantFor() overrides it

#

default is 15000 UU for distance based relevancy

glacial pollen
#

This 2 minute video will give you an overall understanding of everything discussed just now

sharp spire
#

Very handy! So I assume that a rep notify gets called from a server event?

#

So that the client and server see the changes?

glacial pollen
#

if you change the replicated variable locally, repnotify function only runs locally

#

if you change it server, then both server and client run the function

#

replication is one-way only

sharp spire
#

i think i understand, i stepped out but just stepped back in ill try it out now

#

already lost.. how do i know which value was changed during the repnotify?

#

๐Ÿ˜’

#

considering its an array

#

or at that point would i just run through each piece of equipment array and set all the meshes

#

doesnt seem to be working out well :\ can i cast and promote to replicated variable for my pawn before hand and use that in my repnotify?

glacial pollen
#

Show me where you create the array

sharp spire
#

idk how to handle that

#

gyazo isnt working... lol hold on. The array is created in the pc, and the SkeletalMesh is in the pawn

#

should they both exist in the same class?

glacial pollen
#

The array is created in the pc (as server)

sharp spire
#

to save hassle?

#

yes

#

is that what the replicated toggle technically means? created in the server?

glacial pollen
#

The skelatalMesh is spawned on the pc (server)

#

Replicated just means Server will send updated info to client

#

(automatically)

#

replication will not work, if its not created on the server

#

Server is boss

sharp spire
#

during a RepNofity, how does it keep track of the PC that called it?

glacial pollen
#

automatically

sharp spire
#

how do i reference it then :\

glacial pollen
#

???????????????????????????????????????????????????????????

sharp spire
#

lmao nevermind

#

sorry

glacial pollen
#

Wait

sharp spire
#

okay i think i need to move my equipment array to my pawn

glacial pollen
#

no

#

you really need to understand this

sharp spire
#

that would remove a lot of unnecccessary referencing

glacial pollen
#

Lets try this

sharp spire
#

alright ๐Ÿ˜ฎ

glacial pollen
#

Imagine a Dedicated server, with 1 client

#

The dedicated server will not OWN its own PC, because its not a player right?

sharp spire
#

right

glacial pollen
#

But, the server will own a COPY of client 1's PC
And Client 1 will have its own

#

So there are 2 controllers in the multiverse, but they actually both reference just 1 controller

#

If the client wants to talk to the server, it uses its copy of the PC to "bridge" to the servers copy of the PC

sharp spire
#

so the Replication toggle is the automatic bridge?

glacial pollen
#

not yet

sharp spire
#

sorry

glacial pollen
#

with this bridge, only "hard" data can be shared

#

Like numbers/letters/ types of classes

#

but you can't share an object... or ... an "idea"

#

If you want to do that

#

the server HAS to create it

#

Because replication is a special "add-on" bridge, but, its a ONE way street

#

That goes from the Server TO the client

#

This is the only way to share objects or "ideas"

sharp spire
#

OH

#

hmm

glacial pollen
#

So

#

Make the server make the array, AND any object reference "idea"

#

So the server can Replicate that "idea" to the client

#

So when the client says I want to change my mesh to a REFERENCE (an idea, object)

#

the server knows what he is talking about, because the server told him about that idea in the first place

sharp spire
#

hmm

glacial pollen
#

It takes time and fooling around to get the concept stuck in your head

#

Imaging the client is a student, and the server is the teacher

#

the studen can't talk to the teacher about something he hasn't even learned about

sharp spire
#

okay so, since my pawn is set to replicate its class, and the component is set to replicate, then the server already has a reference to these objects right?

glacial pollen
#

Yes, hopefully you spawned the character in gamemode, and told the client to posses it

sharp spire
#

i did yes

glacial pollen
#

great

#

Now, when you want to change your mesh, to your pawn, the server will know what you are talking about, (but it still doesn't know what you want to change it TO)

sharp spire
#

the gamemode switches when you join a session with the pawn as the only difference in gamemodes; thats alright right?

glacial pollen
#

This is where the array comes from

#

As long as the gamemode thats in the current map, has all the logic for spawning the array and data inside

sharp spire
#

sorry i know that was off topic

#

alright cool thank you lol

#

alright so when i want to change a skeletal mesh in my pawn the server knows what mesh it is but isnt sure of what its changing to?

glacial pollen
#

yes

#

because it did not create the array, and it did not create the items in the array

#

to the server the array is blank

sharp spire
#

okay so since its replicated the server and client both have a copy, and calling an event to the server to change the equipmentArray will let the server know of my new "idea"

#

right?

glacial pollen
#

(its VALID and not null, because you "preprogrammed" the knowledge of the array by creating the array variable in the PC

#

the server needs to know ALL the ideas you may have

sharp spire
#

the struct is in the array which is replicated and changed through the server, that gets it ALL right?

glacial pollen
#

The server teaches the client what ideas (references) its allowed to talk about

sharp spire
#

sorry if im ahead of myself

glacial pollen
#

Yes, only the server should add or remove or change anything in this replicated array

sharp spire
#

because changing it on the client would cause the server to think its cheating, right?

glacial pollen
#

in a way yes

#

clients are submissive

#

A client can mess around in its own playground, but it better not try to show the server the new sandcastle it made, cause the server doesn't know what a sandcastle is

sharp spire
#

so by changing this replicated array in my PC, simply using getControlledPawn() and casting would work? or is casting not ok in server events

glacial pollen
#

Now, if the server was like "Hey look, this is what a sandcastle looks like" and the client took it and played with it, and then showed off to the server, all is cool

#

You can change the replicated array in PC, but you must be running as the server

sharp spire
#

right right, so a server event that changes the array, causes a repnotify which then can use a cast from there without any issues?

#

casting from controlledpawn

#

because the server should know of its pawn right?

#

since its replicated?

#

sorry, the server should know of its pc's controlled pawn

#

right?

glacial pollen
#

yes

#

Once you set the array on the server, the client becomes aware of this new toy and can play with it

sharp spire
#

aah you should be a teacher, i think i finally understand

#

hopefully lol

glacial pollen
#

I did this all in the playercontroller

sharp spire
glacial pollen
#

That part is fine

severe widget
#

aw jeez man

glacial pollen
#

where is the rest of it?

severe widget
#

starting small I see.

glacial pollen
#

Starting small?

severe widget
#

I mean you're over here explaining RPCs and var rep, and he's got all this.

glacial pollen
#

I wish I could pin the last hour of messages, would make for a good session

sharp spire
#

well if equipment array is set to repnotify, would the repfunction take care of the rest? is that what you mean by the rest?

#

sorry lol

glacial pollen
#

Yea, I just wanted to see where you actually create the item

sharp spire
#

im veryt new @severe widget i wouldnt understand what i have written down if it werent for him lol

#

and others aswell, everyone has slowly led me to this point

severe widget
#

Yeah, all good.

sharp spire
#

i know you've definitely helped me aswell

severe widget
#

You're just at the deep end.

#

Don't give up though.

sharp spire
#

meh, not sure what you mean by the deep end but i wont give up

glacial pollen
#

Out of most of the help I've given this guys has always stuck through till he got it

sharp spire
#

one sec ill post my repfunction

glacial pollen
#

So this runs when you change something inside of that array right?

sharp spire
#

correct

#

the OnRep_Equipment from the array

glacial pollen
#

okay, how is the array initially populated?

#

Is it preset in the defaults, or runtime?

sharp spire
#

just empty by default

#

runtime

glacial pollen
#

Show me where you add stuff to the array

sharp spire
#

wait no

#

its populated with 12 items

#

that are blank

glacial pollen
#

ah

sharp spire
#

ill post it if you want.. lol

glacial pollen
#

yup

sharp spire
glacial pollen
#

Here in a second, im about to take you to hell and back, so multicasting will work in this case

severe widget
#

Hrm.

#

Will having a copy of the old array help you?

glacial pollen
#

I don't see the mesh?

#

(gamemode, but we wont go there yet)

sharp spire
#

its in the actor defaults, then a struct in there

glacial pollen
#

ah

sharp spire
#

you can see it broken down in my onrep function

severe widget
#

@sharp spire if having a copy of the old value of the array will help you you could TRY making your onrep take an array of the same type.

#

that works in C++ not sure if BP behaves the same.

sharp spire
#

no inputs for onrep :\

glacial pollen
#

@sharp spire So what I am seeing is that while the server is aware of the array now, the defaults for each item's actor class are set to NONE

sharp spire
#

wait i think im confused lol

glacial pollen
#

its okay, just jump back here for a sec

sharp spire
#

yes correct

#

then im setting the array item which includes an actor type

glacial pollen
#

show me that

sharp spire
glacial pollen
#

I love it

#

No references, just hardcoded data

sharp spire
#

๐Ÿ˜ƒ

#

good?

glacial pollen
#

Okay, so now show me the server equip function

#

Yes, perfect so far

winged badger
#

client authoritative about what its equipping?

glacial pollen
#

no, he wants to multicast

#

He's almost done

#

but we havn't quite gotten to the multi part

sharp spire
glacial pollen
#

(gamemode)

winged badger
#

i mean, client could cheat-swap its items, then send that RPC

#

result = not good

glacial pollen
#

you are missing a part at the end

#

you are setting NONE as the item in the array

#

Also, you need to show me this item BP

#

whoa there

#

just caught this

#

Okay you are using Get Class Defaults

sharp spire
#

yea because nothing in the class gets changed

#

its more or less a permanent reference guide

glacial pollen
#

Yea, show me the itemBP

sharp spire
#

ok one second

#

oh yea lol ill fix the none part aswell

#

didnt notice that

glacial pollen
#

yea, but before you do that, we need to solve a small issue

sharp spire
#

okay so what about this class do you need to see, its variables?

glacial pollen
#

I want to see this mesh reference

sharp spire
glacial pollen
#

Okay, its blank...

sharp spire
#

then children of that BP have a set mesh

#

lol

glacial pollen
#

ah

sharp spire
#

ill show you a child of it

#

sorry

glacial pollen
#

nah its okay

sharp spire
#

alright lol

glacial pollen
#

Why don't you just change that reference to a hardcoded class?

#

A reference is blank be default

#

Until you spawn the reference TYPE and SET the reference, no one knows what it is

#

So if you use Get Class Defaults, all references will be NONE

sharp spire
#

but technically its not getting class defaults of that master class its getting the defaults of the child class

glacial pollen
#

If you spawn the item, and just store that, you'd be gold, because internally when you spawn the item, it will spawn the mesh, and store that as the reference to itself

#

Yes, but a blank reference is a blank reference

#

You can reference a TYPE of static mesh

#

but the reference to the actual INSTANCE is still none

severe widget
#

IMO if you're using a class as a lookup table you really ought to give data tables a go

#

but you're here to get MP goin

glacial pollen
#

He has already learned the ways of Parent/Child xD

#

(which you hate)

#

or dislike xD

sharp spire
#

but are datatables hardcoded?

severe widget
#

did you teach him this

glacial pollen
#

nope

severe widget
#

kk

glacial pollen
#

Best pupil ever xD

sharp spire
#

no i learned all non-mp things on my own lol

#

well, guides

glacial pollen
#

What you want to do, is just do a class instead of object reference

sharp spire
#

i just found out about this chat two weeks ago and i started using unreal engine heavily over two years ago lol

#

it is a class reference

#

not an object refence

glacial pollen
#

Its blue = object

#

Purple = Hardcoded class

sharp spire
#

one sec

glacial pollen
#

inside of the itemBP

sharp spire
#

thats the struct my equipment array uses

glacial pollen
#

Show me the actual variable

#

The Mesh variable in itembp

sharp spire
#

then the itemactor class reference has the second set of struct

glacial pollen
#

I will assume that Mesh is in the second struct

#

show me that

sharp spire
#

yes one sec

glacial pollen
#

Okay, where it says skeletal mesh, your going to change it to skeletal mesh again, but this time pick the purple option below the default

sharp spire
#

skeletalmesh can be hardcoded?

#

it doesnt lose its idea?

glacial pollen
#

yes, but you can create the "idea" from the class

sharp spire
#

well regardless i cant have any objects right?

glacial pollen
#

the class is like the blueprint of the idea

#

Just bear with me

sharp spire
#

alright sorry lol

glacial pollen
#

This will all make sense soon

sharp spire
#

one second tho

glacial pollen
#

Yes, changing it is going to screw up some stuff

sharp spire
#

changing that to a class reference, i just have to go through and make sure i didnt get any errors real fast

glacial pollen
#

already expecting it

sharp spire
#

yea me too lol i havent looked yet

glacial pollen
#

just change everything to class

#

(just the Mesh variable)

sharp spire
#

luckily this is a new project and it was only refenced once.. lol

glacial pollen
#

Alright, now show me the equip func again

sharp spire
#

how do i set a skeletalmesh from a class ._.

glacial pollen
#

you don't but you will see

sharp spire
glacial pollen
#

not the on rep

#

the actual equip

sharp spire
#

right but i cant continue until thats fixed...

#

the end is missing the new mesh because its now a class

glacial pollen
#

open the itemBP child

sharp spire
#

all it lets me do now is set its type to skeletal mesh.. lol

glacial pollen
#

yea one sec

sharp spire
#

just fyi

#

my method with the skeletal mesh as is, seemed to work just needed a multicast

#

imo

glacial pollen
#

go back and do the third option, the soft object

sharp spire
#

but im still following lol

glacial pollen
#

Well shit, I tell you waht

sharp spire
#

as in the server was receiving the mesh just fine i think

glacial pollen
#

just change it back to mesh reference for now

#

We will do the multipart now

#

so set it back, and make sure the child has the mesh set again

sharp spire
#

alright all setup back to normal

glacial pollen
#

Okay, remember that bridge stuff between the two sides of the controller, Server and client side

sharp spire
#

yes i believe i do

#

i remember it, just 99% sure how it works lol

glacial pollen
#

Okay, well there is no bridge to another players controller from your controller

#

so how would you get data to another controller?

sharp spire
#

asking the server to reference it?

glacial pollen
#

yes, but where, because the the array is on YOUR controller, no one else but you and the server can see it right now

#

where is the one spot EVERYONE can talk to?

sharp spire
#

the GameState?

glacial pollen
#

eh yea

#

or gamemode

#

your choice

sharp spire
#

gamemode can have logic?

glacial pollen
#

gamestate would be nice because it

#

of course

#

gamemode can spawn SERVER characters

#

and do stuff with its own characters

sharp spire
#

like AI?

glacial pollen
#

yup

sharp spire
#

good to know o.o

#

so does that make GameState an alternative location?

#

and is GameState and GameInstance the same?

glacial pollen
#

gamestate is also shared between all players

#

Game instance is hardcoded, local only, no exeptions

sharp spire
#

so having a host session node is a good or bad idea to be held in the gameinstance?

glacial pollen
#

if you want to get data out of game instance, you need to do it from the playercontroller CLIENT side, then send it to the player controller SERVER side

#

Thats fine, because only the host needs to do that

#

the server has its own instance

sharp spire
#

i literally just have a host session event, and a news string array and its only used when in the main menu and not in a session

glacial pollen
#

but does not have a controller (unless its a listen server but for now we are sticking with a dedicated setup)

sharp spire
#

so in the future ill move my News array lol

glacial pollen
#

it'll be fine

sharp spire
#

i think that doubleposted

#

alright

#

so how do i end up multicasting an onrep?

glacial pollen
#

just change it to multi

sharp spire
#

the onrep stays?

glacial pollen
#

and move the logic around if onrep goes away

sharp spire
#

changing the Equip function to multicast?

#

oh wait hold on

glacial pollen
#

i think if its in gamestate its already multicast

sharp spire
#

not sure whats even happening...

#

when running my equip event on the server it only shows locally on the client and server doesnt see the any changes.. lol

#

is the onrep not running on the server for some reason?

glacial pollen
#

team viewer or discord screen share

sharp spire
#

i dont have either installed, im using a browser for this :\ im going to look it over and see if thats the issue

glacial pollen
#

On Rep should run for anyone who has that variable

sharp spire
#

but only for them right?

glacial pollen
#

yea

glacial pollen
#

You may not need multi

sharp spire
#

causes the clients to see the skeletalmesh locally, and the server not any at all..

glacial pollen
#

is E.RightHand replicated?

sharp spire
#

yes

#

so is the mesh its attached to, and the capsule that that is attached to, aswell as the pawn

glacial pollen
#

@severe widget Help?

sharp spire
#

i swear the onRep isnt running on the server.. lol

glacial pollen
#

It would help to see what bp those are in, it takes forever to scroll up to find

sharp spire
#

all in PC

glacial pollen
#

k

sharp spire
#

youve done enough if you want to give up for the night evo lol

#

i can just sit back and think about what ive been taught

severe widget
#

Yeah you think about what you've read. :P

glacial pollen
#

The last two pictures are in his PC

#

on rep isn't running on server?

severe widget
#

Oh I've always just called it on server.

sharp spire
#

isnt that technically called on server?

severe widget
#

not sure if that's bad practice or if OnRep doesn't fire.

glacial pollen
#

Fires for local clients

sharp spire
#

onrep has to fire, because it equips it locally

glacial pollen
#

on a server call

#

but server doesn't see the mesh change

severe widget
#

So post-replication but pre-assignment, a comparison between the existing value and the replicated value is done if they're different you get the onrep.

#

That's my understanding.

#

Now, that all sounds like non-server stuff.

#

But you know they gotta keep a delta on the server to trigger the replication at all

#

So there's no real reason why it couldn't also happen pre-replication, post-assignment.

sharp spire
#

so is the server keeping up with the changed value, but running the function locally?

severe widget
#

This is where my generalism kinda falls short.

sharp spire
#

i could try running a multicast event from the onrep function

#

couldnt i?

severe widget
#

If you're getting OnRep on clients but not on Auth (you should test), then its safe to assume for now until you get a correction from somebody else.

#

Nah, that defeats the point

sharp spire
#

and the multicast would handle the visual hange

#

hm

severe widget
#

Does you OnRep just never happen?

sharp spire
#

it happens on the client and never on the server

#

lol

severe widget
#

Alright

sharp spire
#

even though its ran as a server event

severe widget
#

So just call it manually on the server

#

OnRep isn't a server event

sharp spire
#

no but my equip function is

severe widget
#

its literally a ufunction

sharp spire
#

that sets the variable for onrep

glacial pollen
#

No, but he changed the variable during a server event

#

so he changed the server side, PC variable

severe widget
#

Yeah... did you see what I wrote?

glacial pollen
#

so server should on rep, and client?

severe widget
#

There no reason that it doesn't, but I'm not sure that it does.

#

It just logically seems like a post-rep thing.

#

OnReplication

glacial pollen
#

Okay

severe widget
#

Now, I'm perfectly fine being wrong, so if somebody who actually does know could tag me that'd be great.

glacial pollen
#

so he remove the rep notify, and just manually does it during his server event

severe widget
#

No

#

He should keep OnRep if he needs it on client s

sharp spire
#

i need my weapon to show up for all clients... thats it.. lol

severe widget
#

OnRep is better than multicast if something needs to have happened for clients

#

So if you're changing a mesh out... you could set up the mesh in OnRep

sharp spire
#

i did :\

severe widget
#

And then when you change the variable on the server, just call it on the server manually.

#

I'd have to review what all screens you've got though.

#

When I said you were in the deep end this is kinda where I was expecting this convo to go.

sharp spire
glacial pollen
#

I would just call the event on server, make the array change AND change the mesh in the same event, since the component is replicated

#

Yea right there

#

move your on rep stuff into that

sharp spire
severe widget
#

ยฏ_(ใƒ„)_/ยฏ

glacial pollen
#

Just move everything from the on rep to the server event

severe widget
#

_b.... _

glacial pollen
#

so when the server changes the replicated mesh, the client does too

severe widget
#

....but calling OnRep is the same thing and it can then also function as clientside updates....

#

(โ•ฏยฐโ–กยฐ๏ผ‰โ•ฏ๏ธต โ”ปโ”โ”ป

glacial pollen
#

well onrep isn't changing the mesh on the server, only for the client?

#

He messes with an array, that calls the onrep, and within that onrep, he is changing the mesh

severe widget
#

ยฏ_(ใƒ„)_/ยฏ

#

OnRep is literally just a function, and if the issue is that it isn't being called on the server I don't see the harm in calling it explicitly.

glacial pollen
#

Solved

#

Notice the talk about abusing this bug at the bottom O.O

#

Neat

#

"Array variables marked as RepNotify are not calling OnRep on the server when they are not directly set using a Set 'VariableName' node."

severe widget
#

Oh, yeah, ok. That makes sense.

#

So..... and for the last time just call it manually

glacial pollen
#

why not just merge that code into the server call itself?

severe widget
#

Cause calling the function will functionally do the same, and if clients are going to have to do it then you reduce code duplication

sharp spire
#

alright

severe widget
#

I want this code to run when this variable changes

sharp spire
#

so this is what ive gotten to so far

glacial pollen
#

the clients will do this twice then

severe widget
#

wut

glacial pollen
#

its a replicated mesh that he is changing

#

so if the server changes the mesh, then the clients will too

severe widget
#

does it?

#

Maybe it does.

#

If so then yeah, fine.

glacial pollen
#

Well I would hope that when the server changes the mesh of a replicated component, that the client gets updated...

#

@sharp spire Right now either way would work, either just call the OnRep manually, or just move everything out of that onrep, and just put it back into your server call

#

There is a onrep bug

sharp spire
glacial pollen
#

And the results?

hasty adder
#

Isnโ€™t it a problem if that index variable isnโ€™t replicated?

glacial pollen
#

= 0

#

lucky by default

sharp spire
#

yes but its 0 by default with 1 option coded

#

but thank you for noticing

hasty adder
#

o/

glacial pollen
#

Plus this part is ran on the server, so the client only cares about the array itself

hasty adder
#

Mp is just the greatest to work with.

sharp spire
#

i kind of like its challenge lol

glacial pollen
#

So whats it doing?

hasty adder
#

Yeah puzzles to figure out

glacial pollen
#

If you go back 2 hours in here, you will probably have a new lease on life

sharp spire
#

results are only the server sees the mesh

#

the clients dont see anything

#

theirs, or others

hasty adder
#

Howโ€™s equip called

sharp spire
#

Server sees hatchet on his pawn, and clients pawns (if they equipped it) but the clients dont see any hatchets no matter whos equipping it

#

the 2 input key as a test at the moment

#

and is a split struct

#

hardcoded basically

hasty adder
#

For fun just so this. Equip(run on server)-> equipmc->your code

glacial pollen
#

do it the way ImmutableLambda said to

#

So, back to the onrep notify

#

but after you change the array in the event, do a manual call for the onrepnotify

sharp spire
#

i tried that @hasty adder but it causes clients to lose their pawn somehow... lol

glacial pollen
#

This way the client and server both run

hasty adder
#

Lol

sharp spire
#

hmm..

glacial pollen
#

Just leave it as is, recreate the onrep

sharp spire
#

you do believe thats the best way? @glacial pollen

glacial pollen
#

I believe that OnRepNotify is bugged, and this is the best way around it

hasty adder
#

Hm you said split strict struct

hasty adder
#

Isnโ€™t a struct just a pointer and the values arenโ€™t replicated unless the values fed in are replicated?

sharp spire
#

right, so wouldnt i want to avoid that?

sharp spire
#

so keep my onrep

glacial pollen
#

So the server part will change the mesh on the server
and the on rep part will change the mesh on the client

sharp spire
#

for local reasons..

#

aah

glacial pollen
#

for bug reasons yes

sharp spire
#

ill give it a go

hasty adder
#

Plus if you ever want to do peer to peer better hope the server updates ๐Ÿ˜ƒ

sharp spire
#

almost worked evo

#

except my prediction came true lol

#

client2 has no idea... haha

#

listenserver knows, client1 knows, but client2.. lost.. lol

#

and client 1 cant see listenservers mesh

#

:\

#

i think i NEED a mc

glacial pollen
#

Okay, do this then

sharp spire
#

but im not very good at mc yet, calling a multicast event and casting to a pawn using your getControlledPawn() wouldnt cast for everyone, would it?

glacial pollen
#

change the onrep into a multicast server event

#

and call it at the end of your equip server event

winged badger
#

that is inside the PlayerController?

hasty adder
#

Is this in the controller or pawn?

sharp spire
#

yes

#

controller

winged badger
#

you can't multicast from the controller

glacial pollen
#

as server?

#

ah shit

#

yea

#

gamemode

winged badger
#

gamemode is even slightly worse

glacial pollen
#

controllers can't talk to each other

sharp spire
#

where should i run a mc?

winged badger
#

MC from a client will not disconnect the client that owns the PC (but will disconnect every other client)

hasty adder
#

Playerstate is a good friend to@mp

winged badger
#

MC from a GameMode will disconnect all clients

hasty adder
#

But keep it close to the item thatโ€™s being changed

#

Character visuals on the character

#

You can call from controller to run an event on your pawn to then update its visual stuffs

glacial pollen
#

So just a jump from the controller to the gamestate, and then actually run the code

sharp spire
#

so running a MC on a pawn is ok?

hasty adder
#

If itโ€™s servers version

glacial pollen
#

All clients need to see his mesh change

hasty adder
#

Let me use a small example if you have a gun that is firing and spawn the effect pressing l which on character spanwsnit only client sees it. If you have l on character run on server spawn the effect only server sees it. If you run on server and mc all sees it including server

#

Because server called the mc

#

I canโ€™t say for sure on rep but usually a call on server to change an onrep for a character will goto everyone to rub the same logic on the local clients version of that character

#

Think of it like an animation bp

glacial pollen
#

I think yall are missing something

#

He make a change in an array, and also changes a mesh

#

he tried using the onrep for the array to change the mesh

hasty adder
#

Itโ€™s been happening with the controller who says itโ€™s functioning right to begin with all this time

sharp spire
#

Right here let me explain myself lol

hasty adder
#

Zlo will set it straight ๐Ÿ˜ƒ

winged badger
#

and you can't reference a non-replicated mesh component that wasn't loaded from a package over network

sharp spire
#

Basically I have a pawn that has a mesh, that has a skeletal mesh attached to a socket.

#

Itโ€™s set to component replicate, the mesh itโ€™s attached to is set to replicate, same with the actor

#

The mesh itโ€™s getting to set from, is coming from a replicated array

winged badger
#

mesh is originally coming from client

sharp spire
#

The server sets the array

glacial pollen
#

no, the mesh is on the server in the array

winged badger
#

what do your logs say?

sharp spire
#

Meh.. Iโ€™m a noob and have no logs.

#

Unless Iโ€™m confused right now

winged badger
#

output window, open it

sharp spire
#

It is 01:04 am lol

hasty adder
#

Access none here and there maybe

sharp spire
#

The output window shows my log of server related things?

#

Ah, yes

winged badger
#

basically, your client sends the struct to the server, which includes the mesh

#

unless your server sent that very same mesh to client first

#

there is no way to reference it

sharp spire
#

Yes and in the long run the skeletal mesh is the nine

hasty adder
#

Of access none?

sharp spire
#

None *

#

Yes

hasty adder
#

Yeah canโ€™t reference

sharp spire
#

Is it my casting method? Or because itโ€™s in pc

hasty adder
#

Other pc canโ€™t access another pc

#

Thereโ€™s that fun graphic in exi thing

#

Compendium showing what can access what

sharp spire
#

I have getControlledPawn connected to Cast to Topdowncharacter to reference the mesh

hasty adder
#

Hereโ€™s a fun thing I do and I dunno if itโ€™s good practice

#

But I set in my character hard coded references

#

Like gun1 gun2

#

And then I can have my gun set to gun1

#

Everyone uses the same character so they have that reference

sharp spire
#

But everyone uses the same itemBPclass that contains the mesh

hasty adder
#

Where is the itembpclass stored?

sharp spire
#

Literally my only issue is having other clients see my mesh lol. I can get the server to see each clients individual meshes at my current setup

#

And even get local visuals if I run it locally aswell

#

But only the listenserver can actually see these changes

#

I swear itโ€™s a simple mistake with trying to properly mc

hasty adder
sharp spire
#

And if I remember correctly Iโ€™m only accessing none when MCing

#

That explains it.

hasty adder
#

Pc1 cannot pc2

sharp spire
#

Iโ€™ll move my equipment and my functions to my pawn and it should work

#

It canโ€™t multicast in a pc

#

Simple as that right?

hasty adder
#

Server can tell the controller to do stuff but if server tells 2 1 doesnโ€™t know and other way around

#

Right

#

States and pawns are a nice overlap

winged badger
#

and that is not just not working, its actually disconnecting everyone who doesn't have a local copy of the PC doing the multicast

sharp spire
#

That explains why my camera and input goes crazy when I multicast ...

hasty adder
#

Lol. I try to go with closest relation and keep in mind who needs to see what

sharp spire
#

Thanks for clearing that up @winged badger @hasty adder and by god thank you so much @glacial pollen youโ€™ve been a HUGE help

hasty adder
#

Like chat

#

Controller tells ps to talk

sharp spire
#

Thatโ€™s what I thought, but i guess I was experimenting accidentally lol

hasty adder
#

Other pa tell the ui to uodate

#

Ps

sharp spire
#

Thatโ€™s how chat is handled?

hasty adder
#

Yeah I keep@mine in the hud which then uses ps to have server mc

plain flume
#

Morning. Any idea what is the correct way to get PlayerController or ControllerPawn for example inside GameState in multiplayer game? What I heard, you should not get Player Index[0] because server might see it as a clients etc..

hasty adder
#

I always use event possessed to cast to incoming pc and set a reference

#

In the character

sharp spire
#

Get own cast to doesnโ€™t work

#

?

hasty adder
#

For the local user

plain flume
#

@hasty adder Thanks! Clever

sharp spire
#

Oo good to know lol goodnight guys thanks for everything

glacial pollen
#

Your welcome

hasty adder
#

Enjoy mate bed time here too 1:23 am up in 5 hours gg

glacial pollen
#

I'm headed to bed too, so yea, goodnight

sharp spire
#

1:23am here and up at 9 thank god

hasty adder
#

East coast ftw

high heart
#

is there any particular reason I wouldn't be able to join a game with build A that is hosted with build B? I have a demo build that I would like to be able to play with the full version. Just got them both running and they can't seem to find each other

#

which is strange because i've gotten this working in the past

thin stratus
#

No idea despite Version mismatch on connection, but that might be fine if your demo uses the same project

#

Have you enabled verbose logging and checked the logs?

winter plover
#

Is there a way to make a projectile skip forward in time via its movement component?

#

I wanna try and compensate for latency basically

#

and pretend that the projectile has been travelling for longer than it really has, serverside

full bane
#

sweep forward

#

velocity * lagtime

winter plover
#

so I cant directly invoke the movement component to do it for me?

full bane
#

not really

#

but sweeping is just a couple of lines of code

#

so not that hard to implement

winter plover
#

yea I just think that would have been cleaner, since it would have also accounted for gravity and other stuff

#

maybe I can find something by digging deep into the source

full bane
#

afaik, projectiles don't have any inherent network support

#

or prediction stuff

winter plover
#

doesnt every game handle it kinda differently anyhow?

full bane
#

ya

#

that's probably why there is no framework for it

winter plover
#

makes sense

high heart
#

@thin stratus I think it's a steam issue actually. Can't use matchmaking if you're not subscribed to the app...

#

that's my theory anyways

thin stratus
#

Oh yeah haha, you need the app in your library

high heart
#

might be able to just use the demo appid for both but i reckon it would show up to friends as "Demo". And I'm not 100% sure full players would be subscribed to the demo app. this just got tricky

thin stratus
#

Hm, you'll need a different appID for the Demo I think

#

Your default one can't handle two projects without granting access to both

high heart
#

but if I have a different appID for the demo, they use different lobby pools. and as far as I can tell there's no way to make them share

thin stratus
#

Yeah

#

You'll want to ask Steam directly for that in the dev forums

#

I haven't had the need for a Demo and the real project to use the same pool yet

#

Well actually never had to handle a demo in the first place

winter plover
#

mhmm invoking the components tick func actually seemed to work just fine

#

it even still collides correctly

#

due to sub stepping probably

jolly siren
#

Has anyone been successful with using UpdateSession with steam?

winged badger
#

that looks like SessionInfo is not FOnlineSessionInfoSteam

jolly siren
#

or that it's null

winged badger
#

other things work?

jolly siren
#

Well nothing is working now because the server crashes. But before adding UpdateSession everything worked fine.

winged badger
#

its steam, so... steam client running?

jolly siren
#

yes, the steam stuff is all fine

#

been iterating on this project for years ๐Ÿ˜›

#
void AFPSGameMode::UpdateSessionInfo()
{
    if (/*GameSession && */GetNetMode() == NM_DedicatedServer)
    {
        // Get the session settings
        FOnlineSessionSettings* SessionSettings = nullptr;
        const IOnlineSubsystem* OnlineSub = IOnlineSubsystem::Get();
        if (OnlineSub)
        {
            const IOnlineSessionPtr SessionInt = OnlineSub->GetSessionInterface();
            if (SessionInt.IsValid())
            {
                SessionSettings = SessionInt->GetSessionSettings(GameSessionName);

                if (SessionSettings)
                {
                    // Update the session settings (to include the new gamemode and map settings)
                    SessionInt->UpdateSession(GameSessionName, *SessionSettings, true);
                }
            }
        }
    }
}```
winged badger
#

dedicated server part new addition?

jolly siren
#

no, it's always been dedicated server

#

worked fine before this build, which added UpdateSession to try and keep the gamemode and map names correct on the server list ui

winged badger
#

and nothing useful in the logs?

jolly siren
#

just the trace I pasted

winged badger
#

your UpdateSessionInfo() looks OnlineSubsystem agnostic

#

so unless you have something other then OSSteam running, i have nothing ๐Ÿ˜ฆ

jolly siren
#

yeah, it's OSSteam. I'm going to attach a debugger to it and check it out

winged badger
#

some online subystems can take as long as 0,15 or so seconds to initialize

jolly siren
#

right, I'm thinking it is an ordering issue and that the session info is still null

#

But I had it in BeginPlay before and it would be surprising to me if the session info wasn't initialized by then

proper olive
#

mornin folks... anyone on that can help me puzzle out why my RepNotify (on a bool) that attaches my character to another character (a horse) that's saved as a "Horse" variable on the character, then snap it to the component itself... if the server mounts up before a client logs in, when that client logs in, the RepNotify works perfectly, the server is attached to the horse, the client can mount up and the server sees it.... but when I dismount and mount again as the server, I'm getting "None" as the horse and the character falls through the void after attaching to the actor? It seems to find the actor but as soon as I've attached to it, it can't find the actor to find the variable of its mesh?

fleet sluice
#

@jolly siren Not related to this issue, but I remember you saying "open 127.0.0.1" was broken a while ago and that it had been broken for multiple engine versions. Seeing you are using Steam, it makes sense. The USteamNetDriver class broke any sort of "open IP:port" connection and it's actually "by design" from some smart ass at Epic.

jolly siren
#

Yeah, I opened a bug around the "open 127.0.0.1" issue and they never added it to the ue4 issues :/

#

But that issue was while working in the editor itself. So that would just be the null subsystem

burnt meteor
#

I am trying to make a multiplayer chat system but the cast fails to my chat widget

#

Errors: โ˜

#

Chat widget adds the msg to scroll box โ˜

#

Gets text and sends to pc for getting sender name and text โ˜

proper olive
#

not sure but it looks like it's being run from a client that's not on GamePC character

#

or run by server maybe

#

it's getting None for the GamePC tho, that's your clue

#

here's mine:

burnt meteor
#

1sec

#

Player Controller

#

PC

#

===

#

Now The Error Is The Cast Fails When I UpdateChatWindow In Chat WIdget

#

===

#

Help?

#

@proper olive hm..

#

no its on GamePC only

proper olive
#

what's LobbyPC in your comments there?

stable kindle
burnt meteor
#

yes @stable kindle

stable kindle
#

@burnt meteor would that wiki work ? or do they do so regardless

burnt meteor
#

i dont know about wiki but u can use replicate = true and repmovement =true and it works

#

i forgot the c++ name for replicates

stable kindle
#

bReplicates is for c++ i know Actors have that property not sure about UObject

#

i might mention i'm on 4.17.2

burnt meteor
#

?

jolly siren
#

Does anyone know how to pipe a windows server log to a file? FPSGameServer.exe -log logs in a separate cmd, but I want to pipe it to a file

stable kindle
#

@burnt meteor thanks for the prompt answer btw ^_^

jolly siren
#

yes, UObject can replicate

#

just a little more setup

burnt meteor
#

@stable kindle np

#

@jolly siren can u solve my prob?

#

โ˜

stable kindle
#

@jolly siren would you care to elaborate . Does the wiki i'm basing my setup cover what i need?

proper olive
#

So anyone know why my other clients aren't getting this "Horse" variable unless they log in to the server already mounted up? Mounting at runtime doesn't replicate this highlighted node

jolly siren
#

@stable kindle yep, that wiki covers it

proper olive
stable kindle
#

@jolly siren thanks ^_^

burnt meteor
#

@proper olive u need a Player Controller to possess

proper olive
#

this is like super overboard, but I'm just trying anything I can to set the Horse variable

#

the Possess is working fine, it's the attach to component that doesn't work

burnt meteor
#

hm..

#

attach?

proper olive
#

like I can ride around as the horse as the client or the server

burnt meteor
#

attach what?

proper olive
#

but the other clients don't see it right

#

character to horse character

burnt meteor
#

yes cause ur possess works on server but not on client

#

u need a pc in the server

#

thats why

proper olive
#

...

burnt meteor
#

?

proper olive
#

the possess works, it's the attach that doesn't work

#

if I move as the server, the horse moves around, but the attached pawn is floating around under the map

burnt meteor
#

show me the attach

proper olive
#

it's the Horse variable on this Rep Notify that it's reading as None

#

I tried setting Horse variable to RepNotify too but that didn't helpo

burnt meteor
#

add a socket to skeleton mesh

#

and add preview socket

proper olive
#

the attach works on client's side

#

it's the other clients that don't see it

winged badger
#

Any errors/warnings in the logs @proper olive ?

proper olive
#

yeah the one I showed earlier one sec

burnt meteor
#

ill get back to u 1sec

proper olive
#

as you see it's not setting the Horse variable

burnt meteor
proper olive
#

like how do I rep notify the set horse?

burnt meteor
#

its easier for screenshots

proper olive
#

print screen is easier

burnt meteor
#

u get to select what to screenshot

proper olive
#

๐Ÿ˜‰

#

I have a mac, I know how it is

burnt meteor
proper olive
#

thanks tho

#

lmao my profile pic IS the winky emoticon

stable kindle
#

@jolly siren @burnt meteor sorry to bug you guys again .. would the method workd for ubojects in an array ?

winged badger
#

As long as they have an actor owner that replicates, it would

stable kindle
#

@winged badger thanks ^_^

proper olive
#

@winged badger any insight into setting an actor variable to replicate properly for use in a RepNotify code like that?

winged badger
#

I am not sure what the chain of ownership is after you attach the possessed character to a horse pawn

#

On mobile, so screenshots are a little problematic atm

proper olive
#

maybe if I attach to component first then attach to actor?

#

nope :/

burnt meteor
#

๐Ÿ˜‰

proper olive
#

๐Ÿ˜„

#

lol badly copied screen shot ignore the top framing

burnt meteor
#

lol

proper olive
#

Horse mounted on server, server sees client mounted....

#

on the right, client sees self mounted, server is off the horse

#

and if another client logs in, clients can see each other mount up just fine when they mount up at run time

#

that's the weird part

winged badger
#

Try SetRelativeTransform ontop of everything else

proper olive
#

but their rep notify doesn't work

burnt meteor
#

its not replicate properly

proper olive
#

I do that actually

#

@winged badger that's later in the code, works fine on self as you see

#

it's a mess rn while I work on it ๐Ÿ˜„

#

in the meantime can anyone explain what exactly Authority means? It's not always just the server, right?

winged badger
#

It is just the server

burnt meteor
#

@proper olive yes authority mean server owner actually

proper olive
#

oh ok that's good

burnt meteor
#

not server always

proper olive
#

what about Is Locally Controlled

#

that means the server or the client, whichever one owns the pawn in question?

burnt meteor
#

i highly suggest get this course worth it

proper olive
#

here's the confusing part: at run-time, clients see each other mount up perfectly

#

it's only the server that other clients see fall off his horse

burnt meteor
#

urs using too much complicated bp's and rep notifies and not soo good

#

use rpcs

proper olive
#

when logging in to see repnotify conditions already set, it's the opposite - server appears mounted to other clients logging in, but other clients are disconnected

burnt meteor
#

they are not server owned(authority)

proper olive
#

I am using RPCs. You have to use RepNotify to update people when logging in

burnt meteor
#

2m i am busy

proper olive
#

when I put this code on the multicast the same problem happened

winged badger
#

LocallyControlled checks if the PC is (and by extension its pawn) is in a local controller via GameInstance

burnt meteor
#

first run on serverthen multicast

proper olive
#

dude decode

#

you're tired

#

๐Ÿ˜›

burnt meteor
#

no i am eating

proper olive
#

maybe THIS is the problem

burnt meteor
#

and i am also typing

#

dude learn replicating

#

๐Ÿ˜ƒ

proper olive
#

Decode everything you tried to tell me, I already knew

#

Try not assuming I'm an idiot

#

I appreciate the help tho

winged badger
#

Useful for stuff like when you want to show a widget only to the plater tbat ran into a trigger volume, for example
Then OnOverlap, you would cast other actor to Pawn and see if its localy controlled, and if it is, display that widget via its HUD

proper olive
#

Ok yeah that's exactly how I thought it worked

#

was just making sure ๐Ÿ˜„

#

trying this Owner thing now

winged badger
#

When you mount up, you possess the horse?

proper olive
#

yeah

#

got some interesting results by changing owner

winged badger
#

Try setting both the character and the horse to AlwaysRelavant just to rule out some weird NetRelevancy issue

proper olive
#

yeah I thought about doing that liek you said, just to test

#

trying to just clear Owner for the same reason

#

how dangerous is it to leave always relevant on for something let's say like all items :cringe:

#

I know attaching costs more so I just leave them hanging out hidden when they get picked up and move them unhide when dropped

winged badger
#

Depends on how many they are and how large your world is

proper olive
#

haha of course ๐Ÿ˜„ so very bad if it were to be a lot and very large?

winged badger
#

I destroy mine and create an actot component

proper olive
#

my player states were losing reference to items all of a sudden and I had Always Relevant turned off for weeks, so I'm not sure what was causing them to lose relevancy

winged badger
#

Then recreate the pickup if dropped

proper olive
#

but I put it back on and it works now

#

I keep mine around for save game reference

winged badger
#

If you dont attach tnem

#

They stay put

proper olive
#

yea

burnt meteor
#

May I?

proper olive
#

so because the players moved far away, they lose relevancy? It was happening even with items they spawn with

burnt meteor
#

Use team viewer and solve it

proper olive
#

Freshly logged in client seeing the server and the client who had mounted up before he logged in, all working perfectly

#

so confuse

#

at least it still looks purdy :sigh:

#

it seems the only thing that's not working right is other clients reading the server's Horse variable when he mounts up at run time. It looks like pretty much every other condition is valid

#

server or client mounted before client logs in: check

#

clients seeing each other mount and dismount: check

#

server seeing other clients, check

#

clients seeing server attach to horse on RepNotify when logging in after the fact? check..... (most mysyerious)

#

client seeing server attach to horse at RUN TIME? ..... falls through the earth.

#

what bugs me the most is the fact that I'm ONLY getting an error for this AttachToComponent node

#

and NOT the Actor node right next to it

#

but the None is coming from the ACTOR

#

lolllllllllll

sharp spire
#

Also @proper olive youโ€™re running a check to see if itโ€™s a server or a client during a server ran event

proper olive
#

it'll spawn twice on client if I don't filter out client

#

should I run on client again something?

#

set horse on client?

sharp spire
#

Why is it spawning twice? Can you post where itโ€™s being called

winged badger
#

what will spawn twice?

proper olive
#

any time I spawn actor from a Server RPC on client, it spawns twice

#

so I Switch Has Authority

#

because the RPC runs on server and client, that's how it works

sharp spire
#

But that switch is inside of a server can event, im still fairly new so maybe I see it wrong. @winged badger ?

winged badger
#

client generally shouldn't spawn anything

#

except maybe some visual only related dummy actor

proper olive
#

it spawns it on its own side

sharp spire
#

Should this be a multicast at some point?

proper olive
#

well visual is visual lol

sharp spire
#

Heโ€™s spawning a horse for mounting and wants all players to see it

proper olive
#

I think RepNotify basically makes Multicast unecessary? I could be wrong but it seems to work better without the multicast. Multicasting messes everybody up lol

#

all players do see all other players do it

sharp spire
#

But his snippet a few pictures up has an authority check during a server ran event

winged badger
#

then you spawn a horse on server

proper olive
#

but hwen the server does it, it's not working right on clients

winged badger
#

and let it replicate

proper olive
#

thats what I'm doing

winged badger
#

so, what was the "spawns twice" part about then/

sharp spire
#

Is the mesh in the BP set to component replicate aswell as the class?

proper olive
#

yeah @sharp spire ๐Ÿ˜„

sharp spire
#

Without an authority check during a server ran event it spawns twice

proper olive
#

the spawns twice is the reason for the Authority checxk

#

yea

#

anything will

#

test it out yourself

#

just do a Server RPC, spawn a replicated actor, and run it on a client, it'll spawn on the server and the client

winged badger
#

Server RPCs aren't meant to run on clients

proper olive
#

they run on both

winged badger
#

so on your PlayerController

#

say you have InputActionMount

sharp spire
#

I am new so donโ€™t take everything I say as the answer, but from what Iโ€™m understanding: you should only spawn on the server and let the clients see itโ€™s replicate state

winged badger
#

you connect that to the ServerRPC ServerMount directly and do all mounting logic inside it