Okay, what am I missing?!
|
|
Dellybean North
Registered User
Join date: 8 May 2006
Posts: 321
|
04-13-2009 13:31
This is a chiming script I adapted from Ceera's Westminter Clock script. I have my clock hands working fine so I'm not going to replace those, but wanted to get the clock chiming on the hour. The UUID's below I took out as they are my sounds and not freebies..anyhow, it is not chiming(at all, never mind on the hour). What have I missed and thanks for the help! (I tried llTriggerSound too, but nada). // adapted from Ceera's Westminster Clock, with hour chimes // Based on simple clock by Beverly Larkin etc integer H; integer M; string chimeA = "UUIDhere"; string chimeBong = "UUIDhere";
getTime() { integer T = (integer)llGetWallclock(); if (T > 43200) { T = T - 43200; H = T / 3600; M = (T - (H * 3600)) / 60; if(H == 0) { H = 12; } } else { H = T / 3600; M = (T - (H * 3600)) / 60; if(H == 0) { H = 12; } } }
chimeCheck() { if(M == 59) { llPreloadSound( chimeA ); llSleep(10); llPreloadSound( chimeBong ); llSleep(2); } if(M == 0) { llSetSoundQueueing(FALSE); llPlaySound(chimeA, 0.5); llSleep(10); integer i = 0; for (; i < H; ++i) { llPlaySound(chimeBong,0.5); llSleep(2); } } }
default { on_rez(integer start_param) { llSetTimerEvent(60); getTime(); chimeCheck(); }
timer() { getTime(); chimeCheck(); } }
|
|
Haruki Watanabe
llSLCrash(void);
Join date: 28 Mar 2007
Posts: 434
|
04-13-2009 13:45
Just a thought: when you're using UUIDs, the original object needs to have copy-perms, afaik...
|
|
Dellybean North
Registered User
Join date: 8 May 2006
Posts: 321
|
04-13-2009 14:34
From: Haruki Watanabe Just a thought: when you're using UUIDs, the original object needs to have copy-perms, afaik... ah! I shall check that thanks! mm. k, that wasn't the problem..still not working. any other suggestions anybody?
|
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
04-13-2009 14:57
IIRC sound fallof distance is affected by the size of the prim it's in, so there's one possible culpript I can't remember for sure, but I believe that any sound with the same uuid will not play over itself if called, and may not play after itself within a certain frame of time. also you timer runs ever 60 seconds, but it there's time dilation on the sim, then it's possible the sounds will never be preloaded, or never be triggered for that particular hour. additionally the entire time function can be simplified getTime(){ integer T = (integer)llGetWallClock() % 43200; M = T % 3600 / 60; T /= 3600; H = T + (0 == T) * 12; }
_____________________
| | . "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... | - 
|
|
Boss Spectre
Registered User
Join date: 5 Sep 2005
Posts: 229
|
Solution
04-14-2009 14:28
The on_rez() event is not called when you save or reset a script... with this script, you will need to take the object into inventory and re-rez before the timer is started.
Try setting your timer in a state_entry() event, and it should chime.
As for any problem with overlapping chimes, you could call llTriggerSound() instead of llPlaySound() and they should overlap fine.
~Boss
|
|
Dellybean North
Registered User
Join date: 8 May 2006
Posts: 321
|
04-14-2009 18:01
Thanks Boss, I'll give that a go 
|
|
Dellybean North
Registered User
Join date: 8 May 2006
Posts: 321
|
04-14-2009 19:02
Ha! that worked Boss!.. it was a wee bit delayed by lag I guess, but it did kick in in about 15 seconds after the hand hit the hour, so cool beans and thanks 
|
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
04-14-2009 21:43
lol totally missed that.
_____________________
| | . "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... | - 
|