News • UnrealEd • Files • Mods • FragBU • Liandri Archives
BeyondUnreal Forums

Go Back   BeyondUnreal Forums > Unreal Development > Coding

Reply
 
Thread Tools Display Modes
Old 24th Sep 2001, 10:56 PM   #1
navboy
Registered User
 
Join Date: Jan. 5th, 2001
Location: tornados, Wizard of Oz, 70's rock group, lots of native Americans, etc.
Posts: 340
using "Super"

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 ...
navboy is offline   Reply With Quote
Old 25th Sep 2001, 02:51 AM   #2
mOOse-pl
Registered User
 
Join Date: Apr. 16th, 2000
Location: Ustka, Poland
Posts: 2
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.
//...
}
__________________
mOOse-pl
moose_pl@spacemoose.com
http://ut.org.pl
mOOse-pl is offline   Reply With Quote
Old 26th Sep 2001, 11:50 AM   #3
navboy
Registered User
 
Join Date: Jan. 5th, 2001
Location: tornados, Wizard of Oz, 70's rock group, lots of native Americans, etc.
Posts: 340
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.
navboy is offline   Reply With Quote
Old 26th Sep 2001, 12:53 PM   #4
navboy
Registered User
 
Join Date: Jan. 5th, 2001
Location: tornados, Wizard of Oz, 70's rock group, lots of native Americans, etc.
Posts: 340
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.
navboy is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 04:35 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.

Copyright ©1998 - 2012, BeyondUnreal, Inc.
Privacy Policy | Terms of Use
Bandwidth provided by AtomicGamer