x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Need help with C++ USTRUCT

I type this few lines of code in my header file, nothing else, but it keep getting error. help please. #pragma once

 #include "Kismet/BlueprintFunctionLibrary.h"
 #include "BP_FLib_CharacterStructure.generated.h"
 USTRUCT(BlueprintType)
 struct CharacterStatusStructure
 {
     GENERATED_USTRUCT_BODY()
     UPROPERTY()
     int32 CharacterMaxHealth;
 };
 
Product Version: UE 4.10
Tags:
more ▼

asked Feb 29 '16 at 01:43 AM in C++ Programming

avatar image

jason,Li
3 2 2

avatar image jason,Li Feb 29 '16 at 02:03 AM

alt text

capture_ue.png (24.2 kB)
avatar image jason,Li Feb 29 '16 at 02:04 AM

This is the error I am getting.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

Change your struct name to FCharacterStatusStructure

So it should be:

 USTRUCT(BlueprintType)
  struct FCharacterStatusStructure
  {
      GENERATED_USTRUCT_BODY()
      UPROPERTY()
      int32 CharacterMaxHealth;
  };

And that should work. I actually thought the 'F' prefix for structs was just best practice, but it looks like it's enforced.

more ▼

answered Feb 29 '16 at 02:23 AM

avatar image

Hennez
202 16 15 27

avatar image jason,Li Feb 29 '16 at 02:27 AM

wow. It solved the problem. thank you for your quick help. I've been scratching out my head all afternoon. XDD Love your guys.

avatar image Hennez Mar 01 '16 at 12:36 AM

No worries, glad to help! Go ahead and mark my response as the answer so other people with the same issue can find it quickly.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

Hi Jason,

What is the error you're getting? Can you copy paste the compiler output?

more ▼

answered Feb 29 '16 at 01:50 AM

avatar image

Hennez
202 16 15 27

avatar image jason,Li Feb 29 '16 at 02:04 AM

alt text

capture_ue.png (24.2 kB)
avatar image jason,Li Feb 29 '16 at 02:05 AM

This is the error I am getting.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question