Problems modifying a trigger (resolved)
by Drethon · in Torque Game Engine Advanced · 03/25/2009 (4:48 pm) · 1 replies
Edit: Apologies to anyone who was going to help, the issue was not what I thought it was in the first place and I figured it out by debugging. My player was not creating the error, it was the NPC moving in and out of the trigger that caused the issue I thought I was seeing. Maybe this will end up being helpful to others...
This code worked in TGE and I'm trying to figure out how to port this properly and haven't found any info available. If I do I'll post the solution but if I can't I'm hoping someone can help me.
My specific issue right now (and hopefully will be the only one) seems to be with the call to getControlObject in the following code as I am getting this error:
scriptsAndAssets/server/scripts/zone.cs (39): Unable to find object: '' attempting to call function 'getControlObject'. MyZone exists within the PlayerData datablock...
function DefaultZone::onEnterTrigger(%this,%trigger,%obj)
{
// This method is called whenever an object enters the %trigger
// area, the object is passed as %obj. The default onEnterTrigger
// method (in the C++ code) invokes the ::onTrigger(%trigger,1) method on
// every object (whatever it's type) in the same group as the trigger.
Parent::onEnterTrigger(%this,%trigger,%obj);
%obj.client.getcontrolobject().MyZone = %this ;
}
This code worked in TGE and I'm trying to figure out how to port this properly and haven't found any info available. If I do I'll post the solution but if I can't I'm hoping someone can help me.
My specific issue right now (and hopefully will be the only one) seems to be with the call to getControlObject in the following code as I am getting this error:
scriptsAndAssets/server/scripts/zone.cs (39): Unable to find object: '' attempting to call function 'getControlObject'. MyZone exists within the PlayerData datablock...
function DefaultZone::onEnterTrigger(%this,%trigger,%obj)
{
// This method is called whenever an object enters the %trigger
// area, the object is passed as %obj. The default onEnterTrigger
// method (in the C++ code) invokes the ::onTrigger(%trigger,1) method on
// every object (whatever it's type) in the same group as the trigger.
Parent::onEnterTrigger(%this,%trigger,%obj);
%obj.client.getcontrolobject().MyZone = %this ;
}
Torque 3D Owner Drethon
Default Studio Name