Game Development Community

Problem creating DefineEngineMethod

by Sergio Seligmann Rodrigues · in Torque 3D Beginner · 06/29/2011 (10:19 pm) · 1 replies

Hey guys im having a problem trying to create a DefineEngineMethod. I need to pass to the engine an array that is createded in the editor that contains some objects.

.h
void        setNeiborhood(ArrayObject n);

ArrayObject getNeiborhood() { return neiborhood; };

ArrayObject neiborhood;

.cpp
DefineEngineMethod( Node, setNeiborhood, void, ( ArrayObject n ),, "Documentation string" )
{
	object->setNeiborhood(n);
}

DefineEngineMethod( Node, getNeiborhood, ArrayObject, (),, "Documentation string")

Tnx in advance
{
	return object->getNeiborhood();
}

error C2440: '<function-style-cast>' : cannot convert from 'ArrayObject' to 'ArrayObject *

#1
06/30/2011 (12:23 am)
You need to use pointers, i.e. "ArrayObject*" instead of "ArrayObject".