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-nmm6 (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-nmm6 (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-nmm6 (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
Is Character Moving ?
Author Message
EOSCPM
Apprentice
*

Posts: 22
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Apr 2014
Reputation: 0



Post: #1
Is Character Moving ?
Hi,

How can i check is character moving. I have an event and i wanna when character move under this event, saying IAM MOVING.

How can i do this ?


Best regards,
Thank you.
04-02-2014 11:32 PM
Find all posts by this user Like Post Quote this message in a reply
XuN
Sphere Developer
*****

Posts: 852
Likes Given: 102
Likes Received: 156 in 119 posts
Joined: Jul 2013
Reputation: 30



Post: #2
RE: Is Character Moving ?
@RegionStep for characters.

@Step for regions.
04-02-2014 11:38 PM
Find all posts by this user Like Post Quote this message in a reply
EOSCPM
Apprentice
*

Posts: 22
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Apr 2014
Reputation: 0



Post: #3
RE: Is Character Moving ?
Hi,

I tried but not working.

[events e_test]
ON=@RegionStep
say test


There is no reaction when i walk with this event.
04-02-2014 11:46 PM
Find all posts by this user Like Post Quote this message in a reply
XuN
Sphere Developer
*****

Posts: 852
Likes Given: 102
Likes Received: 156 in 119 posts
Joined: Jul 2013
Reputation: 30



Post: #4
RE: Is Character Moving ?
Right, it seems I dreamed about it ^^, forget it. There is only a region-based trigger: @Step.
04-03-2014 12:14 AM
Find all posts by this user Like Post Quote this message in a reply
EOSCPM
Apprentice
*

Posts: 22
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Apr 2014
Reputation: 0



Post: #5
RE: Is Character Moving ?
So, we can't handling player movement right ?
04-03-2014 12:22 AM
Find all posts by this user Like Post Quote this message in a reply
XuN
Sphere Developer
*****

Posts: 852
Likes Given: 102
Likes Received: 156 in 119 posts
Joined: Jul 2013
Reputation: 30



Post: #6
RE: Is Character Moving ?
This trigger was never implemented because it would be so heavy in performance meanings, it was placed under region definition to limit it usage (I think).

What you can do is:

Adding r_regions_custom to EventsRegion in your sphere.ini

create [regiontype r_regions_custom]
ON=@Step
src.say I'm moving
04-03-2014 12:58 AM
Find all posts by this user Like Post Quote this message in a reply
wuffel
Apprentice
*

Posts: 28
Likes Given: 0
Likes Received: 4 in 2 posts
Joined: Mar 2012
Reputation: 1



Post: #7
RE: Is Character Moving ?
itemdef i_memory_moving
id=i_memory

on=@timer
morep= <cont.p> // for the last position, so you can check if last cont.p changed from last timer to new timer. you can also you tags for this.


serv.log <cont.p>

timer=1 // or timerd=something
return 1
04-03-2014 04:19 AM
Find all posts by this user Like Post Quote this message in a reply
Coruja
Sphere Developer
*****

Posts: 987
Likes Given: 5
Likes Received: 226 in 187 posts
Joined: Jul 2012
Reputation: 7

Dimension Shard

Post: #8
RE: Is Character Moving ?
you can check for FLAG statf_fly, it works when the chars is running, but not when just walking

Code:
IF (<FLAGS> & statf_fly)
  ...
ENDIF
04-04-2014 04:40 AM
Find all posts by this user Like Post Quote this message in a reply
JohnVeritas
Apprentice
*

Posts: 49
Likes Given: 0
Likes Received: 4 in 4 posts
Joined: Feb 2014
Reputation: 2



Post: #9
RE: Is Character Moving ?
Well another idea from me;

Under sphere.ini add this packet

PACKET2=f_moving

[function f_moving]
obj=<local.char>
if (<obj.isevent.<yourevent>)
obj.trigger @move
endif

and under your custom event;

on=@move
src.sayua 048,6,6,0 I AM MOVING // think this one is green Smile

Let me know if it works ^_^
04-06-2014 11:43 AM
Find all posts by this user Like Post Quote this message in a reply
Coruja
Sphere Developer
*****

Posts: 987
Likes Given: 5
Likes Received: 226 in 187 posts
Joined: Jul 2012
Reputation: 7

Dimension Shard

Post: #10
RE: Is Character Moving ?
im quite sure JohnVeritas code will work fine
Code:
PACKET2=f_moving  //add this line on sphere.ini

[FUNCTION f_moving]
UID.<LOCAL.CHAR>.TRIGGER @Move
this will call the trigger @Move when you move, so now you just need to add @Move on your event

but as XuN already said, doing a script/check like this will cause heavy load on sphere and your server will waste much performance. Just imagine if 1 char walk 1000 steps, it will call 1000x @Move. Now imagine 50 chars walking taking 1000 steps at the same time, it's 50.000x @Move
04-07-2014 05:00 AM
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)