function list

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

Name:
strFind

Syntax:
(strFind string string)

Argument List:
string: The string that to search.
string: The string you want to search for.

Returns:
number: The index where the second string is found starting at 0, if not found returns Nil.

Category:
string

Description:
Finds the second string in the first string and returns where it is in the first string.

Example:

Code: Select all

(strFind "abcdef" "ab")
Returns the number 0.

Code: Select all

(strFind "abcdef" "cd")
Returns the number 2.

Code: Select all

(strFind "abcdef" "Betel")
Returns Nil.

Comment:
Interesting string function allowing you to search in strings. We need more string functions.
Crying is not a proper retort!
User avatar
Betelgeuse
Fleet Officer
Fleet Officer
Posts: 1920
Joined: Sun Mar 05, 2006 6:31 am

Name:
sysAddEncounterEvent

Syntax:
(sysAddEncounterEvent number spaceObject number spaceObject)

Argument List:
number: The delay before the encounter event can happens.
spaceObject: The space object the encounter ships target.
number: The UNID of the encounter table.
spaceObject: The spaceObject where you want the encounter ship to appear at.

Returns:
condition: True if successful, Nil otherwise.

Category:
system, encounter table, time

Description:
Makes a encounter at the given space object.

Example:

Code: Select all

(sysAddEncounterEvent 100 gplayership &etPirateAmbush1; gplayership)
Makes a pirate ambush 1 encounter 100 ticks after this is called on the player ship targeting the player ship.

Comment:
Can be used to mimic random encounters. Is mostly used to make ambushes happen.
Crying is not a proper retort!
User avatar
Betelgeuse
Fleet Officer
Fleet Officer
Posts: 1920
Joined: Sun Mar 05, 2006 6:31 am

Name:
sysAddEncounterEventAtDist

Syntax:
(sysAddEncounterEventAtDist number spaceObject number number)

Argument List:
number: The delay before the encounter event can happens.
spaceObject: The space object the encounter ships target.
number: The UNID of the encounter table.
number: The distance from the target you want the encounter ships to appear at.

Returns:
condition: True if successful, Nil otherwise.

Category:
system, encounter table, time

Description:
Makes a encounter at the given distance from the space object.

Example:

Code: Select all

(sysAddEncounterEventAtDist 100 gplayership &etPirateAmbush1; 100)
Makes a pirate ambush 1 encounter 100 ticks after this is called 100 light seconds from player ship targeting the player ship.

Comment:
Can be used to mimic random encounters. Is mostly used to make ambushes happen.
Crying is not a proper retort!
User avatar
Betelgeuse
Fleet Officer
Fleet Officer
Posts: 1920
Joined: Sun Mar 05, 2006 6:31 am

Name:
sysAddObjRecurringTimerEvent

Syntax:
(sysAddObjRecurringTimerEvent number spaceObject string)

Argument List:
number: The ticks between each of the timed events.
spaceObject: The space object that will be calling the events.
string: The name of the event.

Returns:
condition: True if successful, Nil otherwise.

Category:
system, event, time

Description:
Makes an event be called on a space object every so often.

Example:

Code: Select all

(sysAddObjRecurringTimerEvent 100 gplayership "Success")
Calls the event called Success on the player ship every 100 ticks.

Comment:
Allows you to run a code every so often.
Crying is not a proper retort!
User avatar
Betelgeuse
Fleet Officer
Fleet Officer
Posts: 1920
Joined: Sun Mar 05, 2006 6:31 am

Name:
sysAddObjTimerEvent

Syntax:
(sysAddObjTimerEvent number spaceObject string)

Argument List:
number: The delay before the event is run.
spaceObject: The space object that will be calling the event.
string: The name of the event.

Returns:
condition: True if successful, Nil otherwise.

Category:
system, event, time

Description:
Makes an event be called on a space object after a delay.

Example:

Code: Select all

(sysAddObjTimerEvent 100 gplayership "Success")
Calls the event called Success on the player ship after 100 ticks.

Comment:
Allows you to run a code on an space object after a delay.
Crying is not a proper retort!
User avatar
Betelgeuse
Fleet Officer
Fleet Officer
Posts: 1920
Joined: Sun Mar 05, 2006 6:31 am

Name:
sysCancelTimerEvent

Syntax:
(sysCancelTimerEvent spaceObject string)

Argument List:
spaceObject: The space object that will call the event that needs to be canceled.
string: The name of the event.

Returns:
condition: True if successful, Nil otherwise.

Category:
system, event, time

Description:
Stops the named timed event from being called on the space object.

Example:

Code: Select all

(sysCancelTimerEvent gplayership "Success")
Stops the timed event Success from running.

Comment:
Allows you to stop a timed event from running.
Crying is not a proper retort!
User avatar
digdug
Fleet Admiral
Fleet Admiral
Posts: 2620
Joined: Mon Oct 29, 2007 9:23 pm
Location: Decoding hieroglyphics on Tan-Ru-Dorem

Name:
staGetDockedShips

Syntax:
(staGetDockedShips station)

Argument List:
station: The station that you want to query.

Returns:
list: the list of docked ships.

Category:
ship, station

Description:
Returns the list of ships that are docked to the queried station.

Example:

Comment:
Currently used in the Korolov shipping code to select a docked ships for the missions.
User avatar
digdug
Fleet Admiral
Fleet Admiral
Posts: 2620
Joined: Mon Oct 29, 2007 9:23 pm
Location: Decoding hieroglyphics on Tan-Ru-Dorem

Name:
sysCreateEffect

Syntax:
(sysCreateEffect number spaceObject vector)

Argument List:
number: the UNID of the effect you want to display.
spaceObject: the spaceObject that called the effect, can be a ship or a station or Nil
vector: position of the effect

Returns:
True if successful

Category:
create, system

Description:
Creates an effect from the UNID in the desidered position (vector)

Example:
(sysCreateEffect &efGemOfSacrifice; gSource (objGetPos gSource))

Creates the Gem of Sacrifice effect centered on the calling space object

Comment:
Because effects can generate sounds, animations and weapon effects, I think that this function has great modding potential.
Currently used ingame only for the Gem of Sacrifice
User avatar
Betelgeuse
Fleet Officer
Fleet Officer
Posts: 1920
Joined: Sun Mar 05, 2006 6:31 am

Name:
staClearFireReconEvent

Syntax:
(staClearFireReconEvent station)

Argument List:
station: The station you want to clear the recon event from.

Returns:
condition: True if successful, Nil otherwise.

Category:
station, event, recon

Description:
Stops the recon event from being called on the station.

Example:

Comment:
Used to remove what staSetFireReconEvent sets. You recon something if you have seen it on screen.
Crying is not a proper retort!
User avatar
Betelgeuse
Fleet Officer
Fleet Officer
Posts: 1920
Joined: Sun Mar 05, 2006 6:31 am

Name:
staClearReconned

Syntax:
(staClearReconned station)

Argument List:
station: The station you want not to be reconned anymore.

Returns:
condition: True if successful, Nil otherwise.

Category:
station, recon

Description:
Makes the station not to be reconned anymore.

Example:

Comment:
You recon something if you have seen it on screen.
Crying is not a proper retort!
User avatar
Betelgeuse
Fleet Officer
Fleet Officer
Posts: 1920
Joined: Sun Mar 05, 2006 6:31 am

Name:
staSetFireReconEvent

Syntax:
(staSetFireReconEvent station)

Argument List:
station: The station you want fire events when it is reconned.

Returns:
condition: True if successful, Nil otherwise.

Category:
station, event, recon

Description:
Makes the station fire recon events when it is reconned.

Example:

Comment:
Used with OnObjReconned. You recon something if you have seen it on screen.
Crying is not a proper retort!
User avatar
Betelgeuse
Fleet Officer
Fleet Officer
Posts: 1920
Joined: Sun Mar 05, 2006 6:31 am

Name:
staIsReconned

Syntax:
(staIsReconned station)

Argument List:
station: The station you want check if it is reconned.

Returns:
condition: True if the station has been reconned, Nil otherwise.

Category:
station, recon, condition query

Description:
Returns if the station has been reconned.

Example:

Comment:
You recon something if you have seen it on screen.
Crying is not a proper retort!
User avatar
Betelgeuse
Fleet Officer
Fleet Officer
Posts: 1920
Joined: Sun Mar 05, 2006 6:31 am

Name:
staIsEncountered

Syntax:
(staIsEncountered number)

Argument List:
number: The UNID of the station you want to check if it has been created.

Returns:
condition: True if the station has been created before, Nil otherwise.

Category:
station, condition query

Description:
Checks if the station has been created before.

Example:

Code: Select all

(staIsEncountered &stStartonEridani;)
Returns true because one is created in the first system.

Comment:
Useful in checking if a station already exists in the game.
Crying is not a proper retort!
User avatar
Betelgeuse
Fleet Officer
Fleet Officer
Posts: 1920
Joined: Sun Mar 05, 2006 6:31 am

Name:
staGetGlobalData

Syntax:
(staGetGlobalData number string)

Argument List:
number: The UNID of the station you want to get the data from.
string: The name of the data.

Returns:
data: Whatever the named global data in the station type contains.

Category:
station, data

Description:
Returns the data named by the string for the station type.

Example:

Code: Select all

(staGetGlobalData &stCSCEuropaWreck; "VaultCode")
Returns what is in the VaultCode in the CSC Europa.

Comment:
Basic data function allowing you to get global data with a UNID instead of a space object.
Crying is not a proper retort!
User avatar
Betelgeuse
Fleet Officer
Fleet Officer
Posts: 1920
Joined: Sun Mar 05, 2006 6:31 am

Name:
staSetGlobalData

Syntax:
(staSetGlobalData number string expression)

Argument List:
number: The UNID of the station you want to set the data on.
string: The name of the data.
expression: The data you want to store.

Returns:
condition: True if successful, Nil otherwise.

Category:
station, data

Description:
Stores the expression in the named global data in the station type.

Example:

Code: Select all

(staGetGlobalData &stCSCEuropaWreck; "VaultCode")
Returns what is in the VaultCode in the CSC Europa.

Comment:
Basic data function allowing you to set global data with a UNID instead of a space object.
Crying is not a proper retort!
Post Reply