Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Complete Newb To Scripting

Nick Svarog
Registered User
Join date: 9 Sep 2004
Posts: 5
05-24-2005 21:49
I have programming experience with C++ and Obj-C, but am new to this language. I'm trying to make a cool satellite thingy that hovers and follows me around. For some reason when I touch it, the thing won't go up and hover. Then it's supposed to come down on the next touch. However, if I sit on it, then the touching works. Any ideas? I'll get some code next time I'm on the game.
Luke Ramona
Registered User
Join date: 3 Apr 2005
Posts: 32
05-24-2005 22:11
CODE

integer Hover = FALSE;

do_hover()
{
if (Hover == FALSE)
{
// do hover set up stuff
Hover = TRUE;
}
else Hover = FALSE;
}

default
{
state_entry()
{
// do init stuff
}

touch_start(integer whatever)
{
do_hover()
}
}


Ok.. not perfect by any means, but the touch event needs to switch something on and off.