SphereCommunity
Timerd not working properly? - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d)
+--- Forum: General Help (/Forum-General-Help)
+--- Thread: Timerd not working properly? (/Thread-Timerd-not-working-properly)

Pages: 1 2


Timerd not working properly? - karma - 01-16-2016 08:35 PM

Am I the only one to notice that TIMERD is a bit imprecise? It makes @Timer fire after a "highly" variable amount of time and it's a problem if i need it to trigger after 0.1 or 0.2 seconds and it does after 0.4 or 0.7.

Tested with:
Code:
[ITEMDEF i_timerdtester]
ID=i_memory
TYPE=t_eq_script
NAME=TimerdTester

ON=@Timer
SERV.LOG timerd fired: <SERV.TIME>
REMOVE
RETURN 1

[FUNCTION timerdtest]
SERV.NEWITEM i_timerdtester,1,<UID>
NEW.TIMERD=<ARGN1>
SERV.LOG timerd: <SERV.TIME>; it should trigger at <EVAL <SERV.TIME>+<NEW.TIMERD>>

May it be related to the OnTick issue i pointed at here http://tracker.sphere.torfo.org/bugs/view.php?id=2546 ?

EDIT: lol, i posted in the wrong section, sorry


RE: Timerd not working properly? - rastrero - 01-16-2016 10:06 PM

Yes, i Got the same problem.

Its happen to me in my jumpsystem.
sometimes take 0,1 sometimes 0,4
I thought my pc was overload. xD


RE: Timerd not working properly? - RunBody - 01-17-2016 05:18 AM

serv.log <argn>
new.timerD <argn>


RE: Timerd not working properly? - karma - 01-17-2016 05:22 AM

Argn1 works equally


RE: Timerd not working properly? - RunBody - 01-17-2016 05:23 AM

try timerdtest 1.2


RE: Timerd not working properly? - karma - 01-17-2016 08:34 AM

Same problem, if you try multiple times with the same argument, the interval of time between the two serv.log changes nearly every time and rarely it is what it is supposed to be.


RE: Timerd not working properly? - RunBody - 01-17-2016 05:34 PM

when i type timerdtest 1.2
in logs i see number 12,argn become decimal number, so problem i guess in that


RE: Timerd not working properly? - karma - 01-17-2016 07:48 PM

Nope, to be "quick" in sphere numbers are always considered integers (with the exceptions of calculations on FLOAT variables), so when you pass values to something that is supposed to receive decimal numbers the integer you pass is considered decimal. So if you set TIMERD=10 it should be considered 1.0, as well as setting a skill value to 1000 will set it at 100.0%.


RE: Timerd not working properly? - rastrero - 01-17-2016 10:54 PM

I think the problem is about the order sphere cues order commands execution.


RE: Timerd not working properly? - XuN - 01-18-2016 06:53 PM

Didn't understand completelly, however take in count that Sphere doesn't work in seconds, but on ticks ... on a well performanced server 1 tick should be the same as 0.1 second ... but this is very hard to achieve and sometimes it will take 0.10, sometimes 0.11, 0.12 ... depending on a lot of factors, this is one of the reasons why we tell people to keep their code the most small and clean possible.