31 lines
1022 B
Plaintext
31 lines
1022 B
Plaintext
|
|
// postiton pc to be entered from behind by nearest person (standing).
|
|
|
|
// the #include below is for the MoveToNewLocation command
|
|
#include "x0_i0_position"
|
|
|
|
void main()
|
|
{
|
|
object oPC = OBJECT_SELF ;
|
|
object oTarget = GetNearestCreature(CREATURE_TYPE_IS_ALIVE, TRUE, oPC) ;
|
|
|
|
// get facing of oTarget, set oPC's facing to match
|
|
float fTargetface = GetFacing(oTarget);
|
|
float fPCFace = fTargetface ;
|
|
|
|
// Tweaking oTarget's facing vector angle to line up PCs better
|
|
// fTargetface = GetNormalizedDirection(fTargetface - 60.0);
|
|
|
|
// figure out location we want to move to
|
|
// this is oTarget's position displaced by 0.0*(oTarget's's facing vector)
|
|
object oArea = GetArea(oPC);
|
|
vector posDest = GetPosition(oTarget) + AngleToVector(fTargetface)*0.30;
|
|
location lDest = Location(oArea, posDest, fPCFace);
|
|
MoveToNewLocation ( lDest, oPC);
|
|
|
|
// perform animation
|
|
DelayCommand( 1.0, AssignCommand( oPC, ActionPlayAnimation(ANIMATION_LOOPING_TALK_PLEADING, 0.5, 60000.0)));
|
|
|
|
|
|
}
|