Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

llSetParcelMusicURL

ab Milk
Registered User
Join date: 7 Aug 2004
Posts: 4
10-23-2004 17:00
Does anyone know how to get 'llSetParcelMusicURL' to work?
I can set URL's in 'about land'->options and they play.
The same URL's in the function does nothing:

llSetParcelMusicURL("http:\/\/any.stream.com\/filename.mp3";);

Thanks
Kurt Zidane
Just Human
Join date: 1 Apr 2004
Posts: 636
10-23-2004 17:22
is there any reason your using "/\" instead of "/" ? I know in some lounges / is a special char. Trigging the next char to be interpited differently, but I couldn't find a thing on http://www.badgeometry.com/ about sls designating / as a special character.
Pete Fats
Geek
Join date: 18 Apr 2003
Posts: 648
10-23-2004 22:11
Kurt is right. Speak no regular expressions here :) Also, check group status. If group ownes/deed the land, object must match accordingly.
_____________________
ab Milk
Registered User
Join date: 7 Aug 2004
Posts: 4
10-24-2004 07:03
Thanks for the replies. Here is what I know so far:

The land is group owned. I can edit the URL in 'about land' -> options
and it plays.

I can not get the URL to change with llSetParcelMusicURL() regardless
of all combinations (I think) of 'share with group', deed, and modify, etc...
on both the script and object.

If I hand it to the owner of *non* group owned land, they can run the
script, and it does work.

I *do* need the backslashes before forward slashes for it to work
(where it does work, on privately owned land).

Any advice?

Here is the script:
// change parcel URL on touch
//
default
{
on_rez(integer p)
{
llResetScript();
}

state_entry()
{
}
touch_start(integer total_number)
{
integer index=total_number - 1;
key kOwner = llGetOwner();
string theOwner = llKey2Name(kOwner);
key kTouched = llDetectedKey(index);

if(kTouched == kOwner) {
llSay(0,"Hello " + theOwner +".";);
string sURL=
"http:\/\/any.stream.com\/filename.mp3";
llSetParcelMusicURL(sURL);
}
} // end touch_start(...

} // end default(...
Siobhan Taylor
Nemesis
Join date: 13 Aug 2003
Posts: 5,476
10-24-2004 07:12
The script, and it's object need to be group owned also...
_____________________
http://siobhantaylor.wordpress.com/
ab Milk
Registered User
Join date: 7 Aug 2004
Posts: 4
10-24-2004 08:36
Problem solved.

Once the object and script are group owned (by deeding),
you can't check that the 'toucher' is the 'owner'.

Remove the " if(kTouched == kOwner) " conditional, and
the script in this post works fine.

Thank you for the help!
Ardith Mifflin
Mecha Fiend
Join date: 5 Jun 2004
Posts: 1,416
10-24-2004 08:42
You could, however, use llSameGroup() to verify that the toucher has membership in the group.
Hank Ramos
Lifetime Scripter
Join date: 15 Nov 2003
Posts: 2,328
10-24-2004 09:27
Just a quick caution about deeding objects to a group. If you don't set the permissions for the next owner to have complete modify rights to the scripts AND object, then you may lose the ability to modify the script and or object in the future.
_____________________
Christopher Omega
Oxymoron
Join date: 28 Mar 2003
Posts: 1,828
10-26-2004 08:15
From: ab Milk
string sURL="http:\/\/any.stream.com\/filename.mp3";

This literal doesn't look right to me. Try using "http:\\/\\/any.stream.com\\/filename.mp3" instead. Its not that SL does something different with \, its that LSL uses a C-coding convention that defines "\" (backslash) as an escape character (a character that allows you to type characters you normally cant using ASCII, for example line breaks). The \ literal is represented as "\\"
==Chris
Samhain Broom
Registered User
Join date: 1 Aug 2004
Posts: 298
10-26-2004 12:20
Bear with me a moment, at first this will look off-topic:

ok so tell me.... (please remember I am from a PERL and UNIX perspective)....

in PERL if you have some code like the following:

$name = &getname;
print "Hello $name, Welcome to SL\n";

The double quotes will tell the script to process the variable $name and not use the literal, and show a newline at the end.

where:

print 'Hello $name, Welcome to SL\n';

would actually print $name and would also print the literal backslash and the n rather than the newline.

if you want to print something in SL does it make any difference at all which set of quotes you use?

so... let's say you are creating a string that has the virgule character in it *yes that is the REAL name of the slash*.. "/". Let's say your actual string was to resemble an URL:

http://any.stream.com/filename.mp3

unless the slashes are representative of a special character they do not need to be quoted. The only time they mean anything else is when they are used to divide two numeric values.

So Christopher Omega's string: (taken from your message:)
This literal doesn't look right to me. Try using "http:\\/\\/any.stream.com\\/filename.mp3" instead.

would give:

http:\/\/any.stream.com\/filename.mp3

which I think would not be desired.

However the very string above if used in a string SHOULD look like the desired:

http://any.stream.com/filename.mp3

once interpreted ANYWAY. Functionally, you should be able to do this in PERL:

print ("http://any.stream.com/filename.mp3" eq "http:\/\/any.stream.com\/filename.mp3";)

and you will get a 1 (indicating that they are equal). Off the top of my head (sorry about 4 languages are bouncing around in the old frontal cortex) I do not know what the EASY way is to compare two strings in LSL like that. But I BET they would also be the same!

Can someone in game try that?
:rolleyes:
_____________________
rm -rf /bin/ladden #beware of geeks bearing grifts
Christopher Omega
Oxymoron
Join date: 28 Mar 2003
Posts: 1,828
10-26-2004 14:55
Ah, i incorrectly assumed that the string passed to llSetParcelMusicURL in the top message was exactly what was typed in the UI dialog box for the parcel URL.
Samhain Broom
Registered User
Join date: 1 Aug 2004
Posts: 298
10-27-2004 07:07
By the way, Christopher, sorry if that sounded like I was pickin' on you.

That was not intended.
_____________________
rm -rf /bin/ladden #beware of geeks bearing grifts