Skip to content

The sbs module

The SBS Module is provided by the Artemis cosmos engine

Overview

API: SBS

SHPSYS

Bases: Enum

One of four ship systems to track damage

Members:

WEAPONS : the weapons index for system_damage

ENGINES : the engines index for system_damage

SENSORS : the sensors index for system_damage

SHIELDS : the shields index for system_damage

TORPEDO

Bases: object

enum of torpedo types

Members:

HOMING : a torpedo type index

NUKE : a torpedo type index

EMP : a torpedo type index

MINE : a torpedo type index

TORPTYPECOUNT : number of torpedo types

Writer

Bases: object

class Writer

event

Bases: object

class event

client_id property

id of computer this event came from.

event_time property

long int, time this damage occured, compare to simulation.time_tick_counter

origin_id property

id of space object this event came from

parent_id property

id of owner/creator of space object this event came from (like the ship that fired the missile)

selected_id property

id of space object this event is talking about, or doing something to

source_point property

vec3, 3d point this event originated from

sub_float property

float, numeric information

sub_tag property

string describing message sub-type

tag property

string describing message type

value_tag property

string, more information

grid_object

Bases: object

class grid_object

data_set property

object_data_set, read only, reference to the object_data_set of this particular grid object

name property writable

string, text name

tag property writable

string, text tag

type property writable

string, text value, broad type of object

unique_ID property

int32, read only, id of this particular grid object

hullmap

Bases: object

class hullmap

art_file_root property writable

string, file name, used to get top-down image from disk

desc property writable

string, description text

grid_scale property writable

float, space between grid points

h property writable

int, total grid hieght

name property writable

string, text name

symmetrical_flag property writable

int, non-zero if the map is symmetrical

w property writable

int, total grid width

create_grid_object(arg0, arg1, arg2)

returns a gridobject, after creating it

delete_grid_object(arg0)

deletes the grid object, returns true if deletion actually occured

get_grid_object_by_id(arg0)

returns a gridobject, by int32 ID

get_grid_object_by_index(arg0)

returns a gridobject, by position in the list

get_grid_object_by_name(*args, **kwargs)

Overloaded function.

  1. get_grid_object_by_name(self: hullmap, arg0: str) -> grid_object

returns a gridobject, by name

  1. get_grid_object_by_name(self: hullmap, arg0: str) -> grid_object

returns a gridobject, by text tag

get_grid_object_count()

get the number of grid objects in the list, within this hullmap

get_objects_at_point(x, y)

returns a list of grid object IDs that are currently at the x/y point.

is_grid_point_open(arg0, arg1)

is the x/y point within this hullmap open (traversable)? 0 == no

navpoint

Bases: object

color property writable

vec4, color on 2d radar

pos property writable

vec3, position in space

text property writable

string, text label

SetColor(arg0)

use a string color description to set the color

object_data_set

Bases: object

class object_data_set

quaternion

Bases: object

class quaternion

w property writable

float, component value

x property writable

float, component value

y property writable

float, component value

z property writable

float, component value

__init__(w, x=None, y=None, z=None, **kwargs)

Overloaded function.

  1. init(self: quaternion, arg0: float, arg1: float, arg2: float, arg3: float) -> None

  2. init(self: quaternion, arg0: quaternion) -> None

  3. init(self: quaternion) -> None

simulation

Bases: object

time_tick_counter property

get current time value

AddTractorConnection(arg0, arg1, arg2, arg3)

makes a new connection between two space objects. Args: uint32_t sourceID, uint32_t targetID, sbs::vec3 offsetPoint, float pullDistance

ClearTractorConnections()

destroys all existing tractor connections right now.

DeleteTractorConnection(arg0, arg1)

finds and deletes an existing tractor connection. Args: uint32_t sourceID, uint32_t targetID

add_navarea(x1, y1, x2, y2, x3, y3, x4, y4, text, colDesc)

adds a new navarea to space; don't hold on to this Navpoint object in a global; keep the integer ID return value instead args: four x/y floats, std::string text, std::string colorDesc

add_navpoint(arg0, arg1, arg2, arg3, arg4)

adds a new navpoint to space; don't hold on to this Navpoint object in a global; keep the name string instead
args: float x, float y, float z, std::string text, std::string colorDesc

clear_navpoints()

deletes all navpoints

create_space_object(arg0, arg1, abits)

creates a new spaceobject

delete_navpoint_by_id(id)

deletes navpoint by its id

delete_navpoint_by_name(arg0)

deletes navpoint by its name

delete_navpoint_by_reference(arg0)

deletes navpoint by its reference

force_update_to_clients(spaceObjectID, playerShipID)

forces this space object to update its data to the clients attached to the playerShipID (all clients, if playerShipID is zero)

get_navpoint_by_id(id)

takes a string name, returns the associated Navpoint object

get_navpoint_by_name(arg0)

takes a string name, returns the associated Navpoint object

get_navpoint_id_by_name(text)

returns a navpoint ID, given its name as the argument

get_shield_hit_index(sourceShip, targetShip)

Given a source ship and a target ship, this returns the shield (index) that would be hit by a hypothetical beam. -1 if the target ship has no shield facings.

get_shield_hit_index_source(sourcePoint, targetShip)

Given a source position (vec3) and a target ship, this returns the shield (index) that would be hit by a hypothetical beam. -1 if the target ship has no shield facings.

get_space_object(arg0)

returns the refence to a spaceobject, by ID

navpoint_exists(arg0)

returns true if the navpoint exists, by name

reposition_space_object(arg0, arg1, arg2, arg3)

immedaitely changes the position of a spaceobject

space_object_exists(arg0)

returns true if the spaceobject exists, by ID

space_object

Bases: object

cur_speed property writable

float, speed of object

data_set property

object_data_set, read only, refernce to the object_data_set of this particular object

data_tag property writable

string, name of data entry in shipData.json

exclusion_radius property writable

float, other objects cannot be closer to me than this distance

fat_radius property writable

float, radius of box for internal sorting calculations

pos property writable

vec3, position in space

rot_quat property writable

quaternion, heading and orientation of this object

side property writable

string, friendly to other objects on this same side; leave empty for 'no side'

steer_pitch property writable

float, change to heading and orientation of this object, over time

steer_roll property writable

float, change to heading and orientation of this object, over time

steer_yaw property writable

float, change to heading and orientation of this object, over time

tick_type property

string, name of behavior module current available behavior modules : nebula, npcship, asteroid, playership, station

tick_type_ID property

int32, read only, internal representation of tick_type

type property

int, 0=passive, 1=active, 2=playerShip

unique_ID property

int32, read only, id of this particular object

set_behavior(arg0)

set name of behavior module current available behavior modules : nebula, npcship, asteroid, playership, station

tractor_connection

Bases: object

class tractor_connection

offset property writable

float, how much the target is pulled towards the offset every tick. 0 = infinite pull, target locked to boss

source_id property

int, ID of boss/master/major object

target_id property

int, ID of object that is attached to the other

vec2

Bases: object

class vec2

x property writable

float, component value

y property writable

float, component value

__init__(x=None, y=None)

Overloaded function.

  1. init(self: vec2, arg0: float, arg1: float) -> None

  2. init(self: vec2, arg0: vec2) -> None

  3. init(self: vec2) -> None

vec3

Bases: object

class vec3

x property writable

float, component value

y property writable

float, component value

z property writable

float, component value

__init__(x, y=None, z=None)

Overloaded function.

  1. init(self: vec3, arg0: float, arg1: float, arg2: float) -> None

  2. init(self: vec3, arg0: vec3) -> None

  3. init(self: vec3) -> None

vec4

Bases: object

class vec4

a property writable

float, component value (0.0-1.0)

b property writable

float, component value (0.0-1.0)

g property writable

float, component value (0.0-1.0)

r property writable

float, component value (0.0-1.0)

__init__(r, g=None, b=None, a=None)

Overloaded function.

  1. init(self: vec4, arg0: float, arg1: float, arg2: float, arg3: float) -> None

  2. init(self: vec4, arg0: vec4) -> None

  3. init(self: vec4) -> None

add_client_tag()

return a list of client ids, for the computers that are currently connected to this server.

assign_client_to_alt_ship(clientComputerID, controlledShipID)

Tells a client computer that the 2d radar should focus on controlledShipID, instead of its assigned ship. Turn this code off by providing zero as the second argument.

assign_client_to_ship(clientComputerID, controlledShipID)

Tells a client computer which ship it should control.

broad_test(x1, z1, x2, z2, tick_type)

return a list of space objects that are currently inside an x/z 2d rect ARGS: 2D bounding rect, and type value (0, 1, or 2, -1 = all)

clear_client_tags()

return a list of client ids, for the computers that are currently connected to this server.

create_new_sim()

all space objects are deleted; a blank slate is born.

create_transient(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7)

Generates a temporary graphical object, like an explosion.

delete_object(arg0)

deletes a space object by its ID

distance(arg0, arg1)

returns the distance between two space objects; arguments are two spaceObjects

distance_between_navpoints(arg0, arg1)

returns the distance between two nav points; navpoints by name

distance_to_navpoint(arg0, arg1)

returns the distance between a nav point and a space object; navpoint name, then object ID

find_valid_grid_point_for_vector3(spaceObjectID, vecPoint, randomRadius)

return a list of two integers, the grid x and y that is open and is closest. The list is empty if the search fails.

find_valid_unoccupied_grid_point_for_vector3(spaceObjectID, vecPoint, randomRadius)

return a list of two integers, the grid x and y that is open and is closest. The list is empty if the search fails.

get_debug_gui_tree(clientID, tag, displayListFlag)

sends a GUI debug message from the targeted client (0 = server screen)

get_game_version()

returns the version of the game EXE currently operating this script, as a string.

get_hull_map(spaceObjectID, forceCreate=False)

gets the hull map object for this space object; setting forceCreate to True will erase and rebuild the grid (and gridObjects) of this spaceobject

get_preference_float(key)

Gets a value from preferences.json

get_preference_int(key)

Gets a value from preferences.json

get_preference_string(key)

Gets a value from preferences.json

get_screen_size()

returns a VEC2, with the width and height of the display in pixels

in_standby_list(space_object)

returns true if the spaceobject is in the standby list.

in_standby_list_id(id)

returns true if the spaceobject is in the standby list.

is_demo()

Returns true if the EXE is marked as a demo version.

particle_at(position, descriptorString)

emit some particles in space.

particle_emittor_exists(emittorID)

checks for the existance of a particle emittor.

particle_on(spaceObject, descriptorString)

emit some particles in space from a space object.

pause_sim()

the sim will now pause; HandlePresentGUI() and HandlePresentGUIMessage() are called.

play_music_file(arg0, arg1, arg2)

Plays a music file now, for the specified ship.

player_ship_setup_defaults(space_object)

Rebuilds the default blob data of this player ship.

player_ship_setup_from_data(space_object)

Rebuilds the blob data of this player ship from the shipdata.json and the preferences.json.

push_to_standby_list(space_object)

moves the spaceobject from normal space to the standby list.

push_to_standby_list_id(id)

moves the spaceobject from normal space to the standby list.

query_client_tags()

return a list of client ids, for the computers that are currently connected to this server.

resume_sim()

the sim will now run; HandleStartMission() and HandleTickMission() are called.

send_client_widget_list(clientID, consoleType, widgetList)

sends the gameplay widgets to draw, on the targeted client (0 = server screen)

send_client_widget_rects(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9)

changes the rects of a gameplay widget, on the targeted client (0 = server screen).

send_comms_button_info(arg0, arg1, arg2, arg3)

sends a complex message to the comms console of a certain ship. args: uint64 playerID (0 = all ships), std::string color, std::string bodyText

send_comms_message_to_player_ship(playerID, otherID, faceDesc, titleText, titleColor, bodyText, bodyColor)

sends a complex message to the comms console of a certain ship. args: uint64 playerID (0 = all ships), uint64 otherID, std::string titleText, std::string titleColor, std::string bodyText, std::string bodyColor

send_comms_selection_info(arg0, arg1, arg2, arg3)

sends a complex message to the comms console of a certain ship. args: uint64 playerID (0 = all ships), std::string color, std::string bodyText

send_grid_button_info(arg0, arg1, arg2, arg3)

sends a complex message to the engineering console of a certain ship. args: uint64 playerID (0 = all ships), std::string color, std::string bodyText

send_grid_selection_info(arg0, arg1, arg2, arg3)

sends a complex message to the engineering console of a certain ship. args: uint64 playerID (0 = all ships), std::string color, std::string bodyText

send_gui_3dship(clientID, parent, tag, style, left, top, right, bottom)

Creates a 3D ship box GUI element, on the targeted client (0 = server screen)

send_gui_button(clientID, parent, tag, style, left, top, right, bottom)

Creates a button GUI element, on the targeted client (0 = server screen)

send_gui_checkbox(clientID, parent, tag, style, left, top, right, bottom)

Creates a checkbox GUI element, on the targeted client (0 = server screen)

send_gui_clear(clientID, tag)

Clears all GUI elements from screen, on the targeted client (0 = server screen). remember to use send_gui_complete after adding widgets.

send_gui_clickregion(clientID, parent, tag, style, left, top, right, bottom)

Creates a click-region GUI element, on the targeted client (0 = server screen)

send_gui_colorbutton(clientID, parent, tag, style, left, top, right, bottom)

Creates a color button GUI element, on the targeted client (0 = server screen)

send_gui_colorcheckbox(clientID, parent, tag, style, left, top, right, bottom)

Creates a color checkbox GUI element, on the targeted client (0 = server screen)

send_gui_complete(clientID, tag)

Flips double-buffered GUI display list, on the targeted client (0 = server screen). Use after a send_gui_clear() and some send_gui* calls

send_gui_dropdown(clientID, parent, tag, style, left, top, right, bottom)

Creates a dropdown GUI element, on the targeted client (0 = server screen)

send_gui_face(clientID, parent, tag, face_string, left, top, right, bottom)

Creates a face box GUI element, on the targeted client (0 = server screen)

send_gui_hotkey(clientID, category, tag, keyType, description)

tells the targeted client (0 = server screen) to handle a hot key for a certain retained gui element.

send_gui_icon(clientID, parent, tag, style, left, top, right, bottom)

Creates an icon art GUI element, on the targeted client (0 = server screen)

send_gui_iconbutton(clientID, parent, tag, style, left, top, right, bottom)

Creates an icon-button GUI element, on the targeted client (0 = server screen)

send_gui_iconcheckbox(clientID, parent, tag, style, left, top, right, bottom)

Creates an icon-checkbox GUI element, on the targeted client (0 = server screen)

send_gui_image(clientID, parent, tag, style, left, top, right, bottom)

Creates a 2d art image GUI element, on the targeted client (0 = server screen)

send_gui_rawiconbutton(clientID, parent, tag, style, left, top, right, bottom)

Creates a simple clickable icon GUI element, on the targeted client (0 = server screen)

send_gui_slider(clientID, parent, tag, current, style, left, top, right, bottom)

Creates a slider bar GUI element, on the targeted client (0 = server screen) (long clientID, std::string tag, float low, float high, float current, float left, float top, float right, float bottom, bool showNumberFlag)

send_gui_sub_region(clientID, parent, tag, style, left, top, right, bottom)

Creates a subregion GUI element, on the targeted client (0 = server screen)

send_gui_text(clientID, parent, tag, style, left, top, right, bottom)

Creates a text box GUI element, on the targeted client (0 = server screen)

send_gui_typein(clientID, parent, tag, style, left, top, right, bottom)

Creates a text entry GUI element, on the targeted client (0 = server screen)

send_message_to_player_ship(arg0, arg1, arg2)

sends a text message to the text box, on every client for a certain ship. args: uint32_t playerID (0 = all ships), std::string color, std::string text

send_story_dialog(arg0, arg1, arg2, arg3, arg4)

sends a story dialog to the targeted client (0 = server screen)

set_beam_damages(clientID, playerBeamDamage, npcBeamDamage)

sets the values for player base beam damage, and npc base beam damage. Per client, or all clients + server (if ID = 0).

set_client_string(clientComputerID, string_key, string_value)

stores a string value (and its string key) to the client computer

set_dmx_channel(clientID, channel, behavior, speed, low, high)

set a color channel of dmx.

set_main_view_modes(clientID, main_screen_view, cam_angle, cam_mode)

sets the three modes of the main screen view for the specified client. main_screen_view = (3d_view, info, data); cam_angle = (front, back, left, right); cam_mode = (first_person, chase, tracking)

set_music_folder(ID, filename)

Sets the folder from which music is streamed; ID is ship, OR client, OR zero for server.

set_music_tension(ID, tensionValue)

Sets the tension value of ambient music (0-100); ID is ship, OR client, OR zero for server.

set_shared_string(key, value)

sets (or changes) a shared string, given a key and a value (both strings). The shared strings are automatically copied from server to all clients.

set_sky_box(clientID, artFileName)

sets the skybox art for a clientID (0 = server).

set_sky_box_all(artFileName)

sets the skybox art for all connected computers.