But as soon as I move to my CPP file it says that it is undefined, I get this errors:
Error (active) declaration is incompatible with "QuestParser::QuestElement QuestParser::getElementFromString(FString element)" (declared at line 27 of "c:\...\Quest\QuestParser.h")17
Error C4430 missing type specifier - int assumed. Note: C++ does not support default-int C:\...\Quest\QuestParser.cpp 18
From the errors, it’s assuming QuestElement is an int or it is out of scope for some unknown reason to me.
QuestElement QuestParser::getElementFromString(const FString element)
{
QuestElement* qElement = new QuestElement();
// Elements are separeted by comas, so if there is "," in the FString it means it has multiple elements
if (element.Contains(","))
{
// This will FString will contain the value of the split;
FString stringA, stringB;
// Loop while there is more elements
do
{
element.Split(",", &stringA, &stringB);
qElement->mainElement.Add(stringA);
// If there is no more element add stringB to the array.
if(!stringB.Contains(","))
qElement->mainElement.Add(stringB);
} while (stringB.Contains(","));
}
return qElement;
}
The error I get is that QuestElement is underfined, but qElement is fine, and the return type does match. I’ve highlight them in read.