|
Kurt Ludd
"The Gesture maker"
Join date: 27 Sep 2005
Posts: 229
|
09-18-2007 06:14
I am trying to write a simple script that when you touch a prim it starts rotating and then touch again to stop...I can get it to start ok but not sure what to do to make it stop.. Any help appreciated TY Heres what I have to start it ... default { state_entry() { llSay(0, "Starting"  ; } touch_start(integer total_number) { llTargetOmega(<0,1,0>,PI,1.0); } state_entry() { llSay(0, "Stopping"  ; } touch_start(integer total_number) { llTargetOmega(<0,1,0>,0*PI,1.0); } } Kurt Ludd " The Gesture maker " But not a scripter...Yet 
_____________________
Kurt Ludd "The Gesture Maker" with 4000+ Gestures Try a FREE 12 Gesture HUD at http://slurl.com/secondlife/Malra/15/57/66
|
|
Simnelia Petrichor
Registered User
Join date: 10 Feb 2006
Posts: 35
|
09-18-2007 06:39
Something like this, with separate states for spinning and not spinning: default { state_entry() { llTargetOmega(<0,1,0>,0.0,1.0); } touch_start(integer total_number) { llSay(0, "Starting"  ; state spinning; } } state spinning { state_entry() { llTargetOmega(<0,1,0>,PI,1.0); } touch_start(integer total_number) { llSay(0, "Stopping"  ; state default; } }
|
|
Doofus Mayo
Registered User
Join date: 7 Jun 2007
Posts: 33
|
09-18-2007 06:41
You have two state_entry sections in the same state. What you need is either two different states or a variable that registers on/off and the rotation is set dependant upon that. like maybe... integer spinning = 0; default { touch_start(integer total_number) { if (spinning==0) //Turn it on { llTargetOmega(<0,1,0>,PI,1.0); llSay(0,"Starting"  ; spinning=1; } else if (spinning==1) //Turn it off { llTargetOmega(<0,1,0>,0,1.0); llSay(0,"Stopping"  ; spinning=0; } } } I am not currently in world so I cant guarantee this, but it should work I think.
|
|
Kurt Ludd
"The Gesture maker"
Join date: 27 Sep 2005
Posts: 229
|
Ty Both for your expertise  ))
09-18-2007 07:08
Ty to everyone on this forum...Always very helpful advice to an Amatuer scripter...
Kurt Ludd
_____________________
Kurt Ludd "The Gesture Maker" with 4000+ Gestures Try a FREE 12 Gesture HUD at http://slurl.com/secondlife/Malra/15/57/66
|
|
Talarus Luan
Ancient Archaean Dragon
Join date: 18 Mar 2006
Posts: 4,831
|
09-18-2007 07:18
Just FYI, llTargetOmega is seriously borked still; starting/stopping often do not work no matter what you do.
|
|
Kurt Ludd
"The Gesture maker"
Join date: 27 Sep 2005
Posts: 229
|
ty Talarus
09-18-2007 07:33
Ty Talarus...I just found that out...it would work for awhile and then stop..
The only thing that worked was to add a space delete it and recompile..then reset then would work a few times and stop again LOL
Kurt Ludd
_____________________
Kurt Ludd "The Gesture Maker" with 4000+ Gestures Try a FREE 12 Gesture HUD at http://slurl.com/secondlife/Malra/15/57/66
|