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:
objGetInstalledItemDesc

Syntax:
(objGetInstalledItemDesc spaceObject itemStruct)

Argument List:
spaceObject: The space object that the item is in.
itemStruct: The itemstruct of the item that you want the installed description of.

Returns:
string: The installed description of the item.

Category:
spaceObject

Description:
Creates and returns a string describing how the item is installed.

Example:

Comment:
Kind of hard to describe. Take for example armors they have locations so a forward armor would return "installed as forward armor".
Crying is not a proper retort!
User avatar
Betelgeuse
Fleet Officer
Fleet Officer
Posts: 1920
Joined: Sun Mar 05, 2006 6:31 am

Name:
objGetItems

Syntax:
(objGetItems spaceObject criteria)

Argument List:
spaceObject: The space object that the items are in.
criteria: The criteria that you want the items you get to match.

Returns:
list: A list of all the items in the space object that match the criteria.

Category:
spaceObject, item

Description:
Creates and returns a list of all the items in the space object that match the criteria.

Example:

Code: Select all

(objGetItems gplayerShip "wI")
Returns a list of all the installed weapons on the ship.

Comment:
Useful for getting all the items of a certain kind from a space object. It is most often used to check if the space object contains a certain kind of items.
Crying is not a proper retort!
User avatar
Betelgeuse
Fleet Officer
Fleet Officer
Posts: 1920
Joined: Sun Mar 05, 2006 6:31 am

Name:
objGetMaxPower

Syntax:
(objGetMaxPower spaceObject)

Argument List:
spaceObject: The space object that you want the max power from.

Returns:
number: The max power of the space object.

Category:
spaceObject

Description:
Returns the max power of ship space object.

Example:

Code: Select all

(objGetMaxPower gplayerShip)
Returns the max power of the currently equipped reactor.

Comment:
Mainly used to find out what the next reactor you should upgrade to.
Crying is not a proper retort!
User avatar
Betelgeuse
Fleet Officer
Fleet Officer
Posts: 1920
Joined: Sun Mar 05, 2006 6:31 am

Name:
objGetName

Syntax:
(objGetName spaceObject [number])

Argument List:
spaceObject: The space object that you want the name from.
[number]: An optional naming code

Returns:
string: The name of the space object.

Category:
spaceObject

Description:
Returns the name of space object.

Example:

Code: Select all

(objGetName gplayerShip)
Returns the name of the player ship.

Code: Select all

(objGetName gplayerShip 2)
Returns the pluralized name of the player ship.

Comment:
Basic space object function to get the space objects name.
Crying is not a proper retort!
User avatar
Betelgeuse
Fleet Officer
Fleet Officer
Posts: 1920
Joined: Sun Mar 05, 2006 6:31 am

Name:
objGetNearestStargate

Syntax:
(objGetNearestStargate spaceObject)

Argument List:
spaceObject: The space object that you want to get the nearest star gate from.

Returns:
spaceObject: The nearest star gate.

Category:
spaceObject

Description:
Returns the nearest star gate to the space object.

Example:

Code: Select all

(objGetNearestStargate gplayerShip)
Returns the nearest star gate to the player ship.

Comment:
Used main to create ships from the nearest star gate or to find the distance to the nearest star gate.
Crying is not a proper retort!
User avatar
Betelgeuse
Fleet Officer
Fleet Officer
Posts: 1920
Joined: Sun Mar 05, 2006 6:31 am

Name:
objGetObjRefData

Syntax:
(objGetObjRefData spaceObject string)

Argument List:
spaceObject: The space object that you want to get the space object reference from.
string: The name of the space object reference.

Returns:
spaceObject: The space object in this space object that is named by the string..

Category:
spaceObject

Description:
Returns the space object reference stored in this space object named by the string.

Example:

Comment:
Used with objSetObjRefData. Just like objGetData except it can get space objects.
Crying is not a proper retort!
User avatar
Betelgeuse
Fleet Officer
Fleet Officer
Posts: 1920
Joined: Sun Mar 05, 2006 6:31 am

Name:
objSetObjRefData

Syntax:
(objSetObjRefData spaceObject string spaceObject)

Argument List:
spaceObject: The space object that you want store the other space obect in.
string: The name of the space object reference.
spaceObject: The space object that you want to store.

Returns:
True if successful.

Category:
spaceObject

Description:
Stores a space object in a different space object.

Example:

Comment:
Used with objGetObjRefData. Just like objSetData except it can store space objects.
Crying is not a proper retort!
User avatar
Betelgeuse
Fleet Officer
Fleet Officer
Posts: 1920
Joined: Sun Mar 05, 2006 6:31 am

Name:
objGetOrderGiver

Syntax:
(objGetOrderGiver spaceObject)

Argument List:
spaceObject: The space object that you want to get the order giver from.

Returns:
spaceObject: The order giver.

Category:
spaceObject

Description:
Gets the space object that gave a order to the passed in space object.

Example:

Code: Select all

(eq (objGetOrderGiver gsource) gPlayerShip)
Returns whether the calling space object has been given an order by the player ship.

Comment:
Helpful little function if you need to know who gave an order to a ship.
Crying is not a proper retort!
User avatar
Betelgeuse
Fleet Officer
Fleet Officer
Posts: 1920
Joined: Sun Mar 05, 2006 6:31 am

Name:
objGetPos

Syntax:
(objGetPos spaceObject)

Argument List:
spaceObject: The space object that you want the position of.

Returns:
vector: The position of the space object.

Category:
spaceObject

Description:
Returns the vector position of the space object.

Example:

Code: Select all

(objGetPos gPlayerShip)
Returns the vector position of where in the system the player ship is.

Comment:
Helpful little function if you need to know where a space object is for later use.
Last edited by Betelgeuse on Mon Dec 31, 2007 8:10 pm, edited 1 time in total.
Crying is not a proper retort!
User avatar
Betelgeuse
Fleet Officer
Fleet Officer
Posts: 1920
Joined: Sun Mar 05, 2006 6:31 am

Name:
objGetSellPrice

Syntax:
(objGetSellPrice spaceObject itemStruct)

Argument List:
spaceObject: The space object that you want to get the selling price of.
itemStruct: The itemStruct of the item that you want to get the price you can sell it at.

Returns:
number: The amount that this space object will buy the item for.

Category:
item, spaceObject

Description:
Finds the amount the space object would pay for the item.

Example:

Code: Select all

(objGetSellPrice gSource (itmCreate 0x4001 1))
Returns the price that it would buy a light titanium armor for the calling object.

Comment:
For the gplayership returns Nil. Also remember the sell in it means from the players point of view not the spaceobjects.
Crying is not a proper retort!
User avatar
Betelgeuse
Fleet Officer
Fleet Officer
Posts: 1920
Joined: Sun Mar 05, 2006 6:31 am

Name:
objGetShieldLevel

Syntax:
(objGetShieldLevel spaceObject)

Argument List:
spaceObject: The space object that you want to get the shield level of.

Returns:
number: The amount of shield left divided by the max amount of shield on the space object. Returns -1 if no shield is equipped.

Category:
spaceObject

Description:
Finds and returns the percent of shield remaining.

Example:

Code: Select all

(objGetShieldLevel gplayership)
Returns the percent of shield remaining.

Comment:
This is also a shortcut to see if the object has a shield equipped.
Crying is not a proper retort!
User avatar
Betelgeuse
Fleet Officer
Fleet Officer
Posts: 1920
Joined: Sun Mar 05, 2006 6:31 am

Name:
objGetSovereign

Syntax:
(objGetSovereign spaceObject)

Argument List:
spaceObject: The space object that you want to get the sovereign of.

Returns:
number: The UNID of the sovereign.

Category:
spaceObject

Description:
Finds and returns sovereign of the space object.

Example:

Code: Select all

(objGetSovereign gplayership)
Returns 4097.

Comment:
Basic space object function.
Crying is not a proper retort!
User avatar
Betelgeuse
Fleet Officer
Fleet Officer
Posts: 1920
Joined: Sun Mar 05, 2006 6:31 am

Name:
objGetStaticData

Syntax:
(objGetStaticData spaceObject string)

Argument List:
spaceObject: The space object of the type you want to get the static data from.
string: The name of the static data.

Returns:
data: The data from the xml named by the string from the space objects type.

Category:
spaceObject, data

Description:
Returns the data from the xml named by the string from whatever the space objects type is.

Example:

Comment:
Very useful function due to you can store things in the xml before hand and get them in code.
Crying is not a proper retort!
User avatar
Betelgeuse
Fleet Officer
Fleet Officer
Posts: 1920
Joined: Sun Mar 05, 2006 6:31 am

Name:
objGetStaticDataForStationType

Syntax:
(objGetStaticDataForStationType number string)

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

Returns:
data: The data from the xml named by the string from the space object type.

Category:
spaceObject, data

Description:
Returns the data from the xml named by the string from the space objects type.

Example:

Comment:
Just like objGetStaticData except it takes a UNID instead of a space object. Very useful function due to you can store things in the xml before hand and get them in code.
Crying is not a proper retort!
User avatar
Betelgeuse
Fleet Officer
Fleet Officer
Posts: 1920
Joined: Sun Mar 05, 2006 6:31 am

Name:
objGetTarget

Syntax:
(objGetTarget spaceObject)

Argument List:
spaceObject: The space object you want to get the current target of.

Returns:
spaceObject: The target of the space object.

Category:
spaceObject

Description:
Returns the target of the space object.

Example:

Code: Select all

(objGetTarget gsource)
Returns the target of the calling space object.

Comment:
Can be useful in case you want to do things by what the player is targeting.
Crying is not a proper retort!
Post Reply