Hey peoples, so I’m working on a game, and I’ve tried to go as far as I could without asking questions and just looking up everything and figuring it out from what I can find, but today’s probably going to be my last day with internet for a while, and https://answers.unrealengine.com has been down for like, forever -.- and I’ve spent so much time trying to deal with #1 that I figured I should just ask everything I’ve been wondering here.
[SOLVED]1. Does anyone know how to actually get data out of a DataTable in entirely in c++? All the results I find on the subject either crash the engine when I open up a blueprints tab for some reason, or just say to make a pointer and make a blueprint of the class and set the pointer with the unreal engine, but I need to do this in a struct, so I can’t really do that. I suppose I could make blueprints out of everything that calls the struct’s functions and just pass in the values, but I’d rather keep things as self contained as possible.
I would just make use a UObject instead of a struct, that way I could make a blueprint child, but I need to save a TArray of them, and I feel like saving an loading instances of classes would be more trouble than it’s worth. I’ve tried looking it up to see if I could, but I can’t find any useful results about the subject.
-
I’ve got a struct that needs to know that my game instance exist, and what’s in it. So I included the instance’s .h file in the .h file of the struct. Problem is the game instance has an array of that struct, so I can’t expose the array to blueprints. I could just include the struct’s .h file in the instance’s .cpp file, but I can’t expose the array to blueprints if I do that. Any ideas? This isn’t really that important since I planned on doing everything in c++, but it would be nice to have the option of accessing it in blueprints.
-
Is it just me or does the skysphere not really work? The clouds stay the same white no matter where the sun is, even though they should turn black during the night and red when the sun is rising/setting based on the color curve driving the cloud color. When I check it out in the blueprints, hovering over the return value of the “Get Linear Color Value” node in the “Update Sun Direction” function tells me “Variable is not in scope” instead of a color like it should. A while back, to confirm it’s not just me, I’ve watched just about every Day/Night Cycle tutorial there is out there, and I’ve never seen the clouds change color. No one else seems to notice/mind though.
[SOLVED]4. This has more to do with programming in general, but when I see people make enums, I always see them doing something like
UENUM(BlueprintType)
enum class E_Days : uint8
{
D_Sunday UMETA(DisplayName = "Sunday"),
D_Monday UMETA(DisplayName = "Monday"),
D_Tuesday UMETA(DisplayName = "Tuesday"),
D_Wednesday UMETA(DisplayName = "Wednesday"),
D_Thursday UMETA(DisplayName = "Thursday"),
D_Friday UMETA(DisplayName = "Friday"),
D_Saturday UMETA(DisplayName = "Saturday")
};
Question is, what’s the point? Why not just put Sunday, Monday, etc. instead of putting the D_ in front? The “class” after “enum” should deal with any other enums with stuff with the same name shouldn’t it?
Sorry for the run on sentences and lack of pictures. My internet is super slow these days and trying to upload a picture is sure to fail -.- Thanks in advance for any help