Help needed with script
by Le Roi · in Torque Game Builder · 06/14/2006 (12:12 pm) · 2 replies
I have the following function :
function Controller::setMoveMap(%controller , %map)
{
if(isObject(%controller.Map))
{
%controller.Map.pop();
}
%controller.Map = %map;
%controller.Map.push();
}
Then I do this
$ActionMap1 = new ActionMap(moveMap);
moveMap.bindCmd(keyboard,"d","KeyDown($Controller1,right)","KeyUp($Controller1,right)");
$Controller1.setMoveMap($Controller1,$ActionMap1);
Why in the first function does the parameters not come through correctly ? I only refceive the $Controller value ?
Thanks
Le Roi
function Controller::setMoveMap(%controller , %map)
{
if(isObject(%controller.Map))
{
%controller.Map.pop();
}
%controller.Map = %map;
%controller.Map.push();
}
Then I do this
$ActionMap1 = new ActionMap(moveMap);
moveMap.bindCmd(keyboard,"d","KeyDown($Controller1,right)","KeyUp($Controller1,right)");
$Controller1.setMoveMap($Controller1,$ActionMap1);
Why in the first function does the parameters not come through correctly ? I only refceive the $Controller value ?
Thanks
Le Roi
About the author
Torque Owner Andrew Douglas
Edit: so your definition would look like this:
function Controller::setMoveMap(%this, %controller , %map)
but your call would still be
$Controller1.setMoveMap($Controller1,$ActionMap1);