Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

How to make avatar move faster?

Wezza Writer
Registered User
Join date: 9 Jun 2009
Posts: 59
08-26-2009 02:09
I have seen object that you can wear and enable your avatar to move faster, but since it cannot be modified, I cannot check the script for example.

I also wondering how to make my avatar do a dance at a certain time.
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
08-26-2009 06:46
From: Wezza Writer
I also wondering how to make my avatar do a dance at a certain time.

How certain? If you mean, "Dance when I say to," then all you have to do it put your llStartAnimation command in a touch_start event and put the script and the animation in a HUD or other wearable object. Click it and you dance. If you mean, "Dance when it's time to dance," then put the llStartAnimation in a timer event. You can trigger the dance animation in many ways, limited only by your imagination.
_____________________
It's hard to tell gender from names around here but if you care, Rolig = she. And I exist only in SL, so don't ask.... ;)

Look for my work in XStreetSL at
Dora Gustafson
Registered User
Join date: 13 Mar 2007
Posts: 779
08-26-2009 07:02
Why not make a gesture with the dance? It is easy and smooth and require no script:)
_____________________
From Studio Dora
Wezza Writer
Registered User
Join date: 9 Jun 2009
Posts: 59
08-26-2009 23:20
Thanks guys,

I still got much to learn.

I'm checking out the llRequestPermissions function, and am wondering if I'm changing action on my own avatar, why should I explicitly request permission by asking yes or no! Is there a nicer method?

I think I get the whole thing wrong! How do I apply a script on my avatar?
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
08-27-2009 00:33
From: Wezza Writer
I think I get the whole thing wrong! How do I apply a script on my avatar?

you don't... you apply it to a prim, which you will likely wear as an attachment, or sit on, and THAT will affect your avatar (mostly by dragging/pushing it along with it). certain permissions are granted automatically when an avatar is sitting or wearing an object, like animation permissions... but you still have to request them, they aren't granted until requested.
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -
Raster Teazle
Registered User
Join date: 13 Sep 2005
Posts: 114
08-27-2009 01:27
Take a look at this:

http://www.lslwiki.net/lslwiki/wakka.php?wakka=LibraryFlightAssist

Take a look at the
gotControlInput(integer held)
function.

One other note: The statements below are a hack to allow calling a state from a function.
CODE

if (!(held & gReqKeys))
{
if (gAgentInfo & AGENT_FLYING)
{
state hover;
}
}

This should be used with caution and never if you are returning a value from the function.
Wezza Writer
Registered User
Join date: 9 Jun 2009
Posts: 59
08-27-2009 05:01
From: Void Singer
you don't... you apply it to a prim, which you will likely wear as an attachment, or sit on, and THAT will affect your avatar (mostly by dragging/pushing it along with it). certain permissions are granted automatically when an avatar is sitting or wearing an object, like animation permissions... but you still have to request them, they aren't granted until requested.


Ok, I did a few test and attach/wear the object with script to my body.

I've tried both llSetPos(llGetPos() + <0, 0, 1.0>;) and llMoveToTarget(llGetPos() + <0, 0, 10.0>, 0.2). But that seem to move the object only. Also, what state-event can I use to indicate I just wear the object and the script should start?
Wezza Writer
Registered User
Join date: 9 Jun 2009
Posts: 59
08-27-2009 05:04
From: Raster Teazle
Take a look at this:

http://www.lslwiki.net/lslwiki/wakka.php?wakka=LibraryFlightAssist

Take a look at the
gotControlInput(integer held)
function.

One other note: The statements below are a hack to allow calling a state from a function.
CODE

if (!(held & gReqKeys))
{
if (gAgentInfo & AGENT_FLYING)
{
state hover;
}
}

This should be used with caution and never if you are returning a value from the function.


thanks, don't think I quite get it, but where can I find a list of states? And what do u mean by hack?
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
08-27-2009 06:01
You are at a very basic level with LSL, so you will probably learn best if you spend some time working through one or more of the fundamental tutorials at . Take a look, at least. They vary in quailty and level, but they will answer many of your start-up questions. Then, get hold of scripts from friends or take full perm scripts out of freebie items to see what they look like and figure out how they work.
_____________________
It's hard to tell gender from names around here but if you care, Rolig = she. And I exist only in SL, so don't ask.... ;)

Look for my work in XStreetSL at
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
08-27-2009 07:22
From: Wezza Writer
Ok, I did a few test and attach/wear the object with script to my body.

I've tried both llSetPos(llGetPos() + <0, 0, 1.0>;) and llMoveToTarget(llGetPos() + <0, 0, 10.0>, 0.2). But that seem to move the object only. Also, what state-event can I use to indicate I just wear the object and the script should start?

set pos won't help you as it's not physical movement (it's technically tranlocation) but llMove2Target....

as for which event indicates an object is worn?
CODE

attach( key vKeyOwner){
if (vKeyOwner){
//-- you just attached it
}else{
//-- you just detached it
}
}
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -
Wezza Writer
Registered User
Join date: 9 Jun 2009
Posts: 59
08-31-2009 02:41
I'm testing with the following as an object script which I have tried wear or attach, but I couldn't get any of the whisper messages when I wear/attach/detach... The worst is the state_entry doesn't whisper even when I save the script.

===

default {
state_entry() {
llWhisper(0, "state_entry - start!";);
llRequestPermissions(llGetOwner(), PERMISSION_TAKE_CONTROLS); // get permission to take controls
llWhisper(0, "state_entry - after request!";);
}

attach(key id) {
if(id)//tests if it is a valid key and not NULL_KEY
{
llRequestPermissions(llGetOwner(), PERMISSION_TAKE_CONTROLS);
llWhisper(0, "attached - after request!";);
}
else
{
llWhisper(0, "detached";);
}
}

run_time_permissions(integer perm) { // permissions dialog answered
if (perm & PERMISSION_TAKE_CONTROLS) { // we got a yes
llTakeControls(CONTROL_UP | CONTROL_DOWN, TRUE, FALSE); // take up and down controls
llWhisper(0, "run_time_permissions: handler invoked!";);
}
}

control(key id, integer held, integer change) { // something happened to one of our controls
if (change & CONTROL_UP) { // the "fly up" key is held
//llSetPos(llGetPos() + <0, 0, 1.0>;); // move up
llMoveToTarget(llGetPos() + <0, 0, 10.0>, 0.2);
} else if (change & held & CONTROL_DOWN) { // the "fly down" key was pressed
//llSetPos(llGetPos() + <0, 0, -1.0>;); // move down
llMoveToTarget(llGetPos() + <0, 0, -10.0>, 0.2);
}
}
}
EF Klaar
Registered User
Join date: 11 Jun 2007
Posts: 330
08-31-2009 02:52
Is the "Running" check box at the bottom left of the script edit window checked?
Wezza Writer
Registered User
Join date: 9 Jun 2009
Posts: 59
08-31-2009 03:13
From: EF Klaar
Is the "Running" check box at the bottom left of the script edit window checked?


thanks EF Klaar,

but I could have swear I have it checked all the time... lol