why does this faill only on dedicated server?

Try the “Client Send Server Notification” or similar. That prints a message on screen up top in the center like use messages - “Consumed 1 Mejoberry”

reruires a reference to player or something so i call getplayer with any index at all which always returns zero so it always fails.

“Always with you, it is what can not be done”

You don’t need to set a player index. - “Get Owner Controller”>“Cast to ShooterPlayerController”>“Client Send Server Notification”.

That’s all you need

You can also use the plain old server notification as well. This will send to all.

for some reason, get owner controller always returns 0 so the cast always fails.
That’s all you need

Are you saying “that’s all you need” as in you found an alternative? Get owner controller will return 0 depending on what you have connected to it. Notice the ‘self’ input? If you’re calling this in your PrimalGameData or GameMode, you’re gonna have a bad time.

That’s all you need was from rhe previous post. I forgot to snip it. it was called from gamemode. where do you call it from?

I call it from things that are controlled by players. A lot of this terminology (GameMode, PlayerController, OwnerController) is actually basic UE4 terminology, and you can find it all online. It’s the variables inside of the blueprints that WC created and you won’t find much documentation on. If you’re trying to send a notification from gamemode, I’d suggest using SendServerNotification so it’s sent to all clients.

fjb, did you ever get the weight issue figured out? If you did, I’m curious how you were able to fix it. Thanks.

No doubt, but all i’m after is it displaying something on the clients screen. I shouldn’t have to reprogramme the entire ui just for that.

No. I assumed it was a replication thing, so i was trying to erite the value and read it back but it seem to flatly refuse to let you change the weight of an aitem on a dedicated standalone server although it works fine on game server mode. I’m wondering if it’s a bug in the server itself.

Try adding a “SwitchNetAuthority” just after “Event Begin Play” and then link “Dedicated Server” and “Player Server” to “Get Class Default Object”. This should cause the script to fire on both online and standalone servers.

I did try that. i even did a node for client which i’ve no way of knowing if it ever fired. For some reason, client never triggers on the development platform so i’m wondering if it does on the end platform. it’s why i was trying to read it back.
I put it in a loop in a macro so it would write and read back in if it wasn’t the same write again. it made no difference. what i don’t get is how it fails on weight but if i try stack sizes it works every time. Maybe i should try some other properies.

I just created a mod and learned a lot. In some situations, replication is literally dropped by UE4. Some is strictly client, some strictly server, some everything works. I’ll give you a hint, structures and widgets can’t execute server events (hitting a custom event set to server only runs it locally), but playercontrollers can execute events on the server. You’d might lose stackability, but you could try throwing your logic into a custom gamemode and running it on the server.

To see if something’s running on server/client, you have to go to the graph when the editor is running and there’s a “select debug object” option. If two things spawn, one is server one is client. The graph will say “Server Simulating” and light up the current path in orange if it’s passing through. You could use this to study your loop.

it’s already done in a gameode as it’s there that reading and writing seems avaialble. in the editor as previously stated it works fine. In fact, the only place it it doesn’t work is the standalone dedicated server. there is nothing wrong with the logic. there is a factor here which seperated dedicated standalone servers from player servers and clients and that factor is stopping it working, only i don’t know why or how.

It might only be replicating to the local client, which is you, even thought you’re not “hosting” the server, your PC is. I know that singleplayer and non-dedicated will use the same save game slot directory at index 0 as a dedicated server run on your computer.

I thought something siminlar so i tried it on a remote server. same issue.