Space Station 13 - Modules - TypesDefine Details

code/__DEFINES/rust_g.dm

/proc/rustg_get_version Gets the version of rust_g
rustg_setup_acreplaceSets up the Aho-Corasick automaton with its default options.
rustg_setup_acreplace_with_optionsSets up the Aho-Corasick automaton using supplied options.
rustg_acreplaceRun the specified replacement engine with the provided haystack text to replace, returning replaced text.
rustg_acreplace_with_replacementsRun the specified replacement engine with the provided haystack text to replace, returning replaced text.
rustg_cnoise_generateThis proc generates a cellular automata noise grid which can be used in procedural generation methods.
rustg_dbp_generateThis proc generates a grid of perlin-like noise
rustg_dmi_icon_statesinput: must be a path, not an /icon; you have to do your own handling if it is one, as icon objects can't be directly passed to rustg.
rustg_register_nodes_astarRegister a list of nodes into a rust library. This list of nodes must have been serialized in a json. Node {// Index of this node in the list of nodes unique_id: usize, // Position of the node in byond x: usize, y: usize, z: usize, // Indexes of nodes connected to this one connected_nodes_id: Vec} It is important that the node with the unique_id 0 is the first in the json, unique_id 1 right after that, etc. It is also important that all unique ids follow. {0, 1, 2, 4} is not a correct list and the registering will fail Nodes should not link across z levels. A node cannot link twice to the same node and shouldn't link itself either
rustg_add_node_astarAdd a new node to the static list of nodes. Same rule as registering_nodes applies. This node unique_id must be equal to the current length of the static list of nodes
rustg_remove_node_astart*²
rustg_generate_path_astarCompute the shortest path between start_node and goal_node using A*. Heuristic used is simple geometric distance
rustg_redis_connect_rqConnects to a given redis server.
/proc/rustg_redis_disconnect_rq Disconnects from a previously connected redis server
rustg_redis_lpushhttps://redis.io/commands/lpush/
rustg_redis_lrangehttps://redis.io/commands/lrange/
rustg_redis_lpophttps://redis.io/commands/lpop/
/proc/rustg_unix_timestamp Returns the timestamp as a string
rustg_worley_generateThis proc generates a noise grid using worley noise algorithm

Define Details

rustg_acreplace

Run the specified replacement engine with the provided haystack text to replace, returning replaced text.

Arguments:

rustg_acreplace_with_replacements

Run the specified replacement engine with the provided haystack text to replace, returning replaced text.

Arguments:

rustg_add_node_astar

Add a new node to the static list of nodes. Same rule as registering_nodes applies. This node unique_id must be equal to the current length of the static list of nodes

rustg_cnoise_generate

This proc generates a cellular automata noise grid which can be used in procedural generation methods.

Returns a single string that goes row by row, with values of 1 representing an alive cell, and a value of 0 representing a dead cell.

Arguments:

rustg_dbp_generate

This proc generates a grid of perlin-like noise

Returns a single string that goes row by row, with values of 1 representing an turned on cell, and a value of 0 representing a turned off cell.

Arguments:

rustg_dmi_icon_states

input: must be a path, not an /icon; you have to do your own handling if it is one, as icon objects can't be directly passed to rustg.

output: json_encode'd list. json_decode to get a flat list with icon states in the order they're in inside the .dmi

rustg_generate_path_astar

Compute the shortest path between start_node and goal_node using A*. Heuristic used is simple geometric distance

rustg_redis_connect_rq

Connects to a given redis server.

Arguments:

rustg_redis_lpop

https://redis.io/commands/lpop/

Arguments

Note: count was added in Redis version 6.2.0

rustg_redis_lpush

https://redis.io/commands/lpush/

Arguments

rustg_redis_lrange

https://redis.io/commands/lrange/

Arguments

rustg_register_nodes_astar

Register a list of nodes into a rust library. This list of nodes must have been serialized in a json. Node {// Index of this node in the list of nodes unique_id: usize, // Position of the node in byond x: usize, y: usize, z: usize, // Indexes of nodes connected to this one connected_nodes_id: Vec} It is important that the node with the unique_id 0 is the first in the json, unique_id 1 right after that, etc. It is also important that all unique ids follow. {0, 1, 2, 4} is not a correct list and the registering will fail Nodes should not link across z levels. A node cannot link twice to the same node and shouldn't link itself either

rustg_remove_node_astart

*²

rustg_setup_acreplace

Sets up the Aho-Corasick automaton with its default options.

The search patterns list and the replacements must be of the same length when replace is run, but an empty replacements list is allowed if replacements are supplied with the replace call Arguments:

rustg_setup_acreplace_with_options

Sets up the Aho-Corasick automaton using supplied options.

The search patterns list and the replacements must be of the same length when replace is run, but an empty replacements list is allowed if replacements are supplied with the replace call Arguments:

rustg_worley_generate

This proc generates a noise grid using worley noise algorithm

Returns a single string that goes row by row, with values of 1 representing an alive cell, and a value of 0 representing a dead cell.

Arguments: