replication issues with interactions

  • Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

JamesKilton

UA Coder
Oct 6, 2002
210
0
0
Everywhere and Nowhere
Visit site
My task: to get the references to a custom LevelInfo (UaLevelInfo) and the TerrainInfo from an Interaction.

Offline: works fine. Use a foreach DynamicActors

Online: nothing. I know that Interactions are not Actors, so can't replicate, so I created a function in my custom PlayerController:

Code:
// functions client calls on the server
	unreliable if (Role < ROLE_Authority)
		InitInteraction;

function InitInteraction(out UaLevelInfo Level, out TerrainInfo Terrain)
{
	foreach DynamicActors(class'UaLevelInfo', Level)
		break;

	foreach DynamicActors(class'TerrainInfo', Terrain)
		break;
}

This also doesn't work. I'm assuming that because it works offline that I have to get the references from the server. The ds isn't returning the "Recieved unwanted function" error from this code, but it doesn't work (both returned values are None). Is my replication logic wrong or is there something else at work here?

Just remembered the problem with functions returning values. Is that the problem here? And if so, how would I fix it?
 
Last edited:

Wormbo

Administrator
Staff member
Jun 4, 2001
5,913
36
48
Germany
www.koehler-homepage.de
Interactiona aren't replicated because they aren't Actors. You also can't pass references to the around because they don't exist on other machines.

You can only replicate functions from and to the client owning the actor. If your actor isn't owned by any PlayerController, function replication doesn't work at all.
Also return values and out parameters don't work on the machine calling a replicated function. The out parameters remain unchanged for the calling function and the return value is always a null value.
 

JamesKilton

UA Coder
Oct 6, 2002
210
0
0
Everywhere and Nowhere
Visit site
Ya Wormbo, I know all that. I'm asking why what I want isn't working online. I've come up with a workaround where I call the same function, without returning, keep the found references in the PlayerController, and access those variables directly from the Interaction. If that doesn't work, then I'm completely stumped.