Client in the trigger
by Wayne · in Technical Issues · 04/07/2008 (7:42 am) · 3 replies
Hi guys...
i have a trigger and through torque script I want to know, when a player enters the trigger. Unfortunately but reasonably I get the "somebodys in there" event, also when a opponent (aiplayer) enters the trigger. Is there a way I can assure that I am only notified when the Client enters the trigger?
i have a trigger and through torque script I want to know, when a player enters the trigger. Unfortunately but reasonably I get the "somebodys in there" event, also when a opponent (aiplayer) enters the trigger. Is there a way I can assure that I am only notified when the Client enters the trigger?
#2
And classname check for an AIPlayer.
04/07/2008 (8:54 am)
Classname check for a Player (human/client)function PlayerOnlyTrigger::onEnterTrigger(%this,%trigger,%obj)
{
%checkclass = %obj.getclassname();
if(%checkclass $= "player")
{
echo("PLAYER in trigger");
}
else
{
echo("NOT player in trigger");
}
Parent::onEnterTrigger(%this,%trigger,%obj);
}And classname check for an AIPlayer.
function AIonlyTrigger::onEnterTrigger(%this,%trigger,%obj)
{
%checkclass = %obj.getclassname();
if(%checkclass $= "AIplayer")
{
echo("AI in trigger");
}
else
{
echo("NOT an AI in trigger");
}
Parent::onEnterTrigger(%this,%trigger,%obj);
}
#3
04/07/2008 (10:00 am)
Thanks a lot... works
Torque Owner Jason MacWilliams
function MyTrigger::onEnterTrigger(%this, %trigger, %obj){ %client = %obj.client; if (!%client){ echo("Not a client!"); return; } ... }Will prevent bots from sender onenter messages, does that help?