Barbie wrote:even if these classes contain the same enum
In my understanding you have defined two enumeration that have accidentally the same name but in fact are different for the compiler. I'd try commenting out one of both.
Nu, I didn't create them accidentally with the same name. You can't use the struct or enum from a class into another class but, since I needed to compare the "apparently same" struct and enum of two different classes, I needed to declare them on both classes.
EDIT: I tried solving removing all struct and enum declarations. I created a class which acts like an enum:
Code: Select all
class BuildInfo extends Info;
const BUILD_ALPHA = 0;
const BUILD_BETA = 1;
const BUILD_PRERELEASE = 2;
const BUILD_RELEASE = 3;
And I put this piece of code on any other class:
Code: Select all
var float VERSION;
var int BUILD;
var float REVISION;
Default properties of these classes are like these:
Code: Select all
defaultproperties
{
VERSION=0.8;
BUILD=BuildInfo.BUILD_BETA;
REVISION=1;
}
So I changed the assignment from this:
Code: Select all
module.FULL_VERSION.Build = default.FULL_VERSION.Build;
to this:
Now the probem is, that if I log "module.FULL_VERSION.Build" I get a "0" whatever the value is.
EDIT 2: Oh no -.-
From Unreal Wiki:
Code: Select all
Starting with Unreal Engine 3 you can access constants from other classes by using the const keyword like shown below.
EDIT 3: Ok I modified the BuildInfo class as follow:
Code: Select all
class BuildInfo extends Info;
var const int BUILD_ALPHA;
var const int BUILD_BETA;
var const int BUILD_PRERELEASE;
var const int BUILD_RELEASE;
Unreal Wiki says, about variable modifiers:
Code: Select all
Const
Prevents any changes to this variable from within UnrealScript. You are still allowed to specify a value in the defaultproperties block and access the variable's value in your code.
And so I set them into the default properties as follow:
Code: Select all
defaultproperties
{
BUILD_ALPHA=0;
BUILD_BETA=1;
BUILD_PRERELEASE=2;
BUILD_RELEASE=3;
}
Rest of the code didn't change, but it still gives me a "0" instead of the value set into the default properties of the other classes for the variable "BUILD". For example:
Even if I write it this way:
Code: Select all
BUILD=BuildInfo.default.BUILD_BETA;
I still get a "0"...