UPDATE: Look at this post a bit lower, where setting a basic object’s property has no effect.
Hello all, anyone know why this is happening instead of working as expected?
“Trace” is just a debugging function that displays a value in a Text widget. As you can see the client receives “True” from the event, yet setting the value of the property “HasSliders” on object ActivePreset (Parent class Savegame, but same result on a custom object with CoreObject as parent) does not work, even if I add a delay.
First: My guess is that the code isn’t quite doing what you think it’s doing, although exactly how it’s not doing what you think it’s doing is unclear. Perhaps, instead of setting a property value, you can call a function, and in that function update the property, and in that function also print some debug text?
Second: An on-screen debug widget seems cumbersome. Can you use the Print String function and friends? They’re already implemented and have very low overhead.
Print String and Print Text are extra nice, because they print both to the screen, AND to the log file, so you can go back and check what they said after the fact.
Draw Debug String is nice because it lets you show where in the world things are happening, if that matters (doesn’t seem right for this particular case, though.)
Note that Print String doesn’t NEED to print to the screen if you don’t want to; you can turn off the “Print to Screen” option.
Also, this combos pretty well with Append String, which lets you formulate full statements that include things like the object identifier and maybe some identifying text that makes it easier to find in the log:
(You may already know this. I’m mentioning it because I find that the built-in debug facilities usually are easier to use across the project and perform better than whatever I cobble together myself…)
Thanks for your answer! Making the change in a function called from the event was a good idea I really thought it might work but unfortunately it didn’t. Even used a basic object with parent class CoreUObject.Object, having a single boolean property, brand new, not used anywhere else in the project. Went as simple as I could go as you can see in the screenshot. It really seems like setting properties refuses to work, maybe multicast events don’t permit that for some reason.
As for the debug function, I have no choice to use that as this is a mod for a game called “Deep Rock Galactic”, so the only way of testing is launching the game, for which I obviously don’t have access to debugging and print strings. That’s why I needed to make my own “Trace” function to display values in widgets of the mod’s UI. The issue really is that the object refuses to set its property.
Setting the boolean property of a structure works however… I don’t get it.
I just came here to say exactly that and saw you thought about it too! Thanks so much!
Since object has a default value, I thought it was just created when the Actor in which it’s located instantiated it… mind blown… been working on UE for over a year now, I had NO IDEA objects were not created on Actor Spawning
How do I even create a custom Basic Object like this? “Construct object from class” doesn’t seem to have the option from my class. Searched “BasicObject”, nothing either.
EDIT: Nevermind, was able to select it from the dropdown, not sure why it didn’t work on the first try, maybe I needed to rebuild
I personally treat each and every “attempt to read/write property on NULL object” log message as a compile error. If I’m using Visual Studio, I’ll even put a breakpoint there, just to force myself to not ignore it
I wish there was some “pedantic” mode we could turn on that would hard-stop at any kind of lint. Artists would hate it, but it would lead to more robust code!