Disclaimer: First encounter with UnrealScript =noob=
I was making initial scripts for a simple thing I want to do, that is to create a character select screen ala fighting game. Normally, in C++ i would do a fixed enumeration of the IDs of the characters on a file like:
Now I have two classes that would like to re-use this enumeration. One is HUD_CharacterSelect and Character. How can I re-use this enumeration without redefining on the two classes?Code:enum eCharacters { eC_Ryu, eC_Ken, eC_Guile, eC_Chunli, eC_Num };
HUD_CharacterSelect.uc
andCode:class HUD_CharacterSelect extends HUD; var eCharacters Player1;
Character.uc
Compiling results: Unidentified type eCharacters on both sources.Code:class Character extends Pawn; var eCharacters Id;
I've also tried putting the enum on a single class called Constants.uc but didn't work
What's the proper way to do this?Code:class Constants extends Object; enum eCharacters { eC_Ryu, eC_Ken, eC_Guile, eC_Chunli, eC_Num };



Reply With Quote

![Send a message via ICQ to Blade[UG]](images/styles/TwistedDark/misc/im_icq.gif)
![Send a message via AIM to Blade[UG]](images/styles/TwistedDark/misc/im_aim.gif)
![Send a message via MSN to Blade[UG]](images/styles/TwistedDark/misc/im_msn.gif)
![Send a message via Yahoo to Blade[UG]](images/styles/TwistedDark/misc/im_yahoo.gif)



Bookmarks