Download

How do: game configFile?

Can I do something so I can access configFile from blueprints?, like this, datatable analog, but with inheritance:



class configFile {
public:
class cfgVehicles {
public:
class base_car {
public:
int speed = 80;
FString displayName = "unknown";
};
class uazVehicle : public base_car {
public:
FString displayName = "uaz";
};
class uazVehicle2 : public uazVehicle {
public:
FString displayName = "uaz2";
};
class uralVehicle : public base_car {
public:
FString displayName = "ural";
};
};
};


I try create UObject c++ class with .h:


class configFile {
public:
class cfgVehicles {
public:
class base_car {
public:
int speed = 80;
FString displayName = "unknown";
};
class uazVehicle : public base_car {
public:
FString displayName = "uaz";
};
class uazVehicle2 : public uazVehicle {
public:
FString displayName = "uaz2";
};
class uralVehicle : public base_car {
public:
FString displayName = "ural";
};
};
};

and c++ blueprint function to get data:


configFile::cfgVehicles::uazVehicle2 data;
int getInt = data.speed;
FString getString = data.displayName;
UE_LOG(LogTemp, Warning, TEXT("%s"), *FString::FromInt(getInt));
UE_LOG(LogTemp, Warning, TEXT("%s"), *getString);

this work,but,can i use dynamic data type configFile::cfgVehicles::uazVehicle2 data; and **class member (**data.**speed) **as **FString **argument?