Jump to content

Syntax error? Help :C


knguon
 Share

You are about to reply to a thread that has been inactive for 4424 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

I just wanted to write "The Tioga" on a prim...Help?

this is what i have so far:

default
{
    state_entry()
    {
        llSetText("The Tioga",<0,0,0>,0);
    }

    touch_start(integer total_number)
        llSay(0, "Touched.");
    }
}

I keep getting:
(8,8) Error, Syntax error.


Link to comment
Share on other sites

Count your curly brackets.

Or just delete the touch event alltogether as you don´t need that anyway.
Matter of fact, you can delete the whole script once the text is set. 

Also, you are writing text in black invisible letters. The last 0 in llSetText means full transparent. Change that to 1.0.

Link to comment
Share on other sites

No, there are no limits, as far as I know.

You just missed one.

touch_start(integer total_number)    llSay(0, "Touched.");}

 Should be:

touch_start(integer total_number){    llSay(0, "Touched.");}

 

But anyway, all you really need is this;

default{    state_entry()    {        llSetText("The Tioga",<0,0,0>,1.0);    }}

 

  • Like 1
Link to comment
Share on other sites

The script makes a hover text, floating over your prim not on your prim.
The text fades away as you move away from the prim, so you need to be close enough to see it.

There are no limit to the number of brackets, but the syntax requires that opening and closing brackets are matching
In other words: for every opening bracket there must be a closing bracket.

Link to comment
Share on other sites

  • 1 month later...

I'm also new to scripting and im getting a syntax error as well. this is the script i'm working on.

 

1 play()
2 {
3 string html = "
4 <html>
5 <head>
6 <object width=\"2048\" height=\"2048\" type=\"application/x-shockwave-flash\" data=\"http://flash-effects.com/swf/water_ripple_follow.swf\" id=\"sb-content\" style=\"visibility: visible;\"><param name=\"bgcolor\" value=\"#000000\"><param name=\"allowFullScreen\" value=\"true\"></object></body>
7 </html>";
8
9 // html = "data:text/html," + llEscapeURL(html); // you may need to escape funny chars
10 html = "data:text/html," + html; // or not, this depends upon your URL's
11 llSetPrimMediaParams(0, // Side to display the media on.
12 [PRIM_MEDIA_PERMS_CONTROL , PRIM_MEDIA_PERM_NONE,
13 PRIM_MEDIA_PERMS_INTERACT, PRIM_MEDIA_PERM_ANYONE,
14
15 PRIM_MEDIA_AUTO_PLAY,TRUE, // Show this page immediately
16 PRIM_MEDIA_CURRENT_URL,html, // The url currently showing
17 PRIM_MEDIA_HOME_URL,html, // The url if they hit 'home'
18 PRIM_MEDIA_HEIGHT_PIXELS,2048 , // Height/width of media texture will be
19 PRIM_MEDIA_WIDTH_PIXELS,2048 // rounded up to nearest power of 2.
20
21 ]);
22
23 }
24
25 default
26 {
27 state_entry()
28 {
29 play();
30 }
31
32 on_rez(integer p)
33 {
34 llResetScript();
35 }
36 }

 

(0,0)   : ERROR  :  Syntax error

 

 

can anyone help me with this?

Link to comment
Share on other sites

It looks fine to me and it compiles --- after I removed the line numbers and a bunch of bogus hidden line feed characters in the play function.  My guess is that you were using a word processor or some other editor that stuffs formatting characters into text, assuming that you are writing a memo instead of code.   Here's a clean copy....

play(){	string html = "<html><head><object width=\"2048\" height=\"2048\" type=\"application/x-shockwave-flash\" data=\"http://flash-effects.com/swf/water_ripple_follow.swf\" id=\"sb-content\" style=\"visibility: visible;\"><param name=\"bgcolor\" value=\"#000000\"><param name=\"allowFullScreen\" value=\"true\"></object></body></html>";	// html = "data:text/html," + llEscapeURL(html); // you may need to escape funny chars	html = "data:text/html," + html; // or not, this depends upon your URL's	llSetPrimMediaParams(0, // Side to display the media on.		[PRIM_MEDIA_PERMS_CONTROL , PRIM_MEDIA_PERM_NONE,		PRIM_MEDIA_PERMS_INTERACT, PRIM_MEDIA_PERM_ANYONE,		PRIM_MEDIA_AUTO_PLAY,TRUE, // Show this page immediately		PRIM_MEDIA_CURRENT_URL,html, // The url currently showing		PRIM_MEDIA_HOME_URL,html, // The url if they hit 'home'		PRIM_MEDIA_HEIGHT_PIXELS,2048 , // Height/width of media texture will be		PRIM_MEDIA_WIDTH_PIXELS,2048 // rounded up to nearest power of 2.			]);}default{	state_entry()	{		play();	}	on_rez(integer p)	{		llResetScript();	}}

 

Link to comment
Share on other sites

Ok, I'm trying to get the water to ripple when you place your cursor across the water. Like the ripple follows your cursor when you move it. and the script isnt doing it for some reason.

 

play(){	string html = "<html><head><object width=\"2048\" height=\"2048\" type=\"application/x-shockwave-flash\" data=\"http://flash-effects.com/swf/water_ripple_follow.swf\" id=\"sb-content\" style=\"visibility: visible;\"><param name=\"bgcolor\" value=\"#000000\"><param name=\"allowFullScreen\" value=\"true\"></object></body></html>";	// html = "data:text/html," + llEscapeURL(html); // you may need to escape funny chars	html = "data:text/html," + html; // or not, this depends upon your URL's	llSetPrimMediaParams(0, // Side to display the media on.		[PRIM_MEDIA_PERMS_CONTROL , PRIM_MEDIA_PERM_NONE,		PRIM_MEDIA_PERMS_INTERACT, PRIM_MEDIA_PERM_ANYONE,		PRIM_MEDIA_AUTO_PLAY,TRUE, // Show this page immediately		PRIM_MEDIA_CURRENT_URL,html, // The url currently showing		PRIM_MEDIA_HOME_URL,html, // The url if they hit 'home'		PRIM_MEDIA_HEIGHT_PIXELS,2048 , // Height/width of media texture will be		PRIM_MEDIA_WIDTH_PIXELS,2048 // rounded up to nearest power of 2.			]);}default{	state_entry()	{		play();	}	on_rez(integer p)	{		llResetScript();	}}
Link to comment
Share on other sites

That's an interesting challenge.  It's a bit outside my own range of experience, but I doubt that you'll be able to do it the way you are trying to (if you can do it at all).  MOAP is designed for displaying static web pages, not for real time interactivity.  Darkie or Peter may have more insight if they drop by this thread.

Link to comment
Share on other sites

Nothing here.  I think Qie's the expert on media.  My only knowledge of flash is playing it as parcel media but that specifically doesn't allow interactivity if I remember correctly.  Most importantly in SL mouse-over has no effect on anything but the viewer tooltips/  :-) Otherwise I might be able to suggest using particles

Link to comment
Share on other sites

I got it to work by changing 

// html = "data:text/html," + llEscapeURL(html); // you may need to escape funny chars	html = "data:text/html," + html; // or not, this depends upon your URL's

 to 

 html = "data:text/html," + llEscapeURL(html); // you may need to escape funny chars
// html = "data:text/html," + html; // or not, this depends upon your URL's

 It's great!

 

ETA -- you have to left click the water first, and then move the mouse pointer round.

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 4424 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...