# why does this faill only on dedicated server?

**URL:** <https://forums.unrealengine.com/t/why-does-this-faill-only-on-dedicated-server/76581>\
**Category:** ARK: Survival Evolved\
**Tags:** unreal-engine, Ark:-Survival-Evolved, Modding\
**Created:** [October 21, 2016, 10:33pm UTC](https://forums.unrealengine.com/t/why-does-this-faill-only-on-dedicated-server/76581 "2016-10-21T22:33:53Z")\
**Posts on this page:** 17\
**Page:** 2

<div class="post-metadata">

**Author:** ![P0k3r](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@P0k3r](https://forums.unrealengine.com/u/P0k3r)\
**Post date:** [October 27, 2016, 2:41pm UTC](https://forums.unrealengine.com/t/why-does-this-faill-only-on-dedicated-server/76581/21 "2016-10-27T14:41:45Z")

</div>

> [@fjb;615259](#):
>
> Inciedently you don’t how to get it to display the existing value on the client screent do you? Print string only seems to work in the dev kit or on none-stand alone servers.

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”

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_17199181](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_17199181](https://forums.unrealengine.com/u/anonymous_user_17199181)\
**Post date:** [October 28, 2016, 10:02am UTC](https://forums.unrealengine.com/t/why-does-this-faill-only-on-dedicated-server/76581/22 "2016-10-28T10:02:08Z")

</div>

> [@P0k3r;615399](#):
>
> 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.

---

<div class="post-metadata">

**Author:** ![P0k3r](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@P0k3r](https://forums.unrealengine.com/u/P0k3r)\
**Post date:** [October 28, 2016, 3:59pm UTC](https://forums.unrealengine.com/t/why-does-this-faill-only-on-dedicated-server/76581/23 "2016-10-28T15:59:48Z")

</div>

“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”.

 ![fa4888d7625bd5a59894330df87624d6.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/4/f/34fb88665a69b5b6d129f64a1174239720a225d6.png)

That’s all you need

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

 ![a29effa0d620501830124a37868ceab9.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/7/2/4726b434544d863d26bea5b4a53aafe08eb42656.png)

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_17199181](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_17199181](https://forums.unrealengine.com/u/anonymous_user_17199181)\
**Post date:** [October 29, 2016, 1:30pm UTC](https://forums.unrealengine.com/t/why-does-this-faill-only-on-dedicated-server/76581/24 "2016-10-29T13:30:15Z")

</div>

> [@P0k3r;615896](#):
>
> “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”.
> 
> ![fa4888d7625bd5a59894330df87624d6.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/4/f/34fb88665a69b5b6d129f64a1174239720a225d6.png)
> 
> You can also use the plain old server notification as well. This will send to all.
> 
> ![a29effa0d620501830124a37868ceab9.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/7/2/4726b434544d863d26bea5b4a53aafe08eb42656.png)

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

---

<div class="post-metadata">

**Author:** ![Huston850](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Huston850](https://forums.unrealengine.com/u/Huston850)\
**Post date:** [October 29, 2016, 6:04pm UTC](https://forums.unrealengine.com/t/why-does-this-faill-only-on-dedicated-server/76581/25 "2016-10-29T18:04:10Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_17199181](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_17199181](https://forums.unrealengine.com/u/anonymous_user_17199181)\
**Post date:** [October 30, 2016, 7:56am UTC](https://forums.unrealengine.com/t/why-does-this-faill-only-on-dedicated-server/76581/26 "2016-10-30T07:56:31Z")

</div>

> [@Huston850;616351](#):
>
> 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?

---

<div class="post-metadata">

**Author:** ![Huston850](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Huston850](https://forums.unrealengine.com/u/Huston850)\
**Post date:** [October 30, 2016, 6:02pm UTC](https://forums.unrealengine.com/t/why-does-this-faill-only-on-dedicated-server/76581/27 "2016-10-30T18:02:45Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_0549f641](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_0549f641](https://forums.unrealengine.com/u/anonymous_user_0549f641)\
**Post date:** [October 31, 2016, 9:13pm UTC](https://forums.unrealengine.com/t/why-does-this-faill-only-on-dedicated-server/76581/28 "2016-10-31T21:13:29Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_17199181](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_17199181](https://forums.unrealengine.com/u/anonymous_user_17199181)\
**Post date:** [November 1, 2016, 4:53pm UTC](https://forums.unrealengine.com/t/why-does-this-faill-only-on-dedicated-server/76581/29 "2016-11-01T16:53:28Z")

</div>

> [@Huston850;616641](#):
>
> 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.

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.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_17199181](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_17199181](https://forums.unrealengine.com/u/anonymous_user_17199181)\
**Post date:** [November 1, 2016, 4:55pm UTC](https://forums.unrealengine.com/t/why-does-this-faill-only-on-dedicated-server/76581/30 "2016-11-01T16:55:50Z")

</div>

> [@Midas2112;617104](#):
>
> 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. 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.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_0549f641](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_0549f641](https://forums.unrealengine.com/u/anonymous_user_0549f641)\
**Post date:** [November 1, 2016, 7:24pm UTC](https://forums.unrealengine.com/t/why-does-this-faill-only-on-dedicated-server/76581/31 "2016-11-01T19:24:02Z")

</div>

> [@fjb;617424](#):
>
> 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.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_17199181](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_17199181](https://forums.unrealengine.com/u/anonymous_user_17199181)\
**Post date:** [November 2, 2016, 8:52pm UTC](https://forums.unrealengine.com/t/why-does-this-faill-only-on-dedicated-server/76581/32 "2016-11-02T20:52:57Z")

</div>

> [@Midas2112;617499](#):
>
> 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.

---

<div class="post-metadata">

**Author:** ![Huston850](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Huston850](https://forums.unrealengine.com/u/Huston850)\
**Post date:** [November 2, 2016, 11:41pm UTC](https://forums.unrealengine.com/t/why-does-this-faill-only-on-dedicated-server/76581/33 "2016-11-02T23:41:07Z")

</div>

> [@fjb;618125](#):
>
> 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.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_17199181](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_17199181](https://forums.unrealengine.com/u/anonymous_user_17199181)\
**Post date:** [November 3, 2016, 11:39pm UTC](https://forums.unrealengine.com/t/why-does-this-faill-only-on-dedicated-server/76581/34 "2016-11-03T23:39:37Z")

</div>

> [@Huston850;618214](#):
>
> 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.

---

<div class="post-metadata">

**Author:** ![Huston850](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Huston850](https://forums.unrealengine.com/u/Huston850)\
**Post date:** [November 4, 2016, 2:47am UTC](https://forums.unrealengine.com/t/why-does-this-faill-only-on-dedicated-server/76581/35 "2016-11-04T02:47:25Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_17199181](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_17199181](https://forums.unrealengine.com/u/anonymous_user_17199181)\
**Post date:** [November 4, 2016, 11:13pm UTC](https://forums.unrealengine.com/t/why-does-this-faill-only-on-dedicated-server/76581/36 "2016-11-04T23:13:00Z")

</div>

> [@Huston850;618766](#):
>
> 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.

---

<div class="post-metadata">

**Author:** ![SkyeEden](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/skyeeden/32/1116094_2.png) [@SkyeEden](https://forums.unrealengine.com/u/SkyeEden)\
**Post date:** [March 9, 2022, 9:34pm UTC](https://forums.unrealengine.com/t/why-does-this-faill-only-on-dedicated-server/76581/37 "2022-03-09T21:34:15Z")

</div>



[Previous page](https://forums.unrealengine.com/t/why-does-this-faill-only-on-dedicated-server/76581.md?page=1)
