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"

Graph is linked to private object(s) in an external package.

I encountered my favorit error again.

I thought I did fix my setup now using a UStruct instead a UClass, but this dont seem to fix my problem. I have no really no idea what is causing this error.

I try to make a n-dimensional vector, which works like the FVector, so I looked into Vector.h and KismetMathLibrary and KismetStringLibrary and build the following setup:

NVector.h:

 #pragma once
 
 #include "NVector.generated.h"
 
 USTRUCT(BlueprintType)
 struct FNVector
 {
    GENERATED_BODY()
 
    /* nVector's components. */
    UPROPERTY(BlueprintReadWrite)
    TArray<float> Coordinates;
 
    /* Default constructor (no initialization). */
    FORCEINLINE FNVector();
 
    /* constructor to set n-Dimensions */
    FORCEINLINE FNVector(const TArray<float> InCoordinates);
 
    FString ToString() const;
 };
 
 FORCEINLINE FNVector::FNVector()
 {}
 
 FORCEINLINE FNVector::FNVector(const TArray<float> InCoordinates)
    : Coordinates(InCoordinates)
 {}
 
 FORCEINLINE FString FNVector::ToString() const
 {
    FString s = "";
    s += "{";
 
    for(int i = 0, max = Coordinates.Num(); i < max; i++)
    {
       s += FString::SanitizeFloat(Coordinates[i]);
       if(i < (max - 1))
       {
          s += ", ";
       }
    }
    s += "}";
 
    return s;
 }

MathLabLibrary.h:

 #pragma once
 
 #include "Kismet/BlueprintFunctionLibrary.h"
 #include "Math/NVector.h"
 #include "MathLabLibrary.generated.h"
 
 UCLASS()
 class MATHLAB_API UMathLabLibrary : public UBlueprintFunctionLibrary
 {
    GENERATED_BODY()
 
 public:
    /* Converts a n-vector value to a string, in the form '{x, y, z, ...}' */
    UFUNCTION(BlueprintPure, DisplayName = "ToString (nVector)", Category = "Math Lab|Utilities|String", meta = (CompactNodeTitle = "->", BlueprintAutocast))
    static FString Conv_NVectorToString(FNVector InVec);
 };

MathLabLibrary.cpp:

 #include "MathLab.h"
 #include "MathLabLibrary.h"
 
 FString UMathLabLibrary::Conv_NVectorToString(FNVector InVec)
 {
    return InVec.ToString();
 }

When I go now into a Blueprint, in my case CoordinateSystem, and want to use my structure like this:

alt text

(Compile Blueprint, everything works)

When I than change something in my Code and try to Compile the Blueprint, I get following Error:

alt text

I have no idea what is causing the error Message. I tried to understand the logic how the FVector is created and works and copy that for my NVector.

Product Version: UE 4.14
Tags:
unbenannt2.jpg (36.8 kB)
unbenannt.jpg (30.5 kB)
more ▼

asked Jan 26 '17 at 01:20 PM in C++ Programming

avatar image

TheRealSpook
3 4 5 5

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

1 answer: sort voted first

I searched in the Bug reports and found this Bug UE-36428.

It seems like this is my Problem, am I right?

more ▼

answered Jan 30 '17 at 06:36 PM

avatar image

TheRealSpook
3 4 5 5

(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