For direct access use https://forums.oldunreal.com
It's been quite a while since oldunreal had an overhaul, but we are moving to another server which require some updates and changes. The biggest change is the migration of our old reliable YaBB forum to phpBB. This system expects you to login with your username and old password known from YaBB.
If you experience any problems there is also the usual "password forgotten" function. Don't forget to clear your browser cache!
If you have any further concerns feel free to contact me: Smirftsch@oldunreal.com

Disambiguation of classes with identical names from different packages

The section related to UnrealScript and modding. This board is for coders to discuss and exchange experiences or ask questions.
Post Reply
User avatar
Masterkent
OldUnreal Member
Posts: 1469
Joined: Fri Apr 05, 2013 12:41 pm

Disambiguation of classes with identical names from different packages

Post by Masterkent »

Suppose we have two classes: UnrealShare.Scorch and Botpack.Scorch.

How does the compiler choose what class is being referenced when we use the unqualified class name Scorch?

Code: Select all

class DerivedScorch expands Scorch;

static function Scorch func(Scorch Param)
{
    local Scorch Variable;
    local Actor A;

    Variable = Param.Spawn(class'Scorch');
    A = Variable;

    Log(Scorch(A));
    Log(class<Scorch>(A.Class));

    return Variable;
}
Is there a way to specify the package name in function return types, parameter declarations, variable declarations, and type conversions?

Code: Select all

class DerivedScorch expands Botpack.Scorch; // works

static function Botpack.Scorch func(Botpack.Scorch Param) // doesn't work
{
    local Botpack.Scorch Variable; // doesn't work
    local Actor A;

    Variable = Param.Spawn(class'Botpack.Scorch'); // works
    A = Variable;

    Log(Botpack.Scorch(A)); // doesn't work
    Log(class<Botpack.Scorch>(A.Class)); // doesn't work

    return Variable;
}
Post Reply

Return to “UScript Board”