Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

I know this must be terribly wrong, but...

Zarma Button
Registered User
Join date: 17 Mar 2009
Posts: 7
04-03-2009 22:10
default
{
touch_start(integer total_value)
{
llWhisper(0, "Go to morning wood? To go, type 'Yes' in chat. To stay, type 'No' in chat.";);
state new;
}
}
state new
{
state_entry()
{
llListen(0,"",NULL_KEY,"";);
}
listen(integer channel, string name, key id, string message)
{
if(message=="yes";)
{
touch_start(integer num_detected) //Syntax error occurs here. How would I implement this part of the script?
}
{
llInstantMessage(llDetectedKey(0), llDetectedName(0) + " touched me.";);
llLoadURL(llDetectedKey(0), "SL Home", "http://secondlife.com/";);
}
else
{
llWhisper(0,"Wrong answer! Oh well, please come next time!";);
}
state default;
}
}

I'm pretty sure there's not a simply error there, I think I just wrote it wrong, sense this is my first day scripting, but can any one point me in the right direction?
Sindy Tsure
Will script for shoes
Join date: 18 Sep 2006
Posts: 4,103
04-03-2009 22:17
You can't tell it to do a touch_start; that only happens when an avatar touches the object containing the script..

Not sure what you're trying to do here.. Do you want two different people - toucher and a chatter - to interact with the script?
Zarma Button
Registered User
Join date: 17 Mar 2009
Posts: 7
04-03-2009 22:23
From: Sindy Tsure
You can't tell it to do a touch_start; that only happens when an avatar touches the object containing the script..

Not sure what you're trying to do here.. Do you want two different people - toucher and a chatter - to interact with the script?


Alright, sorry for leaving out the information, the script does this-

You touch a ball. A message appears that prompts you to type Yes or No, after typing that your supposed to be given the link to teleport to said location, if you type no, a short message appears after wards.
Sindy Tsure
Will script for shoes
Join date: 18 Sep 2006
Posts: 4,103
04-03-2009 22:30
Maybe something like this? (that I haven't even compiled, let alone tested)

CODE

key gToucher;

default
{
state_entry()
{
gToucher = "";
}

touch_start(integer total_value)
{
gToucher = llDetectedKey(0);

llInstantMessage(gToucher,
"Go to morning wood? To go, type 'Yes' in chat. To stay, type 'No' in chat.");

state new;
}
}

state new
{
state_entry()
{
llListen(0, "", gToucher, "");
llSetTimerEvent (30.0);
}

listen(integer channel, string name, key id, string message)
{
if(message=="yes")
{
llInstantMessage(id, name + " touched me. Pervert!");
llLoadURL(id, "SL Home", "http://secondlife.com/");
}
else
{
llInstantMessage(id, "Wrong answer! Oh well, please come next time!");
}

state default;
}

timer()
{
llSetTimerEvent (0.0);
llInstantMessage (gToucher, "Too slow!!");

state default;
}
}


/me posts code then heads to bed.. If you have problems, somebody else will probably be along..
Zarma Button
Registered User
Join date: 17 Mar 2009
Posts: 7
04-03-2009 22:34
Php huh? Does that meal I could put an href="http://www.secondlife.com/" or what ever? Of I inserted the html tags, I mean. I'll check what you put up in a second.
Keira Wells
Blender Sculptor
Join date: 16 Mar 2008
Posts: 2,371
04-03-2009 22:49
From: Zarma Button
Php huh? Does that meal I could put an href="http://www.secondlife.com/" or what ever? Of I inserted the html tags, I mean. I'll check what you put up in a second.

The PHP tag is BBCode, telling it to wrap it in a scrollable text box, essentially, which retains the text formatting as if it were in a script editor.

If it's not showing properly, try downloading the Greasemonkey add-in (For Firefox, anyhow) and the BBCode Emulation script that has its own sticky in the Resident Answers forum.

It has nothing to do with the actual script, just how it shows in the forum.
_____________________
Tutorials for Sculpties using Blender!
Http://www.youtube.com/user/BlenderSL
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
04-03-2009 22:49
From: Zarma Button
Php huh? Does that meal I could put an href="http://www.secondlife.com/" or what ever? Of I inserted the html tags, I mean. I'll check what you put up in a second.


Don't include the
CODE
 tags. The script is everything between them. The tags are there to make the script format properly in the forum.
Ruthven Willenov
Darkness in your light
Join date: 16 Jan 2008
Posts: 965
04-04-2009 03:53
why different states? i guess to keep someone else from touching it while it waits for an answer?
_____________________
Dark Heart Emporium

http://www.xstreetsl.com/modules.php?name=Marketplace&MerchantID=133020

want more layers for tattoos, specifically for the head? vote here
http://jira.secondlife.com/browse/VWR-1449?

llDetectedCollision* Functions similar to touch
http://jira.secondlife.com/browse/SVC-3369