Ceera Murakami
Texture Artist / Builder
Join date: 9 Sep 2005
Posts: 7,750
|
09-16-2005 08:50
I would like to make a script that will activate when my Avatar's 'Fly' status is toggled, and will check to see if I have a particular set of wings worn at the moment. (The wings I have now are a free set that can be copied, etc. - but I want to be able to 'upgrade' to better wings later, so might need to be able to point the script to a no-copy set in my inventory.) If I'm going from walking to flying, and the wings are not there, the script should add them. Any time I fly, the wings should appear. If I am going from flying back to walking, the script should somehow ask if I want to dismiss the wings (cease wearing them), with a default reply of no. After all, I might be doing a 'touch and go' landing, or on arriving I might want to leave the wings visible. I'm just getting started with LSL, but I've been programming in other languages for decades. So, while I'll admit to being pretty clueless so far about how SL scripting works, I should get up to speed pretty fast on this task. I'm devouring the scripting guide now.  Thanks in advance to anyone who helps me with this.
|
Cid Jacobs
Theoretical Meteorologist
Join date: 18 Jul 2004
Posts: 4,304
|
09-16-2005 15:22
This wasnt written in world so it may not compile. But it should be fairly simple. start_thing() { //Do Stuff Here } end_thing() { //End Stuff Here } default { on_rez(integer param) { state walking; } state_entry() { state walking; } }
state flying { state_entry() { start_thing(); } timer() { if (!(llGetAgentInfo(llGetOwner()) & AGENT_FLYING)) { state walking; } } }
state walking { state_entry() { end_thing(); } timer() { if (llGetAgentInfo(llGetOwner()) & AGENT_FLYING) { state flying; } } }
|
Ceera Murakami
Texture Artist / Builder
Join date: 9 Sep 2005
Posts: 7,750
|
09-16-2005 18:16
Thank you! That looks like the start I needed. I'll play with it this weekend and see if I can get it to work.
|