Download

Procedural Loot Drop Table System

Hi everyone!.

I wanted to make an Procedural Drop System based in this C# code i found in CodeProject to Unreal C++ (i’m a bit experienced with C++, but a noob with Unreal’s Object System.), due it’s really, really difficult achieve it, but when i tried to make it the Unreal Object System imposed a lot of limitations i’m stuck:

  • Inherited Properties can’t be used in child classes of IRDSObject or RDSObject inside.
  • Multiple constructors, there’s like 5 variables (a double, 3 bools and an RDSTable reference i have to make) i have to initialize + other properties from child classes which derives them
  • Serialize an hierarchy of Loot Items and Loot Tables using Unreal’s Serializing System, and Deserializing them
  • Special C# code which i’m unable to figure out yet: such Activator.CreateInstance(this.GetType()) but i have an idea of ConstructObject function could help.
  • Multiple inheritance is forbidden (i know why, in order to avoid complicated RTTI) unless are Unreal interfaces.

There’s some tips for me you could tell me in order to port this in UE4 C++?, thanks.

Not sure exactly what you mean by “i tried to make it the Unreal Object System”, you can code in plain C++ and then make some bridges with UE API classes if you need to. Do think of creating your C++ classes from the UE editor though so they are remembered when the Visual Project Solution is generated.

I think you might be overcomplicating it by trying to use UE4’s class/object system. Just focus on porting the code to C++ and then when it’s working apply it to your actual gameplay by using UE4 functionality. There’s no point in using UE4 objects unless you plan for them to interact with the game world, the client or the editor somehow.