Author Topic: Need a way to get the OBJECT that triggered an event, not the CLIENT.  (Read 661 times)

http://forum.blockland.us/index.php?topic=193369.0

I can't make this function with bots because I can't get the object that triggered the event, only the client.

I don't feel like completely overwriting onPlayerTouch or something like that, any other solutions?

You can use onCollide I believe.

noted, for when I decide to overwrite onPlayerTouch, which I don't feel like doing

If a bot actually triggers it, can't you just dump the args?

hook up
onbottouch bot botjump
?

So basically you're wanting the client's player object?

So basically you're wanting the client's player object?
Not necessarily. It could be a bot or a vehicle or a projectile, and none of those have clients.

Not necessarily. It could be a bot or a vehicle or a projectile, and none of those have clients.
Projectiles have clients. Vehicle (and bots - they're the same thing) have brick groups, which have clients (when their owner is on the server, you can use an AiConnection hopefully if you really need a client).

Projectiles have clients. Vehicle (and bots - they're the same thing) have brick groups, which have clients (when their owner is on the server, you can use an AiConnection hopefully if you really need a client).
I had no idea
This should be easy then, lug

The problem here is that by attaching the end argument to registeroutputevent, i'm getting the client that triggered the event
in this case, the owner of the bot
this doesn't help me, because i'm turning around and getting the player from the client, which is the real player

I need to get the OBJECT that triggered the event, not the client from the object

The problem here is that by attaching the end argument to registeroutputevent, i'm getting the client that triggered the event
in this case, the owner of the bot
this doesn't help me, because i'm turning around and getting the player from the client, which is the real player

I need to get the OBJECT that triggered the event, not the client from the object

use bots with clients then

someone explain this black magic to me

Code: [Select]
%cl = new AIConnection()
{
name = "dummy";
bl_id = -1118;
};

%cl.player = new AIPlayer()
{
datablock = playerStandardArmor;
client = %cl;
};

back up a second

can i apply this magical aiConnection to the already existing bot?


calling dump on a gameConnection will give me all the possible variables associated with a new aiConnection, yes?
« Last Edit: May 09, 2012, 11:07:54 AM by Lugnut1206 »

calling dump on a gameConnection will give me all the possible variables associated with a new aiConnection, yes?

just do

new AIConnection("whatever").dump();whatever.delete();