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"

Creating a USTRUCT() header crashes my project

Hi, I'm having a very strange issue. I am using UE 4.17.2 currently. For my project I need to create a USTRUCT() struct but any time I create it, my project will crash on boot with no error code or stack available. Then if I comment out the whole code if my header file, then the project will load fine. So I know it's this file, but I cannot seem to figure out what's wrong. I followed the tutorial for setting up a struct one of the Unreal documentation pages. Can someone please help me figure out what I'm doing wrong with this script? Everything is minimal because I was worried that parameters were wrong on UPROPERTY()'s. Thanks ahead of time for any help you guys can give.

 #pragma once
 
 #include "CoreMinimal.h"
 #include "Engine/UserDefinedStruct.h"
 #include "SkeletalMeshTypes.h"
 #include "Item_Data.generated.h"
 
 /**
  * BlueprintReadWrite, Category = "Default"
  */
 
 USTRUCT(BlueprintType)
 struct FItem_Data
 {
     GENERATED_USTRUCT_BODY()
 
     UPROPERTY()
         FString Name;
     UPROPERTY()
         FString Description;
     UPROPERTY()
         float Value;
     UPROPERTY()
         float Damage_Physical;
     UPROPERTY()
         float Damage_Ice;
     UPROPERTY()
         float Damage_Poison;
     UPROPERTY()
         float Damage_Thunder;
     UPROPERTY()
         float Damage_Fire;
     UPROPERTY()
         float Defense_Physical;
     UPROPERTY()
         float Defense_Poison;
     UPROPERTY()
         float Defense_Thunder;
     UPROPERTY()
         float Defense_Fire;
     UPROPERTY()
         float Defense_Ice;
     UPROPERTY()
         USkeletalMesh *Equip_Model_Left;
     UPROPERTY()
         USkeletalMesh *Equip_Model_Right;
 };
 
Product Version: UE 4.17
Tags:
more ▼

asked Apr 14 '18 at 02:15 PM in C++ Programming

avatar image

Desmond27
6 1

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

1 answer: sort voted first

I solved my own problem. It turns out you cannot name a STRUCT() struct the exact same name as a Blueprint that is also a struct. So I'm putting this here for anyone who has a similar issue. Don't name defined data types the same name as blueprint-defined data types. It will cause a crash.

more ▼

answered Apr 14 '18 at 03:46 PM

avatar image

Desmond27
6 1

avatar image Arty-McLabin Apr 14 '18 at 11:40 PM

please mark that as solved then (accept your own answer)

(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