## function list

This is a moderated forum that collects tutorials, guides, and references for creating Transcendence extensions and scripts.
Betelgeuse
Fleet Officer
Posts: 1920
Joined: Sun Mar 05, 2006 6:31 am
Name:
staGetStructuralHP

Syntax:
(staGetStructuralHP station)

Argument List:
station: The station you want to get the structural hp of.

Returns:
number: The structural hp of the station.

Category:
station

Description:
Returns the structural hp of the station.

Example:

Comment:
The structural HP of a station is how many HP before it is completely destroyed.
Crying is not a proper retort!

Betelgeuse
Fleet Officer
Posts: 1920
Joined: Sun Mar 05, 2006 6:31 am
Name:
staSetStructuralHP

Syntax:
(staSetStructuralHP station number)

Argument List:
station: The station you want to set the structural hp of.
number: What you want to set the structural hp to.

Returns:
condition: True if successful, Nil otherwise.

Category:
station

Description:
Sets the structural hp of the station.

Example:

Comment:
The structural HP of a station is how many HP before it is completely destroyed.
Crying is not a proper retort!

digdug
Posts: 2614
Joined: Mon Oct 29, 2007 9:23 pm
Location: Decoding hieroglyphics on Tan-Ru-Dorem
Name
sysCreateShip

Syntax:
(sysCreateShip number vector number [string])

Argument List:
number: the UNID of the ship that has to be created
vector: can be vector, gSource or gStart or any spaceObject
number: The UNID of the sovereign assigned to the created ship
spaceObject: the controller of the ship, can be ship or station.

Returns:
True if succesful

Category:
ship, create

Description:
Creates a ship from the UNID in the desidered position (vector)

Example

Comment:
Basic function to create stations in code.
If called from a station, gSource is used directly instead of the vector to create the ship at the position of the station itself.

digdug
Posts: 2614
Joined: Mon Oct 29, 2007 9:23 pm
Location: Decoding hieroglyphics on Tan-Ru-Dorem
Name
sysCreateStation

Syntax:
(sysCreateStation number vector)

Argument List:
number: the UNID of the station that has to be created
vector: the position of the new station

Returns:
True is successful

Category:
station, create

Description:
Creates a station from UNID at the desidered position (vector)

Example

Comment:
Basic function to create stations in code.

digdug
Posts: 2614
Joined: Mon Oct 29, 2007 9:23 pm
Location: Decoding hieroglyphics on Tan-Ru-Dorem
Name
sysCreateMarker

Syntax:
(sysCreateMarker string vector number)

Argument List:
string: the name of the marker
vector: position of the newly created marker
number: the UNID of the sovereign of the marker

Returns:
True if successful

Category:
create, system

Description:
Creates a marker in the desidered position.

Example

Comment:
Basic function used to creates markers, that are spaceObjects used to locate specific positions.

digdug
Posts: 2614
Joined: Mon Oct 29, 2007 9:23 pm
Location: Decoding hieroglyphics on Tan-Ru-Dorem
Name
sysCreateWeaponFire

Syntax:
(sysCreateWeaponFire number spaceObject vector number number spaceObject [condition])

Argument List:
number: the UNID of the called weapon effect
spaceObject: the controller of the weaponfire, can also be Nil
vector: position of the weaponfire
number: angle of the direction of the weapon
number: speed of the weaponfire
spaceObject: the target of the weapon, can also be Nil
[condition]: if True the failsafe variable in the <Weapon> tag is ignored

Returns:
True is successful

Category:
create, system

Description:
Creates the effect of a weapon selected from the UNID

Example

Comment:
Highly customizable function that creates weapon fire effects.
The target of the weapon is specified in order to be used for tracking weapons.

Betelgeuse
Fleet Officer
Posts: 1920
Joined: Sun Mar 05, 2006 6:31 am
Name:
subst

Syntax:
(subst string string^1)

Argument List:
string: A string that contains %number% parts.
string: The strings you are inserting into the first string.
^1

Returns:
string: The string with the appropriate parts replaced.

Category:
string operation

Description:
Replaces the %number% parts of the first string with the element with that number in the argument list and returns it. Can have unused arguments.

Example:

Code: Select all

``(subst "%1% and %4% and %3% and %4%" "runs" 5000 "four" "bob" "not used")``
Returns the string "runs and bob and four and bob".

Code: Select all

``(subst "%8% %7% %6% %5% %4% %3% %2% %1%." "function" "subst" "the" "of" "example" "an" "is" "This")``
Returns the string "This is an example of the subst function.".

Comment:
The xml wasn't much help in seeing what this does. Remember numbers can be strings if needed in Transcendence.
Crying is not a proper retort!

Betelgeuse
Fleet Officer
Posts: 1920
Joined: Sun Mar 05, 2006 6:31 am
Name:
staGetImageVariant

Syntax:
(staGetImageVariant station)

Argument List:
station: The station you want to get the image variant of.

Returns:
number: The number of the image variant.

Category:
station

Description:
Gets the image variant of the station.

Example:

Comment:
Useful for seeing what image variant a station is using.
Crying is not a proper retort!

Betelgeuse
Fleet Officer
Posts: 1920
Joined: Sun Mar 05, 2006 6:31 am
Name:
staSetImageVariant

Syntax:
(staSetImageVariant station number)

Argument List:
station: The station you want to set the image variant of.
number: The number of the image variant you want to change it to.

Returns:
condition: True if successful, Nil otherwise.

Category:
station

Description:
Sets the image variant of the station.

Example:

Comment:
Useful for changing what image variant a station is using.
Crying is not a proper retort!

Betelgeuse
Fleet Officer
Posts: 1920
Joined: Sun Mar 05, 2006 6:31 am
Name:
staGetType

Syntax:
(staGetType station)

Argument List:
station: The station you want to set the UNID of.

Returns:
number: The UNID of the station.

Category:
station

Description:
Returns the UNID of the station.

Example:

Code: Select all

``(staGetType (sysCreateStation &stStartonEridani; Nil))``
This will return the number 1056769.

Comment:
Useful for seeing the UNID of a station.
Crying is not a proper retort!

Betelgeuse
Fleet Officer
Posts: 1920
Joined: Sun Mar 05, 2006 6:31 am
Name:
staSetActive

Syntax:
(staSetActive station)

Argument List:
station: The station you want to set active.

Returns:
condition: True if successful, Nil otherwise.

Category:
station

Description:
Sets the data in the station named by "Active" to true and allows the station to be animated.

Example:

Comment:
Used for the last star gate.
Crying is not a proper retort!

Betelgeuse
Fleet Officer
Posts: 1920
Joined: Sun Mar 05, 2006 6:31 am
Name:
staSetInactive

Syntax:
(staSetInactive station)

Argument List:
station: The station you want to set inactive.

Returns:
condition: True if successful, Nil otherwise.

Category:
station

Description:
Sets the data in the station named by "Active" to Nil and stops the station from being animated.

Example:

Comment:
Useful for stopping animations on a station.
Crying is not a proper retort!

Betelgeuse
Fleet Officer
Posts: 1920
Joined: Sun Mar 05, 2006 6:31 am
Name:
sysFindObject

Syntax:
(sysFindObject spaceObject criteria)

Argument List:
spaceObject: The space object in the system you want a list of space objects from.
criteria: The criteria you want the all the space objects in the list to have.

Returns:
list: A list of all the space objects in the spaceObjects system that match the criteria.

Category:
space object, system

Description:
Returns a list of space objects in the system that match the criteria.

Example:

Code: Select all

``(sysFindObject gPlayerShip "Ts")``
Gives you a list of all structure-scale stations and ships.

Comment:
* G -> Stargates only
* s -> Include ships
* t -> Include stations (including planets)
* T -> Include structure-scale stations
* T:xyz -> Include stations with attribute 'xyz'
* A -> Active objects only (i.e., objects that can attack)
* B:xyz -> Only objects with attribute 'xyz'
* D:xyz -> Only objects with data 'xyz'
* E -> Enemy objects only
* F -> Friendly objects only
* M -> Manufactured objects only (i.e., no planets or asteroids)
* N -> Return only the nearest object to the source
* N:nn -> Return only objects within nn light-seconds
* O:escort -> Ships ordered to escort source
* R:nn -> Return only objects greater than nn light-seconds away
Crying is not a proper retort!

Betelgeuse
Fleet Officer
Posts: 1920
Joined: Sun Mar 05, 2006 6:31 am
Name:
sysGetData

Syntax:
(sysGetData [string] string)

Argument List:
string: The optional name of the system node. If not there uses the current system.
string: The name of the data.

Returns:
data: Whatever is in the named data for the given system node, Nil if no system node by that name or no data by that name.

Category:
system, data

Description:
Returns the named data for the given system.

Example:

Code: Select all

``(sysGetData "power")``
Returns the currents systems data named by power. If there is no data (like in a unmodded game) by that name returns Nil.

Comment:
Useful for getting/storing information about a system such as how many times the player has visited the system.
Crying is not a proper retort!

Betelgeuse
Fleet Officer
Posts: 1920
Joined: Sun Mar 05, 2006 6:31 am
Name:
sysSetData

Syntax:
(sysSetData [string] string expression)

Argument List:
string: The optional name of the system node. If not there uses the current system.
string: The name of the data.
expression: The data you want to store.

Returns:
condition: True if successful, Nil otherwise.

Category:
system, data

Description:
Sets the named data in the given system to the expression.

Example:

Code: Select all

``(sysSetData "power" 9001)``
Stores the number 9001 in the power data for the current system.

Comment:
Useful for getting/storing information about a system such as how many times the player has visited the system.
Crying is not a proper retort!