PDA

View Full Version : Err... Is the following thesis true?


Hobbees
28th Feb 2002, 11:53 AM
class ComputerInfo extends Info;
...
simulated state Active
{
&nbspfunction BeginState()
&nbsp{
&nbsp// Check shows that Role = ROLE_Authority
&nbsp}
}

-----------------------------------------
class TestPawn extends TMale1;
var ComputerInfo CompInfo;
...
function PostBeginPlay()
{
&nbspSuper.PostBeginPlay();
&nbspif (Level.NetMode == NM_Client)
&nbsp{
&nbsp&nbspCompInfo = Spawn(class'ComputerInfo', Self);
&nbsp&nbspCompInfo.GotoState('Active');
&nbsp}
}
------------------------------------------


So: Spawned (direct) Actor subclasses will always be managed by the server, although they were spawned by the client?
Since I think this cannot be true, what am I doing wrong? This class should only be processed by the client.

namu
28th Feb 2002, 12:45 PM
Try giving your class "RemoteRole=ROLE_None" ?

Hobbees
28th Feb 2002, 12:47 PM
The spawn function seems to check the actor class to be spawned for Role == ROLE_Authority. If it's not, the UT engine will crash.

Wormbo
28th Feb 2002, 01:16 PM
Originally posted by namu
Try giving your class "RemoteRole=ROLE_None" ?

Hobbees
28th Feb 2002, 02:36 PM
although UT doesn't crash when setting Role indirectly by using RemoteRole (there's not a big difference), it won't change the fact that the server still processes the class.

Captain Kewl
28th Feb 2002, 03:03 PM
Not certain, but as far as my own experience has shown, Info (sub)classes in particular exist serverside and are replicated to the client. A predication might be that they will only exist serverside, regardless of how they're spawned -- again, I'm not certain, though. (Someone feel free to correct me.)

You generally only want to use Info classes for data you want the server to tell the client... hence things like GameInfos and ReplicationInfos for rules, scores, etc.

Raeled
28th Feb 2002, 03:13 PM
have you tried making postbeginplay simulated?

Hobbees
28th Feb 2002, 03:14 PM
Seems I have to use a direct Object subclass. This works.
Thanks for your help, everyone!

Hobbees
28th Feb 2002, 04:00 PM
Originally posted by Raeled
have you tried making postbeginplay simulated?

Yep, won't help.

usaar33
28th Feb 2002, 10:25 PM
I don't see at all what your problem is. Role checks are not the same as netmode. Role simply means how this actor is controlled locally. Obviously, if you spawn it on the client, it would be role_authority, as there is nothing else to control it! It wouldn't be replicated at all, regardless of remoterole (which in fact means nothing).

So what is the problem?

Hobbees
1st Mar 2002, 02:08 PM
Originally posted by usaar33
I don't see at all what your problem is. Role checks are not the same as netmode. Role simply means how this actor is controlled locally. Obviously, if you spawn it on the client, it would be role_authority, as there is nothing else to control it! It wouldn't be replicated at all, regardless of remoterole (which in fact means nothing).

So what is the problem?

"Role simply means how this actor is controlled locally."
So are you sure it's indeed only the client which takes care of the actor?

usaar33
1st Mar 2002, 08:20 PM
Originally posted by Hobbees


"Role simply means how this actor is controlled locally."
So are you sure it's indeed only the client which takes care of the actor?

yes. who else could???