Game Development Community

Player type

by Howard Dortch · in Torque Game Engine · 08/23/2004 (7:58 am) · 9 replies

Given this information how can I tell if the player is an AIPlayer or not.

function Armor::damage(%this, %obj, %sourceObject, %position, %damage, %damageType)

#1
08/23/2004 (8:06 am)
if(%obj.isAIControlled())
{

}
else
{

}
#2
08/23/2004 (8:25 am)
This is what I get

Unknown command isAIControlled.
#3
08/23/2004 (9:27 am)
Try

if(%obj.client.isAIControlled())
#4
08/23/2004 (4:45 pm)
This is coppied from my code:

if(%obj.client.isAIControlled())

and the result is this

Unable to find object: '' attempting to call function 'isAIControlled'
#5
08/23/2004 (6:05 pm)
What's %obj? Try doing a dump() on it...
#6
08/23/2004 (6:42 pm)
The bot player when created has obj = 1598 and when I shoot it onDamage is called and in that funciton %obj = 1598 so it looks to be the same thing.

how do I do a dump() in the script?
#7
08/23/2004 (7:10 pm)
%obj.dump();

You can call that directly also.
If the object is 1598 then just type into your console...

1598.dump();
#8
08/23/2004 (7:24 pm)
Ok I got it you want me to post the whole thing?
isAIControlled is not listed under the methods.
#9
08/23/2004 (7:25 pm)
Ok, I did a test on the head. There is currently no way to check a player with the above function, sorry about that. What you can do are several different things, and the most direct being this....


if(%obj.getclassname() $= "AIPlayer")
{
}
else
{
}