Help with llPlaySound...
|
|
Nyles Nestler
Registered User
Join date: 5 Jan 2008
Posts: 72
|
01-13-2008 15:52
Sorry to bother..... I just wrote a script that will play one simple sound enbeded in an object... I'm sure there's an obvious reasons why this script won't play the specified sound on touch.....just not obvious to me...lol I do have some experience with scripting languages - just not LSL.... I notice it doesn't even give the "touch" option in the menu....
float vol = 0.5;
key sound = "out_element.wav";
default { state_entry() { llSay(0, "Hello, Avatar!"); }
touch_start(integer total_number) { llPlaySound(sound, vol); } }
Any help appreciated...
|
|
Okiphia Anatine
Okiphia Rayna
Join date: 22 Nov 2007
Posts: 454
|
01-13-2008 16:02
I think that the sound name is just a string. Also, it must be exactly the same as the sound in the object, which if I recall, doesn't normally have .wav So instead of your key sound line it would be string sound = "out_element";
You would use key if you were using the UUID I believe, but not just the name. Try that out 
_____________________
In-world, I am Okiphia Rayna. This account is an alt, and is the only account I currently have with payment info on-file due to some account cracking that took place. This is a security measure at present, and I may return to the forums as Okiphia Rayna at a later date.
If you need to reach me, IM Okiphia Rayna, not Okiphia Anatine
|
|
Nyles Nestler
Registered User
Join date: 5 Jan 2008
Posts: 72
|
01-13-2008 16:30
Thanks Okiphia but alas, that didn't work either......  I'm thinking my biggest clue should be the fact that 'touch' doesn't even show up in the menu...... I'm just too new to this LSL.....
|
|
Okiphia Anatine
Okiphia Rayna
Join date: 22 Nov 2007
Posts: 454
|
01-13-2008 16:42
Are you in a place that doesn't allow scripts to run? Is it saying the hello avatar bit? a simple sound playing script that works for me is: string soundname = "lionking";
default { state_entry() { llSay(0, "Working"); } touch_start(integer number) { llPlaySound(soundname, 0.5); llOwnerSay("Debug:: Working"); } }
_____________________
In-world, I am Okiphia Rayna. This account is an alt, and is the only account I currently have with payment info on-file due to some account cracking that took place. This is a security measure at present, and I may return to the forums as Okiphia Rayna at a later date.
If you need to reach me, IM Okiphia Rayna, not Okiphia Anatine
|
|
Nyles Nestler
Registered User
Join date: 5 Jan 2008
Posts: 72
|
01-13-2008 16:51
I'm in a sandbox where scripting is allowed.....
I'll see if I can see why the last script you posted works and mine doesn't.
Thank You!
|
|
Nyles Nestler
Registered User
Join date: 5 Jan 2008
Posts: 72
|
01-13-2008 18:22
This is strange..... I've modified your script only slightly: Changed the name of the sound file and left out this line: llOwnerSay("Debug:: Working"  ; So I have:
string soundname = "out_element";
default { state_entry() { llSay(0, "Working"); } touch_start(integer number) { llPlaySound(soundname, 0.5);
} }
I can't see why that wouldn't work..... Well just because scripting is allowed in a region, doesn't mean that they could have turned it off temporarily..... I'll test it elsewhere....
|
|
Nyles Nestler
Registered User
Join date: 5 Jan 2008
Posts: 72
|
01-13-2008 18:29
I just tried it elsewhere, in a place where scripts run for sure...... doesn't work....nothing happens at all.....  Anyone? Thanks!
|
|
Sparkly Rainbow
Registered User
Join date: 2 Jan 2006
Posts: 54
|
01-13-2008 18:47
One thing that happens to me is that the script sometimes gets set to not running. Make sure the check box in the bottom left of the script edit window is checked off so that the script is running.
I know it's obvious, but has made me pull my hair out sometimes.
|
|
Nyles Nestler
Registered User
Join date: 5 Jan 2008
Posts: 72
|
01-13-2008 18:56
Sparkly,
Thank You!!!!
I knew it was something like that! (simple and obvious)
|
|
Okiphia Anatine
Okiphia Rayna
Join date: 22 Nov 2007
Posts: 454
|
01-13-2008 20:00
From: Nyles Nestler Sparkly,
Thank You!!!!
I knew it was something like that! (simple and obvious) That's why the ownersay and say were in there  If it didn't say 'working' immediately after the script starts, it wasn't running or wasnt allowed to run. If when clicked it didn't ownersay the debug message, the touch event wasn't firing. Generally a good idea to leave both of these in until you know for sure if its even working.
_____________________
In-world, I am Okiphia Rayna. This account is an alt, and is the only account I currently have with payment info on-file due to some account cracking that took place. This is a security measure at present, and I may return to the forums as Okiphia Rayna at a later date.
If you need to reach me, IM Okiphia Rayna, not Okiphia Anatine
|
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
01-13-2008 23:07
interesting factoid: scripts set to not running will pick up where they left off unless recompiled or reset (which is why you need to reset script that calls llgetowner in the state entry on new onwers)
_____________________
| | . "Cat-Like Typing Detected" | . This post may contain errors in logic, spelling, and | . grammar known to the SL populace to cause confusion | | - Please Use PHP tags when posting scripts/code, Thanks. | - Can't See PHP or URL Tags Correctly? Check Out This Link... | - 
|