• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

How does the onStep function works?

mackerel

Well-Known Member
Joined
Apr 26, 2017
Messages
398
Solutions
18
Reaction score
74
Kind of self-explanatory but doesn't really tell you how the code works. I want to know if its executed every time the player character moves, and if not then how

I think It's really useful function to have when dealing with optimization since it can be embedded within other parts of another code :p
 
Solution
Yes the one in movements



Of course but how does it know when the player stepped on the uid of 5585? Is the onStep function being executed every time the player moves?

Example

- player moves right
- player has new pos
- script runs (is player tile uid 5585?)
forgottenserver/movement.cpp at 73a8bd60cf7c62bfdf31c53cb2805ac0e0111ce6 · otland/forgottenserver · GitHub
forgottenserver/movement.cpp at 73a8bd60cf7c62bfdf31c53cb2805ac0e0111ce6 · otland/forgottenserver · GitHub
Kind of self-explanatory but doesn't really tell you how the code works. I want to know if its executed every time the player character moves, and if not then how

I think It's really useful function to have when dealing with optimization since it can be embedded within other parts of another code :p

onStepIn and onStepOut would be assigned to either an id, uid, or aid and anytime you stepped on an item with that pertaining id then it will trigger the function.
 
What do you mean? Movements?

Yes the one in movements

onStepIn and onStepOut would be assigned to either an id, uid, or aid and anytime you stepped on an item with that pertaining id then it will trigger the function.

Of course but how does it know when the player stepped on the uid of 5585? Is the onStep function being executed every time the player moves?

Example

- player moves right
- player has new pos
- script runs (is player tile uid 5585?)
 
Yes the one in movements



Of course but how does it know when the player stepped on the uid of 5585? Is the onStep function being executed every time the player moves?

Example

- player moves right
- player has new pos
- script runs (is player tile uid 5585?)
forgottenserver/movement.cpp at 73a8bd60cf7c62bfdf31c53cb2805ac0e0111ce6 · otland/forgottenserver · GitHub
forgottenserver/movement.cpp at 73a8bd60cf7c62bfdf31c53cb2805ac0e0111ce6 · otland/forgottenserver · GitHub
 
Solution
Back
Top