The following warnings occurred:
Warning [2] Use of undefined constant SAPI_NAME - assumed 'SAPI_NAME' (this will throw an Error in a future version of PHP) - Line: 3388 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3388 errorHandler->error
/showthread.php 116 build_archive_link
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/inc/functions.php 3324 build_forum_breadcrumb
/showthread.php 195 build_forum_breadcrumb
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/showthread.php 195 build_forum_breadcrumb






Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
tenths of a second timer
Author Message
ChaveS
Journeyman
*

Posts: 69
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Oct 2012
Reputation: 0



Post: #1
tenths of a second timer
Just thought now... i heard sphere cannot deal with decimal timers because it dont and thats it...

But how it can deal with decimal timers in spells/skills?

And more...
any idea to use an custom spell/skill to provide a way to do this?

A skill or spell running on the char backgroud which dont cancel other skills/spell?
(This post was last modified: 11-16-2012 03:53 AM by ChaveS.)
11-16-2012 03:47 AM
Find all posts by this user Like Post Quote this message in a reply
Mordaunt
Super Moderator
****

Posts: 1,237
Likes Given: 26
Likes Received: 55 in 43 posts
Joined: Mar 2012
Reputation: 35



Post: #2
RE: tenths of a second timer
dtimer runs a timer in 10ths of a second

[Image: 2nis46r.jpg]
11-16-2012 06:13 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
ChaveS
Journeyman
*

Posts: 69
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Oct 2012
Reputation: 0



Post: #3
RE: tenths of a second timer
testing

You mean timerd?

timerd here 1 is the same of 0.5, 0.4, 0.3 etc...( as i remeber, years ago i treid to use and gave up)
I think when you put 0 to 0.4 it runs as timer 0, when u put 0.4 to 0.9, timer will be 1 second, something like that
No differences

EDIT: i made the tests
Code:
[FUNCTION timerdt] //sendpacket 0A2 D01a4b6 w120 w100
sysmessage ------
serv.newitem i_timerdtest
new.cont <uid>
new.amount 7
new.timer 1
serv.newitem i_timerdtest
new.cont <uid>
new.amount 6
new.timerd 0.7
serv.newitem i_timerdtest
new.cont <uid>
new.amount 5
new.timerd 0.5
serv.newitem i_timerdtest
new.cont <uid>
new.amount 4
new.timerd 0.5
serv.newitem i_timerdtest
new.cont <uid>
new.amount 3
new.timerd 0.4
serv.newitem i_timerdtest
new.cont <uid>
new.amount 2
new.timerd 0.2
serv.newitem i_timerdtest
new.cont <uid>
new.amount 1
new.timerd 0.1

It is so unstable:
Not always they appeared on same standard:
example, sometimes it appears 1 and 2 instant, then 3 4 and 5 togheter.
Sometimes all of them together
And look, they even change the order:
[Image: timerd.jpg]

Second test:
Sometimes 1, 2 and 3 instant, then one second later, then 4, 5, 6 ,7 instant.
Sometimes 1, 2 instant, then one second later 3, 4, 5, 6 ,7 instant.
Sometimes 1, 2 ,3, 4 instant, then one second later 5, 6 ,7 instant.
very very unstable

With a local connection.

using serv.time to test:

Code:
[FUNCTION timerdt]
ctag.rt <serv.time>
sysmessage ------
serv.newitem i_timerdtest
new.cont <uid>
new.amount 7
new.timer 1
serv.newitem i_timerdtest
new.cont <uid>
new.amount 6
new.timerd 0.7
serv.newitem i_timerdtest
new.cont <uid>
new.amount 5
new.timerd 0.5
serv.newitem i_timerdtest
new.cont <uid>
new.amount 4
new.timerd 0.5
serv.newitem i_timerdtest
new.cont <uid>
new.amount 3
new.timerd 0.4
serv.newitem i_timerdtest
new.cont <uid>
new.amount 2
new.timerd 0.2
serv.newitem i_timerdtest
new.cont <uid>
new.amount 1
new.timerd 0.1

[itemdef i_timerdtest]
name=a-apvp
ID=i_memory
TYPE = t_eq_script
LAYER = 30

ON=@CREATE
ATTR=attr_decay

on=@timer
cont.say <amount> <fval <serv.time>-<cont.ctag.rt>>
remove
return 1


Completely different numbers each time, many variations:
[Image: timerd2.jpg]

unusable
(This post was last modified: 11-16-2012 09:43 AM by ChaveS.)
11-16-2012 08:45 AM
Find all posts by this user Like Post Quote this message in a reply
Skul
Master
**

Posts: 413
Likes Given: 0
Likes Received: 19 in 15 posts
Joined: Jun 2012
Reputation: 9



Post: #4
RE: tenths of a second timer
Problem being character objects don't 'run' on tenths of seconds, for instance, if you do .xshow timer on a character it will show the result in seconds. An item object's timer can run in tenths of a second only if it is not on a character, so in other words it must be placed on the ground and it must be outside of a container (or character). Strange but that's just the way sphere works with timerd. So you'll need to create your memory object and place it on the ground, link it to your player and run your code off @timer. Example:
Code:
[function test_timerd]
serv.newitem=i_memory_timerd
new.p=Green Acres //out of the way of player contact
new.link=<uid>
new.more1=10
new.timerd=1

[itemdef i_memory_timerd]
defname=i_memory_timerd
name=Timerd Memory
id=i_memory
type=t_eq_script

on=@create
attr=attr_invis|attr_move_never

on=@timer
link.say=<eval <more1>>
more1 -= 1
if (<more1> < 1)
  remove
else
  timerd=1
endif
return 1

"I ask a question to the answer I already know."

Marchadium :: http://www.marchadium.ca/ :: Join us!
11-16-2012 01:09 PM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Mordaunt
Super Moderator
****

Posts: 1,237
Likes Given: 26
Likes Received: 55 in 43 posts
Joined: Mar 2012
Reputation: 35



Post: #5
RE: tenths of a second timer
Yeah sorry I did mean timerd.

You could use Serv.time which is global and does run in tenths

[Image: 2nis46r.jpg]
(This post was last modified: 11-16-2012 11:03 PM by Mordaunt.)
11-16-2012 11:01 PM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Barnabus
Journeyman
*

Posts: 124
Likes Given: 0
Likes Received: 3 in 2 posts
Joined: Apr 2012
Reputation: 1



Post: #6
RE: tenths of a second timer
(11-16-2012 01:09 PM)Skul Wrote:  Problem being character objects don't 'run' on tenths of seconds, for instance, if you do .xshow timer on a character it will show the result in seconds.

Thats good to know ^^
11-17-2012 03:20 AM
Find all posts by this user Like Post Quote this message in a reply
ChaveS
Journeyman
*

Posts: 69
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Oct 2012
Reputation: 0



Post: #7
RE: tenths of a second timer
thanks
(This post was last modified: 11-24-2012 04:29 AM by ChaveS.)
11-24-2012 04:29 AM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 2 Guest(s)