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.

using "Super"

Discussion in 'Programming' started by navboy, Sep 24, 2001.

  1. navboy

    navboy New Member

    Joined:
    Jan 5, 2001
    Messages:
    340
    Likes Received:
    0
    hi, trying to track down an infinite recursion error ... i've subclassed the Teleporter actor and called it OffsetTeleporter ... It removes code in the Touch function dealing with sending a player across the 'net, and picking a random teleporter, and also adds some additional vector stuff in the Accept function.

    Works fine in botmatch and on the server machine (nondedicated) but crashes on the client machine with a recursion error, says it cancelled it after 250 calls.

    I've combed through and nowhere have i removed anything with replication or role code in it that would be called in the normal Teleporter in my circumstances. Grasping at straws the only part of things i never understood anyway was how to control using Super ....

    For example, if in say Teleporter there's a function BLAH() that calls Super.BLAH(), then in my subclass i have a BLAH() function and i put Super.BLAH(), it will execute the BLAH() in Teleporter when in hits that line, right?

    But how can i instead have it execute the BLAH() in NavigationPoint (Teleporter's parent)? I tried Super.Super.BLAH() but got recursion errors right off the bat ... I tried NavigationPoint.BLAH() i think and got some sort of error ... I think i also tried global.BLAH() and got errors too ...
     
  2. mOOse-pl

    mOOse-pl New Member

    Joined:
    Apr 16, 2000
    Messages:
    2
    Likes Received:
    0
    I think you have to use Super(NavigationPoint).BLAH()

    Also look at this (I found it somewhere on the web some time ago):



    Function Calling Specifiers
    In complex programming situations, you will often need to call a specific version of a function, rather than the one that’s in the current scope. To deal with these cases, UnrealScript provides the following keywords:
    · Global: Calls the most-derived global (non-state) version of the function.
    · Super: Calls the corresponding version of the function in the parent class. The function called may either be a state or non-state function depending on context.
    · Super(classname): Calls the corresponding version of the function residing in (or above) the specified class. The function called may either be a state or non-state function depending on context.

    It is not valid to combine multiple calling specifiers (i.e. Super(Actor).Global.Touch).
    Here are some examples of calling specifiers:
    class MyClass expands Pawn;

    function MyExample( actor Other )
    {
    Super(Pawn).Touch( Other );
    Global.Touch( Other );
    Super.Touch( Other );
    }

    As an additional example, the BeginPlay() function is called when an actor is about to enter into gameplay. The BeginPlay() function is implemented in the Actor class and it contains some important functionality that needs to be executed. Now, say you want to override BeginPlay() in your new class MyClass, to add some new functionality. To do that safely, you need to call the version of BeginPlay() in the parent class:
    class MyClass expands Pawn;

    function BeginPlay()
    {
    // Call the version of BeginPlay in the parent class (important).
    Super.BeginPlay();

    // Now do custom BeginPlay stuff.
    //...
    }
     
  3. navboy

    navboy New Member

    Joined:
    Jan 5, 2001
    Messages:
    340
    Likes Received:
    0
    thanks! that's exactly what i was looking for.

    don't suppose you have any idea if somehow simulated functions/events have any additional considerations as far as calls using super? Something is recursing infinitely on client machine but not on server or botmatch... Hard as hell to troubleshoot without a network at my disposal, argh.
     
  4. navboy

    navboy New Member

    Joined:
    Jan 5, 2001
    Messages:
    340
    Likes Received:
    0
    more specific question now

    okay i think i know what might be happening, but i'm not sure how to deal with it:

    "if( !Other.bJustTeleported )" in a WarpZoneInfo is what keeps the recursion from happening in botmatch and on the server; the pawn is teleported into a warpzone from a custom Teleporter, and bJustTeleported keeps the zone from warping the pawn.

    I'm thinking that since the ActorEntered function in the warpzone is simulated, that maybe it's local copy of bJustTeleported hasn't been updated? If indeed it works that way, it would explain why the warpzone on a client machine warps the player back, which touches them to the teleporter, and it starts all over again.

    How can i have the client's simulated ActorEntered get the "real" value of bJustTeleported (what's on the server's copy)???

    Or is there a more efficient way to do this?

    Thanks for any insights.
     

Share This Page