Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Counting Steps
Author Message
DartHVirS
Apprentice
*

Posts: 21
Likes Given: 1
Likes Received: 1 in 1 posts
Joined: Mar 2010
Reputation: 0



Post: #1
Counting Steps
Hello guys, I was trying to make a script that counts every step of all users.

I tried different things without success.

For example...

Code:
[FUNCTION f_CountSteps]
IF !(<eval <tag0.stepp>> == <eval <p>>)
tag.steps=<tag0.steps> + 1
tag.stepp = <p>
timerf 1,f_CountSteps
ELSE
timerf 1,f_CountSteps
ENDIF

This works fine if the player walks in X direction... but does not work when the player walks in Y direction.

I couldn't get to work comparing two player positions.

Any ideas?

Thank you.
(This post was last modified: 01-27-2018 04:51 AM by DartHVirS.)
01-27-2018 03:42 AM
Find all posts by this user Like Post Quote this message in a reply
Soulless
Super Moderator
****

Posts: 336
Likes Given: 29
Likes Received: 49 in 27 posts
Joined: Jun 2012
Reputation: 12

Ye Olde Sphere

Post: #2
RE: Counting Steps
You could use something like this, you could specify a distance it must be and fire the trigger of in the amount of seconds that length of travel would take, but it would be inaccurate to the exact amount of steps. as it is now it's accurate for boy x+y


Code:
[function steps_count]
tag0.steps += <distance <tag0.old_loc>>
tag0.old_loc=<p>
timerf 1,steps_count
return <dtag0.steps>
01-27-2018 05:09 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
DartHVirS
Apprentice
*

Posts: 21
Likes Given: 1
Likes Received: 1 in 1 posts
Joined: Mar 2010
Reputation: 0



Post: #3
RE: Counting Steps
Thank you Soulless, but I need it to be more accurate.

How can I compare two player positions?

I tried with string functions but when they read the position comma they do not read anything after that comma.

For example STRMATCH(<p>,<p>) for example if <p> is equal to "804,600,0" that function only reads the first number before the comma "804". Is any string function that can erase the comma or something?, that would really help with my function.

OK, It is working now. What I did is the following:
Code:
[FUNCTION f_CountSteps]
local.p1 = <STRARG <p>>
local.p2 = <STRARG <STREAT <p>>>

IF (<tag0.stepp1> != <local.p1>) || (<tag0.stepp2> != <local.p2>)
tag.steps=<tag0.steps> + 1
tag.stepp1 = <STRARG <p>>
tag.stepp2 = <STRARG <STREAT <p>>>
timerf 1,f_CountSteps
ELSE
timerf 1,f_CountSteps
ENDIF
(This post was last modified: 01-27-2018 06:48 AM by DartHVirS.)
01-27-2018 06:00 AM
Find all posts by this user Like Post Quote this message in a reply
darksun84
Sir Spamalot
****

Posts: 1,687
Likes Given: 246
Likes Received: 162 in 151 posts
Joined: Mar 2012
Reputation: 35



Post: #4
RE: Counting Steps
You can access the multiple values of p by using <p.x> <p.y> <p.z> and <p.m>
01-27-2018 11:00 AM
Find all posts by this user Like Post Quote this message in a reply
DartHVirS
Apprentice
*

Posts: 21
Likes Given: 1
Likes Received: 1 in 1 posts
Joined: Mar 2010
Reputation: 0



Post: #5
RE: Counting Steps
(01-27-2018 11:00 AM)darksun84 Wrote:  You can access the multiple values of p by using <p.x> <p.y> <p.z> and <p.m>

OOhhh I forgot that!!! hahaha. Thank you
01-27-2018 01:03 PM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


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