Posted by Elanthil on March 19, 1998 at 15:50:15:
In Reply to: Making people follow you:Pele if ya' see this help posted by Making people follow YOU without shooting you on March 19, 1998 at 15:21:15:
> Ok,
> First of all don't even suggest sidekick.cog! They follow you and then they shoot you and eventually kill you. The reason I asked for Pele's help is because he recently released a level where this woman follows you around the whole time. Pele if your reading this please send me the .cog you used in that level. If anyone else is reading this and thinks they can help please do. ESCPECIALLY CK!!! My E-mail is Overkill66@hotmail.com
HERE is the follow cog you need..in the case of enemies, you must also set their
AI related flags to be friendly..details are in JKSPECS (in other words, I forget how, but it can be done with a simple flag setting)
Copy the below into notepad and save it to the directory you have your project files in as r2followme.cog. save another copy to jedcogs directory to register it with JED (avoids cog.jlh file not found error message)
# Jedi Knight Cog Script
#
# r2followme.cog based on S6L1_R2.cog
#
# R2, faithful droid, makes a droid or other actor/thing follow you
# will work on inanimate objects as well
# [RK]
#
# Original (C) 1997 LucasArts Entertainment Co. All Rights Reserved
#these comment lines MUST be left in the cog
#Modified by Elanthil(David Brown) [elanthil@neo.lrun.com]
#'MYVECTOR' information provided by CogKing of Code Alliance (darkjedi.com)
#thanks CogKing!
#NOT supported by LucasArts in any way
#
# Modified to keep a small distance (.2 JKU) between you and the
#'droid' so it wont push you around.
#if making enemies follow you, set the AI flag for that enemy
#to 'friendly' (see JKSPECS on Darkjedi.com for details)
# ========================================================================================
symbols
message startup
message pulse
thing R2
int player
end
#=======================================================================
code
startup:
SetPulse(1.0);
return;
pulse:
// myvector...This should be a 0.2 length vector along the droid to player vector :
player=GetLocalPlayerThing();
AiSetMode (r2, 0x2009);
AISetMoveSpeed(r2, 1);
AISetLookPos(r2, GetThingPos(player));
myVector = VectorScale( VectorNorm( VectorSub( GetThingPos(player), GetThingPos(r2))), 0.2);
AISetMovePos(r2, VectorSub(GetThingPos(player), myVector));
return;
end
#=======================================================================
good luck :D