News UnrealEd Files Mods FragBU Liandri Archives
BeyondUnreal Forums

Go Back   BeyondUnreal Forums > Unreal Development > Coding

Reply
 
Thread Tools Display Modes
Old 27th Aug 2012, 08:34 AM   #1
SimonDenton
Registered User
 
SimonDenton's Avatar
 
Join Date: Mar. 23rd, 2009
Location: Australia
Posts: 13
Exclamation Custom enumeration

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.
__________________
SimonDenton is offline   Reply With Quote
Old 27th Aug 2012, 12:24 PM   #2
Wormbo
 
Wormbo's Avatar
 
Join Date: Jun. 4th, 2001
Location: Germany
Posts: 5,774
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.
__________________
Wormbo's UT/UT2004/UT3 mods | YouTube channel | PlanetJailbreak/JDN | Unreal Wiki | Liandri Archives
Everything you ever wanted to know about replication| UnrealScript security considerations
<elmuerte> you shouldn't do all-nighters, it's a waste of time and effort
<TNSe> nono
<TNSe> its always funny to find code a week later you dont even remember writing
<Pfhoenix> what's worse is when you have a Star Wars moment
<Pfhoenix> "Luke! I am your code!" "No! Impossible! It can't be!"
Wormbo is offline   Reply With Quote
Old 27th Aug 2012, 11:04 PM   #3
SimonDenton
Registered User
 
SimonDenton's Avatar
 
Join Date: Mar. 23rd, 2009
Location: Australia
Posts: 13
Thanks for the reply 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?
__________________
SimonDenton is offline   Reply With Quote
Old 28th Aug 2012, 06:12 AM   #4
Gizzy
The Banhammer Cometh
 
Gizzy's Avatar
 
Join Date: May. 30th, 2009
Location: United Kingdom
Posts: 195
No, just create an abstract class with the enum methods in, the subclass THAT with your actual class.
Gizzy is offline   Reply With Quote
Old 28th Aug 2012, 10:48 AM   #5
Wormbo
 
Wormbo's Avatar
 
Join Date: Jun. 4th, 2001
Location: Germany
Posts: 5,774
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.
__________________
Wormbo's UT/UT2004/UT3 mods | YouTube channel | PlanetJailbreak/JDN | Unreal Wiki | Liandri Archives
Everything you ever wanted to know about replication| UnrealScript security considerations
<elmuerte> you shouldn't do all-nighters, it's a waste of time and effort
<TNSe> nono
<TNSe> its always funny to find code a week later you dont even remember writing
<Pfhoenix> what's worse is when you have a Star Wars moment
<Pfhoenix> "Luke! I am your code!" "No! Impossible! It can't be!"
Wormbo 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 09:17 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