Welcome to PenUltima Online. Click to login or register.

File: Boat.em

Description: Functions for manipulating Multi Boat objects.
Last Modified: 08/31/2015

File Constants:

const BOAT_SPEED_ONE_TILE 	:= 1;
const BOAT_SPEED_SLOW := 2;
const BOAT_SPEED_MEDIUM := 3;
const BOAT_SPEED_FAST := 4;

Modules:

BoatFromItem( item )
Parameters:
Name Type
item Item Ref
Explanation
if you have an itemref referring to a boat (typically in a doubleclick script) this will convert it into a boatref.
Note that this should not be necessary anymore.
Return values
Boat Reference
Errors
"Item wasn't a multi"
"Multi wasn't a boat"
"Invalid parameter type."
Related
Boat
Item
MoveBoat( boat, facing, speed := BOAT_SPEED_ONE_TILE )
Parameters:
Name Type
boat Boat Reference
facing Integer (0..7)
speed Integer (0..4)
Explanation
Moves a boat in the direction of an absolute facing
0=N, 1=NE, 2=E, 3=SE, 4=S, 5=SW, 6=W, 7=NW
speed to determine how fast the boat movement should be animated for smooth move
Return values
1 on success, 0 on failure
Errors
none (returns 0 on invalid param)
Related
Boat
MoveBoatRelative( boat, direction, speed := BOAT_SPEED_ONE_TILE )
Parameters:
Name Type
boat Boat Reference
direction Integer (0..7)
speed Integer (0..4)
Explanation
Move a boat in the direction of a relative facing. Same as MoveBoat, but adjusted for boat's facing.
If boat faces East, 0 will move E, 1 will move SE, etc.
speed to determine how fast the boat movement should be animated for smooth move
Return values
1 on success, 0 on failure
Errors
none (returns 0 on invalid param)
Related
Boat
MoveBoatXY( boat, x, y )
Parameters:
Name Type
boat Boat Reference
x Integer world coordinate
y Integer world coordinate
Explanation
Moves a boat to the specified world coordinates.
Careful moving close to the world edge where a part of the boat might be out of bounds.
Return values
1 on success, 0 on failure
Errors
Invalid Parameter
Related
Boat
RegisterItemWithBoat( boat, item )
Parameters:
Name Type
boat Boat Reference
item Item Reference)
Explanation
'registering' an item with a boat causes the boat to move the item when it moves, if and only if the item is still on the boat.
Return values
1 always
Errors
none (returns 0 on invalid param)
Related
Boat
Item
SystemFindBoatBySerial( serial )
Parameters:
Name Type
serial Integer
Explanation
given the serial number of a boat, return a boatref that can be used with MoveBoat, TurnBoat, etc.
SystemFindObjectBySerial can find boats as well, should use that.
Return values
Boat Reference on success
Errors
"Boat not found."
Related
Boat
TurnBoat( boat, direction )
Parameters:
Name Type
boat Boat Reference
direction Integer (0..3)
Explanation
Turn a boat in a direction, relative to its current directon.
direction is 0=none, 1=right, 2=flip, 3=left
Return values
true/false if the boat could be turned (i.e. wouldn't be in an invalid location after the turn)
Errors
"Invalid Parameter type"
Related
Boat