[Request] Blueprint support for int8 data type

I have simple struct with int8 types:

USTRUCT(BlueprintType)
struct FEffectsOnCharacter
{
	GENERATED_USTRUCT_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category=EffectsOnCharacter)
	int8 Hexes;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category=EffectsOnCharacter)
	int8 Enchantments;

};

I can define variable, but, I can’t get access to properties. I can’t break structs, assign new values to properties etc.
It will work with float or int, but I don’t want to use these data types, as even int8 is honestly to big for what I need here.

Blueprints have very specific support for uint8, it’s called the Byte variable type (0-255)

is that sufficient for your needs?

If not let me know more about what exact range you need!

For anything smaller than a byte you could probably just declare an Enum, which is a byte in disguise with only a few defined values :slight_smile:

Custom Enums have amazing support in Blueprints!

Just right click in the variable space and click the last entry in the context menu!

:slight_smile:

#:heart:

Rama

#Custom Enums in BP are Awesome

Enum is not an option. I need struct defined in C++, as it acts as datatype, for storing simple information about character. Information which that will be set with C++, and which blueprint will provide.

Byte is not helpful, since C++ do not have such datatype (;.

There is:

UByteProperty Curses;

But it must be defined as pointer. And I’m not convinced that It will be faster than int32, as int in C++ takes only 2 bytes on windows anyway.

“Byte is not helpful, since C++ do not have such datatype (;.”

#C++ Does Have Byte

Byte == uint8

What code are you trying to use that is making you think C++ cannot use the BP Byte variable type ?

#Generated C++ Proof

Observe how the .generated C++ class uses ByteProperty, the same exact thing that is Byte in Blueprints

This is one of my classes, in its .generated form

virtual void SERVER_RightArmBlockedMontage_Implementation(float Duration, uint8 Direction); \
00085: \
00086: DECLARE_FUNCTION(execSERVER_RightArmBlockedMontage) \
00087: { \
00088: P_GET_PROPERTY(UFloatProperty,Duration); \
00089: P_GET_PROPERTY(UByteProperty,Direction); \
00090: P_FINISH; \

#Summary

C++ uint8 == UByteProperty == The Byte variable you see in editor BP graphs

I need to assign value to it directly like:

Curses = Curses + 1.

I mean. Of course I could make things more complicated, but why would I want to do it ? This simple solution is enough for my needs.
As about this byte thing. Yeah you are right. But uint8 is the same thing as int8, so it doesn’t matter it won’t work with blueprint anyway :wink:

'But uint8 is the same thing as int8"

uint8 is not the same int8

int8 range is -128 to 127

uint8 is 0 to 255

the u = unsigned

reference from windows MSDN

#Code please

"I need to assign value to it directly like:

Curses = Curses + 1."

Can you post the code you are trying that is not working?

Haha. Well you are right. My bad was I tried to use UByteProperty directly instead of uint8.

Now that works!