In the editor, I want MaxHealth to be greyed out as field if IsDestructible is set to false, to make it clear for other team members. Does anyone know of a way to set this up in C++?
I want to achieve the same function!
Before I know the answer, I had to put all the inter-related properties in the construction function and give an invalid value to the property I want to “disable”(sth. like: if(!IsDestructible){MaxHealth = -1;}).
Graying out is much better than my current solution, because it will took some time before I explained what are all the “Invalid” values to all the team members.
But it has to be a simple bool variable. Even a bool expression like “SomeVariable>100.0f” won’t work.
Also, when referring to members by name, there’s a useful macro in the engine to make sure that member exists: GET_MEMBER_NAME_CHECKED. If you rename the variable for whatever reason later on, any attempts to use the variable by name will fail to compile, letting you know where you need to update them.
Lastly, never ever compare by FString when you can compare by FName. FString comparisons have to compare each character in the string, but FNames use a special hashing mechanic to allow much faster comparisons.
Is it possible to do this through blueprints? I am working on a blueprint only project. This issue is not a stopper for me, but it will be nice if I can add that eye candy through bluepritns
Don’t think it’s possible with just blueprints, no. Might be a potential feature, the new(ish) EditCondition UPROPERTY field is pretty powerful - wonder if that could be exposed in the BP editor.