Author Topic: Hidden Syntax Error  (Read 684 times)

The console said something in this function had a syntax error...

Code: [Select]
function fxDTSBrick::onCoordTele(%this,%client,%coordname)
{
$InputTarget_Self=%this;
$InputTarget_Player=%client.player;
$InputTarget_Client=%client;
$InputTarget_MiniGame=getMinigameFromObject(%this);
$InputTarget_CoordOwnerPlayer=$CoordinateEvents::coordVar[%coordname]::CoordOwnerPlayer;
$InputTarget_CoordOwner=$CoordinateEvents::coordVar[%coordname]::CoordOwner;
%this.processInputEvent(onCoordTele);
}

What is wrong with it?
« Last Edit: April 09, 2009, 08:09:10 PM by Club559 »

The console said something in this function had a syntax error...

Code: [Select]
function fxDTSBrick::onCoordTele(%this,%client,%coordname)
{
$InputTarget_Self=%this;
$InputTarget_Player=%client.player;
$InputTarget_Client=%client;
$InputTarget_MiniGame=getMinigameFromObject(%this);
$InputTarget_CoordOwnerPlayer=$CoordinateEvents::coordVar[coordname]::CoordOwnerPlayer;
$InputTarget_CoordOwner=$CoordinateEvents::coordVar[%coordname]::CoordOwner;
%this.processInputEvent(onCoordTele);
}

What is wrong with it?

$InputTarget_CoordOwnerPlayer=$CoordinateEvents::coordVar[coordname]::CoordOwnerPlayer;

No % before coordname.

Sorry, I pasted the code wrong... it had the %.

What's wrong with it NOW?

Sorry, I pasted the code wrong... it had the %.

What's wrong with it NOW?

You should post the console.log.

function fxDTSBrick::onCoordTele(%this,%client,%coordname)
{
   $InputTarget_Self=%this;
   $InputTarget_Player=%client.player;
   $InputTarget_Client=%client;
   $InputTarget_MiniGame=getMinigameFromObject(%this);
   $InputTarget_CoordOwnerPlayer=$CoordinateEvents::coordVar[%coordname]::CoordOwnerPlayer;
   $InputTarget_CoordOwner=$CoordinateEvents::coordVar[%coordname]::CoordOwner;
   %this.processInputEvent(onCoordTele);
}

What is wrong with it?

Can't have arrays in the middle of a variable, and you might need quotations on the last one.

processInputEvent requires a client variable as well as what Truce said.