When calling a server RPC on a character that is controlled by an AIController (like an RTS unit) will throw the following warning:
LogNet: Warning:
UIpNetDriver::ProcessRemoteFunction:
No owning connection for actor
RTS_Test_Character. Function Server_RPC_Foo will not be
processed.
This makes sense because the Player whom calls the RPC is not technically the owner of this actor, the server is. But, how can you make this work? How is this intended by Epic?
Note that someone gave me a c++ hack around it (by overriding the GetNetConnection() in every such actor that has server RPC calls and assigning the first PlayerController to it instead) but what is the ‘non-hacky-way’ of doing this?
Solved it. I confirmed that the AI is being run on the server and the server also own the AI. So I am able to call RPC’s and replicate back to clients from any AI. You just need to make sure that you are also not running it double on the client, because that can give you trouble. I thought it was doing that by default but it is not and is actually quite logical.