Ebonshadow's Movement Library
This library is used to easily manipulate an atom's movement. Features
include the ability to easily stun an atom for a set time, easily set
up flight verbs, add elevation to turfs, and the ability to make
multi-tiled mobs very easily. Also, you can make bridges to simulate
two turfs on just one tile. You can walk over and under bridges.
Just include this
line in your program:
#include
Definitions/Variables:
Definitions
- WALKING = 1
- FLYING = 2
- PASSWALL = 3
These are used in atom.move_SetMoveType(). If you set an atom's
movetype FLYING, the atom will be able to walk through any turf
no matter what unless the turf's flight_dense variable = 0. Setting
it to PASSWALL will allow the atom to walk through any turf no matter
what. Setting it to WALKING puts the atom's movement back to normal.
Atoms
move_speed is variable that defines how fast an atom can move. The speed is 0-100, 100 being the fastest and 0 being utterly slow.
obj/bridge:
vars
elevation is the level at which the bridge lies. It must be consistint with the turfs around it. For instance, say you have two hills with and elevation of 2. Just make an obj/bridge with and elevation of 2 between them.
Atoms
move_speed is variable that defines how fast an atom can move. The speed is 0-100, 100 being the fastest and 0 being utterly slow.
Turfs
- elevation = 1
- flight_dense = 0
elevation is defaultly = to 1, but can be changed to any number. All
this variable does is if a mob tries to enter a turf that has
a elevation not equal to the mobs current location's elevation, it will
not let the mob enter. Usefull for making cliffs that you want
mobs to be able to fly to but you cant walk onto it or walk off of
it. Also, you make make stairs wby using the elevation var. Normally
you could not walk between a turf with an elevation of 1 and turf with
and elevation 2, but by putting a turf between them with an elevation of
1.5, you can. Stairs always have elevations in increments of 0.5.
flight_dense is a variable that when equal to one, will not let a
mob fly through the turf.
FOBJs:
FOBJs stand for Following Objects. A fobj is an object that follows
and atom around when it moves, such as a shadow or a quote box. This
movement library easily handles these with a few easy procs.
- atom.move_AddFOBJ(a as icon or obj,tag,xmod,ymod)
Adds a to atom's list of following objects. If a is an icon,
the proc will create an object with that icon. If it's an obj,
it will add a to atom's list of objects. The object is then placed
at locate(atom.x+xmod,atom.y+ymod,atom.z). It is relocated every time
the atom moves. tag is used to remove the FOBJ.
- atom.move_RemoveFOBJ(tag)
Removes the object with that tag from the atom's list of FOBJs. It
returns the object that was in the list.
- atom.move_GetFOBJ(tag)
Returns the FOBJ with that tag. Returns null if no FOBJ with that tag.
Movement:
- atom.move_SetMoveType(type)
Sets the atoms movement type to type. type can be WALKING, FLYING, or PASSWALL.
- atom.move_IsFlying()
Returns true if the atom is flying.
- atom.move_IsPasswall()
Returns true if the atom is in passwall.
- atom.move_IsWalking()
Returns true if the atom is walking.
- atom.move_MoveType()
Returns the atoms movement type: WALKING, FLYING, or PASSWALL
- atom.move_LockPos()
This proc makes it so that when atom.Move() is called it automatically
returns 0, causing them to not be able to move. Note that when the
player presses the arrow keys, it will not let them move but it will
change his/her direction.
- atom.move_UlockPos()
This cancels out atom.move_LockPos()
- atom.move_LockCur()
This overides all the arrow key procs, so the player can no longer
move by pressing the arrow keys. Move() still works just fine.
- atom.move_UlockCur()
This cancels out atom.move_LockCur()
- atom.move_LockDown()
This has the same effect as LockCur() and LockPos() combined, making
it so the atom cannot move at all.
- atom.move_UlockDown()
This cancels out atom.move_LockDown()
- atom.move_Stun(delay = 10)
This causes atom to lock down for decay tenths of a second. Default is
one second.
For more information, refer to the demo that is included with the library.