Introduction

Installation

Configuring Objects

Spacecalls

Events

Coordinates

Tips & Tricks

Portable Space EngineBuilder's Guide

Please send comments to Mark Cooke <mpc@star.sr.bham.ac.uk> or vspace@geocities.com

>Spacecalls: Miscellaneous Coding Calls

SpacecallReturn ValueObjectShip
active(dbref object)Boolean   
This function returns a boolean flag indicating the presence of the given object in space.
cause_damage(dbref target, Integer amount, Integer type) XX
This command causes a number of points of damage of the specified type to the target object. Types 0 to 2 are defined as 'gun', 'torp' and 'explosion' damage respectively. Intended use of this function is to provide softcoded weapons.
cause_system_damage(Integer system, Integer amount) XX
This command causes a number of points of direct damage to the specified system. Generally systems can take 3 points of damage before being completely destroyed. The system specifier here is very version specific, and users of this function should check the hard code for more details.
contact_info_level(Integer contact)Integer X 
This function returns the current information level of the specified contact. 0 indicates that the contact number is not valid. Values range from 1 (least visible) to 5 (most visible).
contact_info_string(Integer contact)String X 
This function returns information about the specified contact, or a string starting with #-1 if the contact given is invalid. The string contains the size, visibility (info_level), bearing, range, heading, speed, facing shield information and the name of the contact. It is provided so that writing custom contact list display functions is easy.
contact_list_dbrefs()String list X 
This function can be called for any active space object, and returns a space separated list of objects currently on sensors for the given object.
contact_list_num()String list X 
This function returns a list of space separated integers, which are the current contacts for the space object.
drain_reactor(Integer points) XX
This command changes the number of points being drained from a ship reactor per turn. It can be used to simulate anomalies in space. Calling this command also triggers an EV_REACTOR_DRAIN event.
explosion(Integer space, Integer x, Integer y, Integer z, Integer damage)   
This command causes an explosion event to occur at the given coordinates in the specified space. It can be used to simulate minefields and so on, without putting hundreds of objects into space in close proximity to each other.
facing_shield(Dbref target)Integer shield X 
This function calculates the shield of the target which is facing the calling space object. The number returned is dependant on the shield array of the target object. It returns 0 if the object has no shields, and a string which starts with #-1 in the case of an error.
format_range_string(Integer range, Integer max_width)String X 
This function will perform some scaling of the provided value, and append an appropriate scale flag.
get_consoleflags(Dbref console)String  X
This function returns a space separated list of the flags which are set on the provided console, or a string starting with #-1 if the console is not valid for the space object.
get_debug_char()dbref   
This command returns the object database number to which PSE log messages are currently being echoed.
has_console_flag(Dbref console, String flag)Boolean  X
This function returns true if the specified console has the given flag is set, or false if the flag is not set, or a string starting with #-1 if there was an error.
has_obj_flag(String flag)Boolean X 
This function returns true if the given flag is set, or false if the flag is not set (or is not a valid flag), or a string starting with #-1 if there was an error.
has_ship_flag(String flag)Boolean  X
This function returns true if the given flag is set, or false if the flag is not set (or is not a valid flag), or a string starting with #-1 if there was an error.
list_containers()String list X 
This function returns a space separated list of space objects which have the object on sensors and within critical range.
lookup_contact(Integer contact)Dbref X 
This function returns the dbref of the object associated with the specified contact number, or #-1 if the contact is not valid.
name()String X 
This function returns the name of the space object.
owner_number()Integer  X
This function returns the owner number of the specified ship object.
pos()String X 
This function returns a space separated list of the X, Y and Z coordinates of the space object.
range(Dbref target)Integer X 
This function returns the distance from the space object to the target, in the current units used by the space object, or a string starting with #-1 if there was an error.
set_consoleflags(Dbref console, String flags)  X
This command sets and clears flags on the given console. To set a flag, just provide the flag name. To clear a flag, add a ! before the name.
set_debug_char(dbref object)   
This command sets the object to which PSE log messages are echoed. It defaults to the GOD character.
set_pos(Integer X, Integer Y, Integer Z) X 
This command sets the location of the space object to the given coordinates. The coordinates should be given in universal coordinates, and not range factor adjusted.
set_torp_ammo(Integer amount)  X
This command sets the number of torpedos/missiles currently loaded on the ship object.
ship()Boolean X 
This function returns true if the space object is a ship. It returns a string starting with #-1 if the object is not valid.
space_options()   
This command sends a summary of the compile-time configuration of the Portable Space Engine to the caller.


Last modified: 15th March 1998