UE1 - UT Trouble with dynamic arrays

  • 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.

usernameuser

register
Dec 2, 2009
3
0
0
I found out that Dynamic arrays don't have any kind of replication, but I HAVE to replicate it somehow. So how I do it?

Instance classes:
Code:
class ServerActor

simulated function PostBeginPlay()
{
	SetTimer(0.8,False);
}
simulated function Timer()
{
	ClientFunction();
}
simulated function ClientFunction()
{	
	local ClientActor CA;
	Spawn(class'ClientActor');
}
defaultproperties
{
	RemoteRole=Role_SimulatedProxy
	bAlwaysRelevant=True
}

Code:
class ClientActor

struct Bootype
{
	var() config string DrawScales;
}; var() config array<Bootype> Boo;

replication
{
	reliable if(role==role_authority)
		Tim;
}
simulated function PostBeginPlay()
{
	SetTimer(0.8,False);
}
simulated function Timer()
{
	Tim();
}
simulated function Tim()
{
	local int i,ii
	local Brute B;
	
	if(Level.NetMode!=NM_Client && Level.NetMode!=NM_Standalone) return;
	
	ii = GetArraySize(ArrayProperty'Boo');
	foreach allactors(class'Brute',B)
	{
		if(B!=None)
		{
			for(i=0;i<ii;i++)
				B.DrawScale=Boo[i].DrawScales;
		}
	}
}
defaultproperties
{
	RemoteRole=Role_SimulatedProxy
	bAlwaysRelevant=True
}

This should get info from SERVER ini and run functions to CLIENT.

And yes, this is from 227f.
 
Last edited:

Wormbo

Administrator
Staff member
Jun 4, 2001
5,913
36
48
Germany
www.koehler-homepage.de
That code doesn't make much sense to me. Firstly, config variables aren't replicated by default unless they change at runtime, and secondly, DrawScale is a replicated property already.

Anyway, dynamic arrays don't replicate in any UE generation and coders in UE2/3 can work without it. If element values of a dynamic array really need to be replicated, there's always function replication to send individual elements separately.
 

usernameuser

register
Dec 2, 2009
3
0
0
there's always function replication to send individual elements separately.
Actually this is what im asking for. How I do this practically?
And notice that I don't do so well with replication things. Please give some kind of example.
 
Last edited:

usernameuser

register
Dec 2, 2009
3
0
0
Since when does UE1 have dynamic array support?
I also didn't know that DrawScale was a string.

227f gives array support :D
Also this is just and example "how this thing should work" so the real code don't look like that.
 
Last edited: