Game Development Community

Finding initator of OnFire event

by Davis Ray Sickmon, Jr · in Torque Game Engine · 05/06/2002 (2:57 pm) · 6 replies

OK, I'm scratchin' my head here. I've got a little customizing I'm doing to the crossbow.cs, in particular in the OnFire event.

Well, one of the things I need to do is find out who fired the weapon. Of course, %client isn't passed through the OnFire event. That's where I start scratchin' my head - how would I backtrack to find out who fired it?

#1
05/06/2002 (4:24 pm)
%obj will return the %playerId of the person firing the weapon.

%obj.clientId should contain the %clientId
#2
05/06/2002 (5:49 pm)
Thanks for the info. You put me on the right track, but, there seemed to be some funkyness with your info - OR, I was just usin' it wrong :-)

I tried:
%client=%obj.clientId;

When checked with an echo to the console, %client (and %obj.clientID) was empty. However, %obj does parse out to be the playerId, which was good enough for me and got the job done.

Again - thanks for the info :-)
#3
05/06/2002 (7:08 pm)
It should only be %obj.client not %obj.clientid :)
#4
05/06/2002 (7:18 pm)
Duh. Ok, well, that makes sense. Didn't try that!
#5
05/06/2002 (11:45 pm)
Sorry about that... I was at work and didn't have my notes handy.
#6
05/07/2002 (7:00 am)
Hey Harold - ya pointed me in close enough to the right direction the first time to make it work :-) I just wanted to make sure to post back incase your notes were wrong, or someone else was lookin for information along the same lines!

Ya outta write up part o' your notes and post 'em in the TGE Script Documentation The more things documented, the better :-)