Posted by CogKing on February 09, 1998 at 12:37:56:
In Reply to: Cog question CogKing posted by Osan`gar on February 08, 1998 at 20:14:20:
> Ok, I have a cog script that I am making and I need to detect the vector (position) of the player that enters the sector. I am doing something else with the cog, but I just need to know the position of the player in order to use that vector later. Here is a sample of what I have done.
symbols
int victim local
int senderRef local
vector pos local
code
entered:
victim = GetSourceRef();
senderRef = GetSenderRef();
pos = GetThingPos(victim);
Return;
end;
> The thing is, I want to detect the position of the victim later in the cog. Any ideas? I thought about GetThingPos(), but I need a thing for an element of that verb. How could I use the player integer to detect the players position? Or will I have to do something else?
as above : pos will be the position of the player when he enters the sector.
If you want his position later just reuse GetThingPos(victim). Be careful in
multiplayer tho, as many players can enter the sector and will overwrite the
victim variable quite hapilly.
-CogKing