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

Syntax:
(objRemoveItem spaceObject itemStruct [number])

Argument List:
spaceObject: The space object you want to remove an item from.
itemStruct: The item you want to remove from the object.
[number]: The optional number of items you want to remove.

Returns:
True if successful.

Category:
spaceObject, item

Description:
Removes the number of items (defaults to whatever is in the itemStruct) from the space object.

Example:

Code: Select all

(objRemoveItem gPlayerShip (itmCreate &itLongzhuSphere; 1))
Removes a Longzhu Sphere from the player ship and returns if it could do it.

Comment:
Very useful function for removing used up items or faking a switchable item.
Crying is not a proper retort!
User avatar
Betelgeuse
Fleet Officer
Fleet Officer
Posts: 1920
Joined: Sun Mar 05, 2006 6:31 am

Name:
objRepairArmor

Syntax:
(objRemoveItem spaceObject number [number])

Argument List:
spaceObject: The space object you want to repair some armor of.
number: Where on the space object you want to repair the armor on.
[number]: The optional number of the amount you want to repair. If not given repairs for full.

Returns:
True if successful.

Category:
spaceObject

Description:
Repairs the armor at the given spot for other optionally given amount.

Example:

Code: Select all

(objRemoveItem gPlayerShip 0)
Repairs the forward armor fully.

Comment:
Would love an armor equipping function that acts just like this one. It is nice and simple and fully able to be done within the 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:
objSendMessage

Syntax:
(objSendMessage spaceObject spaceObject string)

Argument List:
spaceObject: The space object you want to send the message to.
spaceObject: The space object you want to send the message from.
string: The message.

Returns:
True if successful.

Category:
spaceObject

Description:
Sends a message from space object two to space object one.

Example:

Code: Select all

(objSendMessage gPlayerShip Nil "Success")
Displays Success if the player is in fight.

Comment:
I am not sure if there is any way to tell if a space object has received a message.
Crying is not a proper retort!
User avatar
Betelgeuse
Fleet Officer
Fleet Officer
Posts: 1920
Joined: Sun Mar 05, 2006 6:31 am

Name:
objSetData

Syntax:
(objSetData spaceObject string expression)

Argument List:
spaceObject: The space object you want to set data in.
string: The name of the data.
expression: Can be anything except a pointer or a list containing pointers.

Returns:
True if successful.

Category:
spaceObject

Description:
Sets the data named by the string to whatever the expression is in the space object.

Example:

Code: Select all

(objSetData gPlayerShip "rins" 0)
Sets the rins of the player to 0.

Comment:
Very helpful function in storing data on a space object. Be careful on not storing any objects or pointers or lists containing them.
Crying is not a proper retort!
User avatar
Betelgeuse
Fleet Officer
Fleet Officer
Posts: 1920
Joined: Sun Mar 05, 2006 6:31 am

Name:
objSetGlobalData

Syntax:
(objSetGlobalData spaceObject string expression)

Argument List:
spaceObject: The space object of the type you want to set data in.
string: The name of the data.
expression: Can be anything except a pointer or a list containing pointers.

Returns:
True if successful.

Category:
spaceObject

Description:
Sets the data named by the string to whatever the expression is in the space object of the type you want it in.

Example:

Comment:
Very helpful function in storing data on a space object of the type you want it in. Be careful on not storing any objects or pointers or lists containing them.
Crying is not a proper retort!
User avatar
Betelgeuse
Fleet Officer
Fleet Officer
Posts: 1920
Joined: Sun Mar 05, 2006 6:31 am

Name:
objSetKnown

Syntax:
(objSetKnown spaceObject)

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

Returns:
True if successful.

Category:
spaceObject

Description:
Sets the space object known.

Example:

Code: Select all

(objSetKnown gSource)
Sets the calling space object known.

Comment:
Helpful for making things known in code.
Last edited by Betelgeuse on Sat Jan 19, 2008 10:20 pm, 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:
objSetName

Syntax:
(objSetName spaceObject string)

Argument List:
spaceObject: The space object that you want to rename.
string: The new name.

Returns:
True if successful.

Category:
spaceObject

Description:
Renames the space object with whatever the string is.

Example:

Code: Select all

(objSetName gplayership "Betel")
Sets the players ship name to Betel.

Comment:
More helpful in changing map labels due to they work on names.
Crying is not a proper retort!
User avatar
Betelgeuse
Fleet Officer
Fleet Officer
Posts: 1920
Joined: Sun Mar 05, 2006 6:31 am

Name:
objSetSovereign

Syntax:
(objSetSovereign spaceObject number)

Argument List:
spaceObject: The space object that you want to change the sovereign of.
number: The UNID of the sovereign you want to set the space objects sovereign to.

Returns:
True if successful.

Category:
spaceObject

Description:
Sets the space object's sovereign to the sovereign referenced by the UNID.

Example:

Code: Select all

(objSetSovereign gSource &svIndependent;)
Sets the calling space object's sovereign to svIndependent. (basically friendly independent merchant)

Comment:
Helpful function that allows you to change the ai of the 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:
objUnregisterForEvents

Syntax:
(objUnregisterForEvents spaceObject spaceObject)

Argument List:
spaceObject: The space object that you want to stop getting messages to.
spaceObject: The space object that you want to stop getting messages from.

Returns:
True if successful.

Category:
spaceObject

Description:
Causes the first space object to stop receiving events generated by second space object.

Example:

Comment:
Stops the events that where caused by objRegisterForEvents.
Crying is not a proper retort!
User avatar
Betelgeuse
Fleet Officer
Fleet Officer
Posts: 1920
Joined: Sun Mar 05, 2006 6:31 am

Name:
or

Syntax:
(or [condition]^1)

Argument List:
[condition]: Something other than Nil or Nil
^1

Returns:
condition: the result of oring all of the conditions

Category:
Logical

Description:
Returns True if any the conditions are not Nil otherwise returns Nil.

Example:

Code: Select all

(block (someCondition) 
	(setq someCondition True)
	(or someCondition Nil)
	)
This will return a True.

Comment:
Logical functions are very important in if and while functions.
Crying is not a proper retort!
User avatar
Betelgeuse
Fleet Officer
Fleet Officer
Posts: 1920
Joined: Sun Mar 05, 2006 6:31 am

heh seems I went a bit crazy today. If anyone has anything they want to point out, things that are not clear, things that are wrong, even typos please please please tell me.
Crying is not a proper retort!
User avatar
Betelgeuse
Fleet Officer
Fleet Officer
Posts: 1920
Joined: Sun Mar 05, 2006 6:31 am

Name:
unvGetTick

Syntax:
(unvGetTick)

Argument List:

Returns:
number: The number of ticks since the game has started.

Category:
time

Description:
Returns how many ticks since that game was started.

Example:

Code: Select all

(unvGetTick)
This will return how many ticks since the game.

Comment:
Useful for telling how long between two functions have been run.
Crying is not a proper retort!
User avatar
Betelgeuse
Fleet Officer
Fleet Officer
Posts: 1920
Joined: Sun Mar 05, 2006 6:31 am

Name:
plyCharge

Syntax:
(plyCharge player number)

Argument List:
player: The player.
number: The number of credits to charge.

Returns:
number: The number of credits left.

Category:
player

Description:
Charges the player the given number of credits and returns how much the player has left.

Example:

Code: Select all

(plyCharge gplayer 1)
Charges the player one credit and returns how many credits the player has left.

Comment:
Basic credit manipulation 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:
plyCredit

Syntax:
(plyCredit player number)

Argument List:
player: The player.
number: The number of credits to credit.

Returns:
number: The number of credits left.

Category:
player

Description:
Credits the player the given number of credits and returns how much the player has left.

Example:

Code: Select all

(plyCredit gplayer 1)
Credits the player one credit and returns how many credits the player has left.

Comment:
Basic credit manipulation 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:
plyClearShowHelpRefuel

Syntax:
(plyClearShowHelpRefuel player)

Argument List:
player: The player.

Returns:
True if successful.

Category:
player, help

Description:
Stops the help message showing when the players fuel gets low.

Example:

Comment:
It would be nice to be able to turn off the other kinds of help messages like the jump message.
Crying is not a proper retort!
Post Reply