1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. 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.

Err... Is the following thesis true?

Discussion in 'Programming' started by Hobbees, Feb 28, 2002.

  1. Hobbees

    Hobbees New Member

    Joined:
    Dec 1, 2001
    Messages:
    11
    Likes Received:
    0

    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.
     
  2. namu

    namu Bleh.

    Joined:
    Dec 21, 2000
    Messages:
    4,411
    Likes Received:
    1
    Try giving your class "RemoteRole=ROLE_None" ?
     
  3. Hobbees

    Hobbees New Member

    Joined:
    Dec 1, 2001
    Messages:
    11
    Likes Received:
    0
    Better not :)

    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.
     
  4. Wormbo

    Wormbo Administrator Staff Member

    Joined:
    Jun 4, 2001
    Messages:
    5,911
    Likes Received:
    35
     
  5. Hobbees

    Hobbees New Member

    Joined:
    Dec 1, 2001
    Messages:
    11
    Likes Received:
    0
    Yes (oops), but...

    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.
     
  6. Captain Kewl

    Captain Kewl I know kewl.

    Joined:
    Feb 13, 2001
    Messages:
    794
    Likes Received:
    0
    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.
     
  7. Raeled

    Raeled Feuer Frei!

    Joined:
    Jul 1, 2001
    Messages:
    161
    Likes Received:
    0
    have you tried making postbeginplay simulated?
     
  8. Hobbees

    Hobbees New Member

    Joined:
    Dec 1, 2001
    Messages:
    11
    Likes Received:
    0
    Seems I have to use a direct Object subclass. This works.
    Thanks for your help, everyone!
     
  9. Hobbees

    Hobbees New Member

    Joined:
    Dec 1, 2001
    Messages:
    11
    Likes Received:
    0
    Yep, won't help.
     
  10. usaar33

    usaar33 Un1337

    Joined:
    Mar 25, 2000
    Messages:
    808
    Likes Received:
    0
    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?
     
  11. Hobbees

    Hobbees New Member

    Joined:
    Dec 1, 2001
    Messages:
    11
    Likes Received:
    0
    "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?
     
  12. usaar33

    usaar33 Un1337

    Joined:
    Mar 25, 2000
    Messages:
    808
    Likes Received:
    0
    yes. who else could???
     

Share This Page