Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // turn and move child prim on chat commands
- // JR 2018-09-22
- turn() {
- llSetText("turn", <1,1,1>, 1);
- rotation smallAngle = llEuler2Rot(<0,0,15>*DEG_TO_RAD);
- rotation newRot = smallAngle*llGetLocalRot();
- llSetLocalRot(newRot);
- }
- step() {
- llSetText("step", <1,1,1>, 1);
- vector forward = <0.05,0,0>; // short step on X
- vector toMove = forward*llGetLocalRot(); // point as I point
- vector newPos = llGetLocalPos()+toMove;
- llSetPos(newPos);
- }
- process(string message) {
- if ( message == "turn") {
- turn();
- } else if ( message == "step" ) {
- step();
- } else {
- llWhisper(0, "impossible");
- }
- }
- default {
- state_entry() {
- llListen(10, "", "", "turn");
- llListen(10, "", "", "step");
- }
- listen(integer channel, string name, key id, string message) {
- process(message);
- }
- }
Add Comment
Please, Sign In to add comment