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.

UE1 - UT Custom enumeration

Discussion in 'Programming' started by SimonDenton, Aug 27, 2012.

  1. SimonDenton

    SimonDenton New Member

    Joined:
    Mar 23, 2009
    Messages:
    13
    Likes Received:
    0
    Hey all,

    I am programming for a Deus Ex mod which uses UE1 and I have a problem that is very odd.

    I declare an enumeration:
    Code:
    enum summerBarks
    {
    BM_Idle,
    BM_CriticalDamagePlayer,
    BM_CriticalDamageGeneric,
    etc...
    }
    
    var summerBarks sB;
    In a separate class I call a function involving this variable:
    Code:
    function bool SummerStartAIBarkConversation(Actor conOwner,SummerBarkManager.summerBarks sB)
    Where SummerBarkManager is a variable within this different class.

    I get this error:

    : Error, Missing variable name
    Failed due to errors. for the above line involving the function. If I simply make it
    Code:
    function bool SummerStartAIBarkConversation(Actor conOwner,summerBarks sB)

    I get: : Error, Unrecognized type 'summerBarks'

    Please tell me what I am doing wrong and notify me of a strategy to make this work. Thanks in advance.
     
  2. Wormbo

    Wormbo Administrator Staff Member

    Joined:
    Jun 4, 2001
    Messages:
    5,910
    Likes Received:
    35
    Enums and structs are only known in subclasses of the class they are declared in. Unlike later engine generations, UE1 doesn't provide any way reasonable around that limitation.

    Even UT2004 has identical ESurfaceTypes declarations in the Actor and Material classes. However, I think that's mainly for reasons concerning the native code. Due to the new DependsOn() class modifier, UE2 classes can actually share structs and enums.
     
  3. SimonDenton

    SimonDenton New Member

    Joined:
    Mar 23, 2009
    Messages:
    13
    Likes Received:
    0
    Thanks for the reply :D Yeah Actor.uc consists of the enum that was used for the original functions...would that mean I'd have to code for a custom Actor class thus recoding EVERYTHING?
     
  4. Gizzy

    Gizzy The Banhammer Cometh

    Joined:
    May 30, 2009
    Messages:
    195
    Likes Received:
    0
    No, just create an abstract class with the enum methods in, the subclass THAT with your actual class.
     
  5. Wormbo

    Wormbo Administrator Staff Member

    Joined:
    Jun 4, 2001
    Messages:
    5,910
    Likes Received:
    35
    In any case, enums are just named byte values. You should be able to assign between them with some combination of intermediate byte variable and typecasting.
     

Share This Page