Ares Baroque
Registered User
Join date: 11 Aug 2007
Posts: 8
|
11-23-2009 07:17
Ok, Im a beginner scripter trying to make a tv with my url's stored on a notecard. When I click the button on the menu, it goes to the state, however, the function won't work. Is this a memory issue? thanks in advance. key url1; default { touch_start(integer x) { list buttons = ["test"]; llDialog( llDetectedKey(0), "Choose a url", buttons, 5 ); llListen(5,"","",""  ; } listen(integer chan, string name, key id, string msg) { if(msg =="test" { state notecard; } } } state notecard { state_entry() { url1 = llGetNotecardLine("New Note",0); //get line zero } dataserver(key query_id, string data) //when request is made to server { if(data == url1) { llParcelMediaCommandList([PARCEL_MEDIA_COMMAND_URL,url1,PARCEL_MEDIA_COMMAND_PLAY]); } } }
|
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
|
11-23-2009 07:39
From: Ares Baroque Ok, Im a beginner scripter trying to make a tv with my url's stored on a notecard. When I click the button on the menu, it goes to the state, however, the function won't work. Is this a memory issue?
thanks in advance. dataserver(key query_id, string data) //when request is made to server { if(data == url1) //This should be if(query_id == url1) { llParcelMediaCommandList([PARCEL_MEDIA_COMMAND_URL,url1,PARCEL_MEDIA_COMMAND _PLAY]); // And this should be llParcelMediaCommandList([PARCEL_MEDIA_COMMAND_URL,data,PARCEL_MEDIA_COMMAND _PLAY]); } } }
assuming that the data in line one of your card is the URL, of course.
_____________________
It's hard to tell gender from names around here but if you care, Rolig = she. And I exist only in SL, so don't ask....  Look for my work in XStreetSL at 
|
Ares Baroque
Registered User
Join date: 11 Aug 2007
Posts: 8
|
11-23-2009 08:36
I get this script warning error.
Object: PARCEL_MEDIA error: Rule 0 error, PARCEL_MEDIA_COMMAND_URL needs string data.
The notecard had the url in the first line.
|
ab Vanmoer
Registered User
Join date: 28 Nov 2006
Posts: 131
|
11-23-2009 10:03
I think that error is pretty self apparent; it is saying that you need to pass a string which you are not doing. This should not be happening if you used the code as posted by Rolig because you have declared data as a string.
Once you correct the error, you either have to be on land you own, or if on group owned land you will have to deed the object to the group for the llParcelMediaCommandList to work. Just make sure that you deed a copy of the object, as once deeded, you may lose the ability to edit the script.
|
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
|
11-23-2009 10:33
Ab's right. So long as you retyped the llParcelMediaCommandList line with "data" in place of "url1," it should work fine. Whatever is in line one of your card will be interpreted as a single string variable. If it really is a valid URL, it should execute properly. Incidentally, unless you really like writing with multiple states, you can collapse this little script easily into a single state without losing any readability. All it would take is removing the following lines.... state notecard;
} } }
state notecard { state_entry() {
and adding a } bracket to close the revised listen event cleanly. There's no particular advantage to making that change at the moment. However, if you leave it as a multi-state script as you develop it further, you will need to be wary of building ways to get back from state notecard if someone presses a different button or you re-rez the object, or change the notecard, or ...... Personally, I avoid using extra states unless I have to because I tend to abandon too many orphans along the way. But that's just me. 
_____________________
It's hard to tell gender from names around here but if you care, Rolig = she. And I exist only in SL, so don't ask....  Look for my work in XStreetSL at 
|
ElQ Homewood
Sleeps Professionally
Join date: 25 Apr 2007
Posts: 280
|
11-24-2009 01:41
From: someone llParcelMediaCommandList([PARCEL_MEDIA_COMMAND_URL,data,PARCEL_MEDIA_COMMAND _PLAY]); Also, be sure you put the data in the correct place here.
|