|
Mrc Homewood
Mentor of Randomness
Join date: 24 Feb 2007
Posts: 779
|
06-28-2008 14:45
yep... im back to the substrings again i cant cant figure out what im doing wrong, its like it dosent even attempt to work but it is anyone have any clues? i got a feeling i defined something wrong in the sensor vector placment = <1,0,1>; // tells what offset to use string meep; default { state_entry() { llListen(0, "", llGetOwner(), ""); } listen(integer channel, string name, key id, string message) { if (llGetSubString(llToLower(message),0,6) == "follow") { meep = llGetSubString(message,7, -1); llSensorRepeat("", NULL_KEY, AGENT, 96, PI,0.01); } } sensor(integer m) { integer q; for (q == 0; q < m; q++) { if (llSubStringIndex((llDetectedName(q)), meep) == 0) { llSetStatus(STATUS_PHYSICS,TRUE); llMoveToTarget(llDetectedPos(q) + placment*llDetectedRot(q),1); } } } no_sensor() { llOwnerSay("Avatar Not Sensed"); llResetScript(); } }
|
|
Dora Gustafson
Registered User
Join date: 13 Mar 2007
Posts: 779
|
06-28-2008 15:15
mind reading is not my best... what do you want? what is happening?
_____________________
From Studio Dora
|
|
Mrc Homewood
Mentor of Randomness
Join date: 24 Feb 2007
Posts: 779
|
06-28-2008 15:59
when the owner says something like "follow mrc" the object will turn physical and follow the person said by the owner, if the sensor cant detect the person it will say it cant detect them
|
|
Dora Gustafson
Registered User
Join date: 13 Mar 2007
Posts: 779
|
06-28-2008 16:33
From: Mrc Homewood when the owner says something like "follow mrc" the object will turn physical and follow the person said by the owner, if the sensor cant detect the person it will say it cant detect them Thats what you want it to do? Does it sense? does it move? if (llGetSubString(llToLower(message),0,6) == "follow"  should be if (llGetSubString(llToLower(message),0,5) == "follow"  if you want a hit
_____________________
From Studio Dora
|
|
Mrc Homewood
Mentor of Randomness
Join date: 24 Feb 2007
Posts: 779
|
06-28-2008 17:49
thanks for that  works but now i noticed another thing, if the avatar isnt sensed it is saposed to say that it wosent sensed but it dosent any ideas?
|
|
Xhawkx Holden
Registered User
Join date: 1 Nov 2006
Posts: 86
|
06-28-2008 18:39
the No Sensor only triggers if there isn't ANYONE to be sensed... use this... for the sensor part... Not tested in world.... sensor(integer m) { integer found=0; integer q; for (q == 0; q < m; q++) { if (llSubStringIndex((llDetectedName(q)), meep) == 0) { found=1; llSetStatus(STATUS_PHYSICS,TRUE); llMoveToTarget(llDetectedPos(q) + placment*llDetectedRot(q),1); } } if(found==0) { llOwnerSay("Avatar Not Sensed"  ; llResetScript(); } }
|
|
Mrc Homewood
Mentor of Randomness
Join date: 24 Feb 2007
Posts: 779
|
06-28-2008 19:55
yep it works thanks for the help
|
|
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
|
06-28-2008 22:06
You might ALSO want to give a message that the target isn't found in the 'no_sensor' handler. Not that it is TERRIBLY likely when there's someone there giving the command, but logically completes the puzzle. Might as well cover those corner cases.
|