I didn’t use any .csv File, I tried creating it only with new Features in 4.7. I created a Structure where I created these new Variables like “Actor” class but when I then create a DataTable from that struct, I am not able to edit any Values inside of new RowEditor.
Since Actor variable is looking for an instance of Class, you can’t set a default value for it, neither in a Struct nor a Data Table made from that Struct. There is no way, however, to edit Data Table at runtime at this moment, so I have entered a bug report for developers to consider (UE-8001). I’ll let you know what they say when I see an update. Thanks for report!
Thanks for reply!
I would understand it with (in my example) BP, since it has to be a reference/instance, but shouldn’t BP2 (Actor Class) work, since its no actual instance and just points to a default Blueprint? So I would be able to spawn it via runtime from DataTable?
I’m not sure, but I’ve included notes to that effect in bug report. I’m not certain how quickly they’ll get to this one, so you may need to find an alternative to Data Tables for this at moment. I will let you know when I get any kind of response.
At moment, you’ll need to build another system for that kind of functionality. Easiest thing to do would probably to use arrays, and just pre-fill arrays with data you would put in a data table. Since arrays can be adjusted during gameplay, this should be a suitable workaround.
As a side note, there is an additional bug report for certain variable types that do not allow defaults in structs as well, such as Class as discussed above. I’ll update this post when I see an update on that as well.
I don’t usually “bump” threads, but I’d really like to see ability to edit class references in DataTable Editor as well. I’m seeing quite a few long-open issues on AnswerHub around new DataTable Editor that could be closed as Solved if we had this capability.
I mean, if we could even just have a text field for Actor class fields where we could enter class name (of if we had a function that would do equivalent of “Get Class By Name”) that would be a HUGE win.
This should be fixed by a general Struct overhaul that allows Structs to set defaults for multiple types that are currently missing. It’s a very new change and probably won’t make it into 4.8 (it hasn’t even been verified, yet), so you may not see it until 4.9.
Once I get confirmation that it’s fixed and verified, I will try to find GitHub commit(s) for it and post it here so you can implement it before 4.9 release. Thanks for your patience!
Is there a C++ implementation to this that anyones aware of? Would make my life a lot easier with my current setup.
I was reading this
Thing is, BPs are actually a bundle of data. You are not including an extension, you are accessing object inside of blueprint. BP consists (to my knowledge) of actual Blueprint logic (MyBP.MyBP) and generated C++ class for BP (MyBP.MyBP_C). If you want to automatically load up a class from a BP, you’d do it like this:
In my struct I have
UPROPERTY(BlueprintReadOnly, Category = “Magic”)
This works like a charm for me. All my spells derive from a shared base class so I just cast Actor class I get to my own class and work with that.
Since all my items derive from a base actor class I should be able to create my crafting system similarily, by just creating struct in C++ to find specific classes for say craftable_rock and craftable_pully that all inherit from master_item and allow my BP designers to then use BP getRow functions to spawn those classes or remove them from an array or otherwise?