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

Syntax:
(objAddRandomItems spaceObject itemTable number)

Argument List:
spaceObject: The space object that you want to add the items to.
itemTable: The table where you want to get the items from.
number: A number of times you want to get an item from the itemTable.

Returns:
True.

Category:
item, spaceObject

Description:
Adds items to the space object according to the itemTable number of times.

Example:

Code: Select all

(objAddRandomItems gplayership &trMinorItem6; 3)
Adds three random items to the gplayership according to the table &trMinorItem6;

Comment:
Very helpful function for adding random items to a space object from 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:
objAddSubordinate

Syntax:
(objAddSubordinate spaceObject ship)

Argument List:
spaceObject: The space object that you want to add the subordinate too.
ship: The ship that you want to make subordinate to the spaceObject.

Returns:
True if successful, Nil otherwise (like if the spaceObject is destroyed).

Category:
ship, spaceObject

Description:
Makes the ship a subordinate to the space object.

Example:

Comment:
To be used with staGetSubordinates. I am not sure of the exact nature of subordinates.
Crying is not a proper retort!
User avatar
Betelgeuse
Fleet Officer
Fleet Officer
Posts: 1920
Joined: Sun Mar 05, 2006 6:31 am

Name:
objCharge

Syntax:
(objCharge spaceObject number)

Argument List:
spaceObject: The space object that you want to take credits away from.
number: The amount of credits you want to remove.

Returns:
True if successful.

Category:
spaceObject

Description:
Takes credits away from the the obj.

Example:

Code: Select all

(objCharge gSource 200)
Removes 200 credits from whatever gSource is bound too.

Comment:
Useful with working with the credits of stations. The player's credits are not bound to the player's 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:
objCredit

Syntax:
(objCredit spaceObject number)

Argument List:
spaceObject: The space object that you want to give credits too.
number: The amount of credits you want to give.

Returns:
True if successful.

Category:
spaceObject

Description:
Gives credits to the the obj.

Example:

Code: Select all

(objCredit gSource 200)
Gives 200 credits from whatever gSource is bound too.

Comment:
Useful with working with the credits of stations. The player's credits are not bound to the player's 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:
objIsKnown

Syntax:
(objIsKnown spaceObject)

Argument List:
spaceObject: The space object that you want have known.

Returns:
True if the space object is known, Nil otherwise.

Category:
spaceObject, query

Description:
Query function asking if the space object is known, the object can be known by objSetKnown, seeing it onscreen, or targeting it.

Example:

Code: Select all

(objIsKnown gSource)
Returns true if the player has already discovered this space object.

Comment:
Helpful for checking if the player already knows about an 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:
objCommunicate

Syntax:
(objIsKnown spaceObject spaceObject number [spaceObject])

Argument List:
spaceObject: The space object that is sent the message.
spaceObject: The space object that sent the message.
number: The code of the message.
spaceObject: An optional space Object target needed by some codes.

Returns:
True.

Category:
spaceObject

Description:
A function that allows spaceobject to communicate and give orders to autons.

Example:

Code: Select all

(objCommunicate gSource gplayership 14)
Tells the gSource auton that was communicated with by gplayership to wait.

Comment:
Only used with autons. Is not used with wing men.
Crying is not a proper retort!
User avatar
Betelgeuse
Fleet Officer
Fleet Officer
Posts: 1920
Joined: Sun Mar 05, 2006 6:31 am

Name:
objDepleteShields

Syntax:
(objDepleteShields spaceObject)

Argument List:
spaceObject: The space object that you want to disable the shields of.

Returns:
True.

Category:
spaceObject

Description:
A function that disables the shields of the spaceObject.

Example:

Code: Select all

(objDepleteShields gplayership)
Disables the players shields.

Comment:
Used in gem of sacrifice.
Crying is not a proper retort!
User avatar
Betelgeuse
Fleet Officer
Fleet Officer
Posts: 1920
Joined: Sun Mar 05, 2006 6:31 am

Name:
objDestroy

Syntax:
(objDestroy spaceObject)

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

Returns:
True if successful, Nil otherwise.

Category:
spaceObject

Description:
Removes the spaceobject from the game.

Example:

Code: Select all

(objDestroy gSource)
Gets rid of the calling spaceObject. This works fine.

Comment:
Can not be used with the player 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:
objEnumItems

Syntax:
(objEnumItems spaceObject criteria variable function)

Argument List:
spaceObject: The space object that to go through the items from.
criteria: The criteria of the items you want from the space object.
variable: A variable to hold the item list pointer.
function: The function you want to run for each of the items in the space object matching the criteria.

Returns:
Whatever the last run function in this returns.

Category:
item, spaceObject, iteration

Description:
Iterates through the items in the space object that match the criteria. With the variable holding the item list pointer for the current item.

Example:

Code: Select all

(objEnumItems gplayership "wI" itmPointer
	(dbgOutput (itmGetName (itmAtCursor itmPointer) 0))
	)
Outputs all the installed weapons of the players ship to the debug console.

Comment:
Like all iteration functions very helpful in walking through something. In this case it is through the item list of a space object.
Last edited by Betelgeuse on Fri Dec 28, 2007 5:48 am, edited 2 times 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:
objFireEvent

Syntax:
(objFireEvent spaceObject string)

Argument List:
spaceObject: The space object that to run the event of.
string: The name of the event you want to run.

Returns:
Whatever the last run function of the event returns. Nil if the event doesn't exist.

Category:
spaceObject, event

Description:
Runs the event named by string in the space object. Then returns whatever the event returns.

Example:

Code: Select all

(objFireEvent gplayerShip "testEvent")
Trys to run the event testEvent in the player ship. If it doesn't exist (like for non modded ships) returns Nil.

Comment:
Useful for running events from in code. Like you can run oncreate at a later time. It is also nice do to most events lose what they return with this you can get it.
Crying is not a proper retort!
User avatar
Betelgeuse
Fleet Officer
Fleet Officer
Posts: 1920
Joined: Sun Mar 05, 2006 6:31 am

Name:
objGateTo

Syntax:
(objGateTo spaceObject string string UNID)

Argument List:
spaceObject: The space object that to gate somewhere.
string: The node id of the system you are gating too.
string: The label in the system where you want to go to.
UNID: The gfx effect you want to happen when you gate.

Returns:
True.

Category:
spaceObject

Description:
Gates the spaceobject to whatever system you want.

Example:

Code: Select all

(objGateTo gplayerShip "Elysium" "Start" &efStargateOut;)
Gates the player ship to elysium and puts the ship at the start label.

Comment:
Fairly obvious function but can be used to mimic stargates.
Crying is not a proper retort!
User avatar
Betelgeuse
Fleet Officer
Fleet Officer
Posts: 1920
Joined: Sun Mar 05, 2006 6:31 am

Name:
objGetArmorDamage

Syntax:
(objGetArmorDamage spaceObject number)

Argument List:
spaceObject: The space object that you want to get the damage of the armor from.
number: The segment number of the armor of the space object from what you want to get the damaged from.

Returns:
number: The amount of damage the armor has.

Category:
armor, spaceObject

Description:
Returns the amount of damage on the armor segment on the space object.

Example:

Code: Select all

(objGetArmorDamage gPlayerShip 0)
Returns the amount of damage on the forward armor.

Comment:
Basic function for getting the armor damage from a space object.
Last edited by Betelgeuse on Sat Jan 19, 2008 10:24 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:
objGetArmorName

Syntax:
(objGetArmorName spaceObject number)

Argument List:
spaceObject: The space object that you want to get the name of the segment of.
number: The segment number that you want to get the name of.

Returns:
string: The name of the segment.

Category:
armor, spaceObject

Description:
Returns the name of the segment.

Example:

Code: Select all

(objGetArmorName gPlayerShip 0)
Returns the string forward.

Comment:
A bit misleading name but it basically just gets the armor sections name. Maybe objGetArmorSectionName would work better.
Crying is not a proper retort!
User avatar
Betelgeuse
Fleet Officer
Fleet Officer
Posts: 1920
Joined: Sun Mar 05, 2006 6:31 am

Name:
objGetArmorType

Syntax:
(objGetArmorType spaceObject number)

Argument List:
spaceObject: The space object that you want to get the type of armor from.
number: The segment number that you want to get the name of.

Returns:
ArmorType: The armor type of the armor at that segment.

Category:
armor, spaceObject

Description:
Returns the armortype of the armor segment.

Example:

Code: Select all

(objGetArmorType gPlayerShip 0)
Returns the armor type of the player ships forward armor.

Comment:
Evil function that will hopefully will be fazed out.
Crying is not a proper retort!
User avatar
Betelgeuse
Fleet Officer
Fleet Officer
Posts: 1920
Joined: Sun Mar 05, 2006 6:31 am

Name:
objGetBalance

Syntax:
(objGetBalance spaceObject)

Argument List:
spaceObject: The space object that you want to get the amount of credits from.

Returns:
number: The amount of credits that the space object has.

Category:
spaceObject

Description:
Returns the amount of credits the space object has.

Example:

Code: Select all

(objGetBalance gsource)
Returns the amount of credits that the caller has.

Comment:
Useful function but be aware that the players credits are not tied to the player's ship.
Crying is not a proper retort!
Post Reply