Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Timer problem in script

Jennyfer Voom
Registered User
Join date: 18 Apr 2007
Posts: 8
07-04-2007 10:29
I have a problem with a script, that i hope someone can help me with.

Im a newbie with slscripting, but with god help and lots of trying i have mange to make a script that can light a candel for 24 houres for a carrety .

The script/candel funktion like this:
1. A person makes a donation to the candel.
2. the candel can then be dedicated to a person, by saying a name. And that name wil display over the candel.
3. The candel will the burn down slowly (24 houres) with the dedication hover over it
4. when the time is out, the candel will stop burning and pop back to starting point.

At first everything seem to work fine .. name is displayd and candel is burning for 24h .. and reset when time is out.

But then something wierd happens..

Here is an example:
A candel has been lighten for the first time at 10.00.
At 10.00 next day the candel goes out as it shud.. and pop back to start.
At 13.00 a new person lights the candel. ... this shud burn for 24h.. but it dosn't .. at abouth 10.00 next day it goes out...
(the exat time diference i havnt been able to find out yet)

I simply cant figure out what is wrong. so if somebody can help me with this problem i woud be very happy
You are more tahn welcome to contact me inworld

Jennyfer Voom

Memory Park - DenmarkCopenhagen
Memory Park; DenmarkCopenhagen (171, 118, 24)
secondlife://DenmarkCopenhagen/171/118/24
RJ Source
Green Sky Labs
Join date: 10 Jan 2007
Posts: 272
07-04-2007 10:46
If you're using llSetTimerEvent for this, than there is a very good chance you have just a logic error and some variables that aren't being reset. You could post some code here maybe? Or put more llSay's in the code to check values.
Jennyfer Voom
Registered User
Join date: 18 Apr 2007
Posts: 8
07-04-2007 11:04
Thanks for you sugestion...

as said ,.. im a newbie to Scripting.. and must admit i dont have a clue to do what you sugest...(or what it meens)...
I have build the script with some help.. and luts of copy things frome other scripts... And lot of trying and trying...

i can post the srcipt here if it wud help... or i can give it inworld if somebody can/will help me out with it

(Btw .. im word-blind and am having a very hard time trying to read and understand the script manuals)
Shadow Subagja
Registered User
Join date: 29 Apr 2007
Posts: 354
07-04-2007 11:36
I have to agree with RJ.

Easiest suggestion would be to try calling llResetScript() when the candle moves back to its start location, and see if that works.
http://rpgstats.com/wiki/index.php?title=LlResetScript

That will tell you if it is just an issue with not setting something properly the second time it runs (as it will now be the same as the first time). You can worry about specifically what, and try to fix it properly later.
Baron Hauptmann
Just Designs / Scripter
Join date: 29 Oct 2005
Posts: 358
07-04-2007 11:51
Met with Jennyfer in-world, and did just what Shadow suggested (though before I read that suggestion!).

I'll take a look at the code a bit more, but does anyone know of issues with llGetTime() and llResetTime(). Wiki suggests that it only be used for short durations, her script uses it for a 24 hour period. I do not know if there were any sim resets in the affected periods or not.

Baron
Jennyfer Voom
Registered User
Join date: 18 Apr 2007
Posts: 8
07-04-2007 11:57
Hi...

Thanks to Baron (and you all) for the help...
I have now don as sugested.. and set up a test candel to see if it works now.. (I hpe it dos)

My problem started afte the resent opdat .. befor that it workd fine.. even after/under sim resets...


ill post back when testing
RJ Source
Green Sky Labs
Join date: 10 Jan 2007
Posts: 272
07-04-2007 15:30
From: Baron Hauptmann
Met with Jennyfer in-world, and did just what Shadow suggested (though before I read that suggestion!).

I'll take a look at the code a bit more, but does anyone know of issues with llGetTime() and llResetTime(). Wiki suggests that it only be used for short durations, her script uses it for a 24 hour period. I do not know if there were any sim resets in the affected periods or not.

Baron


Yes. From one of the Wikis:

WARNING: This is not a reliable timing mechanism. It can reset to 0 unexpectedly. Use llSetTimerEvent for a more reliable timing mechanism. This timer can be used for performance-related uses.
Lyn Mimistrobell
(waiting)
Join date: 11 Jan 2007
Posts: 179
07-05-2007 01:40
It seems to me that the timer isn't reset [ llSetTimerEvent(0.0); ] or set again later, since the next time of returning-to-default is the same as the original one (10.00)...
Shadow Subagja
Registered User
Join date: 29 Apr 2007
Posts: 354
07-05-2007 09:47
From: Jennyfer Voom

Here is an example:
A candel has been lighten for the first time at 10.00.
At 10.00 next day the candel goes out as it shud.. and pop back to start.
At 13.00 a new person lights the candel. ... this shud burn for 24h.. but it dosn't .. at abouth 10.00 next day it goes out...


Something about the above bothers me, and I think its that you explicitely mention 'for the first time' when you talk about lighting the candle. Do you do anything special in your script the first time? Is the time stored the first time it is lit, and never again, either accidentally or through an error in logic?

I think a really close look at that, or posting the code, would help you solve it.

I also think that the fix Baron helped you make should probably be effective, and that your test will work. :)