Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Follower - Zombie Steps Style....

Kain Cleaver
Registered User
Join date: 24 Jan 2006
Posts: 178
02-04-2007 17:42
I need help. i want to make a zombie like object that will detect the owners possition and take small steps towards them. rotating to look at them too.


i cant figure out how to use llSetPos to only move forward a little at a time insted of right to the owner... can someone help? and rotation too :( please?



this is what i have
-----------------------

integer target;
string name;

init()
{
llSetStatus(STATUS_DIE_AT_EDGE,FALSE);
}

default
{
on_rez(integer n)
{
llResetScript();
}

state_entry()
{

}
touch_start(integer num_detected)
{
state holding;
}


listen(integer n, string m, key k, string msg)
{
//if (llGetSubString(msg,0,3) == "hold";)
name = msg;
llSensor(llGetOwner(),llGetOwner(),AGENT,512,2*PI);

}

sensor(integer num)
{
target = num;
llSetPos(llDetectedPos(0)+ <0,0,0>;);
//llPushObject(llDetectedKey(num),<0,0,1000>,ZERO_VECTOR,FALSE);
//llMoveToTarget(llDetectedPos(num),.1);
state holding;
}
}

state holding
{
state_entry()
{

llSensorRepeat("",llGetOwner(),AGENT,96,TWO_PI,0.01);
}

sensor(integer num)
{
llSetPos(llDetectedPos(0) + <0,.1,0>;);
llSetRot(llDetectedRot(0));

}
no_sensor()
{
vector pos=llGetPos();
if(pos.z<20)
{
llSetPos(pos+<0,0,-10>;);
}
}
}
Kain Cleaver
Registered User
Join date: 24 Jan 2006
Posts: 178
02-04-2007 19:09
anyone? please?
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
02-05-2007 03:03
Isnt this the same as your other thread?