Hi there,
I am fairly new to C++ and wanted to have a go at coding my own function with parameters. However some of the parameters are arrays and I get strange errors occur. I will comment my code with a couple of other questions as well.
I am writing this for an engine so Everything is declared.
Line 6 - Syntax error at "["
Line 10 - Syntax error at "["
Line 14 - Syntax error at "while"
Line 18 - Syntax error at "CreateObject"
#include "k_inc_generic"
#include "k_inc_utility"
int Populate(int Amount, string TagArray[], float xLoc[], float yLoc[], float zLoc[], float Orient[]); //Do I have to declare it like this?
int Populate(int Amount, string TagArray[], float xLoc[], float yLoc[], float zLoc[], float Orient[])
{
int AutoInc = 0;
while(AutoInc < Amount)
{
int a = AutoInc;
CreateObject(OBJECT_TYPE_CREATURE, TagArray[AutoInc], Location(Vector(xLoc[AutoInc], yLoc[AutoInc], zLoc[AutoInc]), Orient[AutoInc]);
AssignCommand(TagArray[AutoInc],ActionRandomWalk());
AutoInc++;
}
return 0;
}
Thanks in advance.
TB12