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

Syntax:
(shpAddEnergyField ship number number)

Argument List:
ship: The ship that is using the energy field.
number: The UNID of the energy field.
number: How long in ticks the energy field will last.

Returns:
condition: True is successful.

Category:
ship

Description:
Puts the given energy field on the given ship for the given amount of time.

Example:

Code: Select all

(shpAddEnergyField gplayership &sfStrengthen; 600)
Puts the strengthen energy field on the player ship for 600 ticks.

Comment:
Interesting function. Would be more interesting if ShipEnergyFieldType had more attributes.
Crying is not a proper retort!
User avatar
Betelgeuse
Fleet Officer
Fleet Officer
Posts: 1920
Joined: Sun Mar 05, 2006 6:31 am

Name:
shpCancelOrders

Syntax:
(shpCancelOrders ship)

Argument List:
ship: The ship that you want to cancel the orders of.

Returns:
condition: True is successful.

Category:
ship, orders

Description:
Removes any orders the ship currently has.

Example:

Code: Select all

(shpCancelOrders gPlayerShip)
Removes any orders for the player ship. Orders for the play ship come in the form of those green arrows.

Comment:
To be done before giving new orders.
Crying is not a proper retort!
User avatar
Betelgeuse
Fleet Officer
Fleet Officer
Posts: 1920
Joined: Sun Mar 05, 2006 6:31 am

Name:
shpCanInstallArmor

Syntax:
(shpCanInstallArmor ship itemStruct)

Argument List:
ship: The ship that you want to see if it can equip the armor.
itemStruct: The armor you want to see if it can be equipped.

Returns:
number: 1 if the armor is to heavy, 0 if it can be installed.

Category:
ship

Description:
Checks to see if the ship can install that armor.

Example:

Code: Select all

(shpCanInstallArmor gPlayerShip (itmCreate 0x4001 1))
Returns 0 because all player ships can install light titanium armor.

Comment:
Returns a number instead of a condition to allow for reasons why it can not install the 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:
shpCanInstallDevice

Syntax:
(shpCanInstallDevice ship itemStruct)

Argument List:
ship: The ship that you want to see if it can equip the device.
itemStruct: The device you want to see if it can be equipped.

Returns:
number: 0 if it can be installed, 2 the ship can not support any more devices, 4 can install will also remove shield, 5 can install will also remove drive, 6 can install will also remove missile launcher, 7 can not reactor not powerful enough, 8 can not install already have a cargo hold, 9 can install will also remove reactor, 10 can not install cargo expansion to large for the ship, 11 can not install creator too powerful, 12 can not install too many weapons, 13 can not install too many non weapons.

Category:
ship

Description:
Checks to see if the ship can install that device.

Example:

Comment:
Returns a number instead of a condition to allow for reasons why it can not install the device.
Crying is not a proper retort!
User avatar
Betelgeuse
Fleet Officer
Fleet Officer
Posts: 1920
Joined: Sun Mar 05, 2006 6:31 am

Name:
shpCanRemoveDevice

Syntax:
(shpCanRemoveDevice ship itemStruct)

Argument List:
ship: The ship that you want to see if it can remove the device.
itemStruct: The device you want to see if it can be removed.

Returns:
number: 1 if removing the device would cause the cargo hold to become too small, 0 if it can be removed.

Category:
ship

Description:
Checks to see if the ship can remove that device.

Example:

Comment:
Returns a number instead of a condition to allow for reasons why it can not remove the device.
Crying is not a proper retort!
User avatar
Betelgeuse
Fleet Officer
Fleet Officer
Posts: 1920
Joined: Sun Mar 05, 2006 6:31 am

Name:
shpConsumeFuel

Syntax:
(shpConsumeFuel ship number)

Argument List:
ship: The ship that you want to remove fuel from.
number: How much fuel you want to remove.

Returns:
number: Fuel remaining.

Category:
ship

Description:
Removes the given amount of fuel from the ship.

Example:

Code: Select all

(shpConsumeFuel gplayership 0)
Returns how much fuel the player has left.

Comment:
Useful for creating items that cost fuel per use.
Last edited by Betelgeuse on Sat Jan 19, 2008 2:09 am, 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:
shpDamageArmor

Syntax:
(shpDamageArmor ship number number number)

Argument List:
ship: The ship that you want to damage an armor segment on.
number: Where on the ship the armor segment is.
number: The damage type.
number: The amount of damage.

Returns:
condition: True is successful.

Category:
ship, armor

Description:
Damages the armor with the given damage and damage type.

Example:

Code: Select all

(shpDamageArmor gplayership 0 0 1)
Does one point of kinetic damage to the players forward armor.

Comment:
Very nice function for damaging armor in code. Would be nice if you could do this with shields too.
Crying is not a proper retort!
User avatar
Betelgeuse
Fleet Officer
Fleet Officer
Posts: 1920
Joined: Sun Mar 05, 2006 6:31 am

Name:
shpDamageItem

Syntax:
(shpDamageItem ship itemListCursor)

Argument List:
ship: The ship that you want to damage an item in.
itemListCursor: Where on the ship the item is.

Returns:
condition: True is successful.

Category:
ship, item

Description:
Damages the item pointed to by the itemListCursor.

Example:

Comment:
Revenge of the item list cursor. Makes it hard to make an item that can damage itself when used.
Crying is not a proper retort!
User avatar
Betelgeuse
Fleet Officer
Fleet Officer
Posts: 1920
Joined: Sun Mar 05, 2006 6:31 am

Name:
shpDecontaminate

Syntax:
(shpDecontaminate ship)

Argument List:
ship: The ship that you want to decontaminate.

Returns:
condition: True is successful.

Category:
ship

Description:
Removes any radiation from the given ship.

Example:

Code: Select all

(shpDecontaminate gplayership)
Decontaminates the player ship.

Comment:
Limited use but still interesting for a chance type 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:
shpEnhanceItem

Syntax:
(shpEnhanceItem ship itemListCursor [number])

Argument List:
ship: The ship that you want to enhance an item in.
itemListCursor: Where on the ship the item is.
number: The enhance code.

Returns:
condition: True is successful.

Category:
ship, item

Description:
Enhances the pointed at item.

Example:

Comment:
* enhanceCodes (always starts with 0x*Value*, e.g. 0x0101):
* 010X For enhancing hitpoint; 10% hp multiplied with X (e.g., 0101 = +10% hp, 0102 = +20% hp, etc.)
* 810X for reducing hitpoints;-10% hp multiplied with X (e.g., 8101 = -10% hp, 8102 = -20% hp, etc.)
* 0200 Regenerate (like Duralloy, only applies to armor)
* 8200 Decay (like Transuranic, only applies to armor)
* 03YX Reflect damage type Y with X effectiveness (X{effectiveness} starts with 0=50% and rises in 5% steps; Y{dam type} is listed further down)
* 83Y0 Transparency to damage Y, applies only to shields (e.g., 8300 = shield does not absorb laser damage, 8310 = shield does not reflect kinetic damage).
* 050X reduce damage to armor/shield (e.g., 0500 = armor/shield takes 100% of damage; 0501 = 90% of damage; 0502 = 80% of damage, etc.)
* 850X enhance damage to armor/shield (e.g., 8500 = armor/shield takes 100% of damage; 8501 = 111% damage; 8502 = 125% damage; 8503 = 143% damage, etc.)
* 060X reduce ENERGY damage (e.g., laser, particle, etc.). % is same as 050X.
* 860X enhance ENERGY damage. % is same as 850X.
* 070X reduce MATTER damage (e.g., kinetic, blast, etc.). % is same as 050X.
* 870X enhance MATTER damage. % is same as 850X.
* 08YX reduce damage when damage is of type Y or of type Y+1. For example, 080X adjusts damage to armor/shield when hit by either laser or kinetic damage. % is same as 050X.
* 88YX enhance damage when damage is of type Y or of type Y+1. % is same as 850X.
* 09YX reduce damage when damage is of type Y (e.g., 0901 = armor/shield takes 90% damage from laser; 0911 = armor/shield takes 90% damage from kinetic). % is same as 050X.
* 89YX enhance damage when damage is of type Y. % is same as 850X.
* 0AYX reduce damage with % same as 050X. If damage is of type Y+2, adjusts damage with % equal to 1.5 times 050X. (e.g., 0A05: For laser damage, adjustment is 50%; for particle damage, adjustment is 75%.)
* 8AYX If damage is of type Y, enhance damage with % same as 050X. If damage is of type Y+2, adjusts damage with % equal to 1.5 times 850X.
* 0B00 Armor is immune to radiation.
* 0B10 Armor is immune to blinding.
* 0B20 Armor is immune to EMP.
* 0B30 Armor is immune to device damage.
* 0B40 Armor is immune to disintegration.
* 0C00 Armor is immune to blinding/EMP/device damage.
* 8C00 Armor interferes with shields (like meteorsteel) - no shields.
* 0D00 Armor regenerates near sun - solar regeneration.
* 0E00 Armor refuels reactor near sun - solar power.
* 0F0X Shield consumes less power (X values: 0=100%, 1=90% etc. of original value).
* 8F0X Shield consumes more power (8F00 = shield consumes 100% of rated power, 8F01 = consumes 111% of rated power, 8F02 = consumes 125% of rated power, 8F03 = consumes 143% of rated power).
* Reducing: changes by 10% -> x/% 0/100 1/90 2/80 3/70 4/60 5/50 6/40 7/30 8/20 9/10 (A/0?)
* Enhancing: changes by ??? -> x/% 0/100 1/111 2/125 3/143 4/ 5/ 6/ 7/ 8/ 9/ (A/)
Crying is not a proper retort!
User avatar
Betelgeuse
Fleet Officer
Fleet Officer
Posts: 1920
Joined: Sun Mar 05, 2006 6:31 am

Name:
shpEnhanceSRS

Syntax:
(shpEnhanceSRS ship)

Argument List:
ship: The ship that you want to enhance the visual display.

Returns:
condition: True is successful.

Category:
ship

Description:
Enhances the visual display of the ship.

Example:

Code: Select all

(shpEnhanceSRS gplayership)
Enhances the visual display of the player ship.

Comment:
Limited use but still interesting for a chance type 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:
shpFixBlindness

Syntax:
(shpFixBlindness ship)

Argument List:
ship: The ship that you want to fix the visual display.

Returns:
condition: True is successful.

Category:
ship

Description:
Fixes the visual display of the ship.

Example:

Code: Select all

(shpFixBlindness gplayership)
Fixes the visual display of the player ship.

Comment:
Limited use but still interesting for a chance type 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:
shpGetArmor

Syntax:
(shpGetArmor ship number)

Argument List:
ship: The ship that you want to get the armor from.
number: Where on the ship you want to get the armor from.

Returns:
itemStruct: The item struct of the armor.

Category:
ship, armor

Description:
Returns what armor the ship is equipped with at the given location.

Example:

Code: Select all

(shpGetArmor gplayership 0)
Returns an item struct of the forward armor.

Comment:
Useful for testing various things about the ships 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:
shpGetArmorCount

Syntax:
(shpGetArmorCount ship)

Argument List:
ship: The ship that you want to get how many segments of armor it has.

Returns:
number: The number of segments of armor that the ship has.

Category:
ship, armor

Description:
Returns how many segments of armor the ship has.

Example:

Code: Select all

(shpGetArmorCount gplayership)
Returns 4 for the vanilla ships.

Comment:
Useful for fors that iterate over a ships 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:
shpGetArmorMaxHitPoints

Syntax:
(shpGetArmorMaxHitPoints ship number)

Argument List:
ship: The ship that you want to get what the max hp of the segment of armor is.
number: Where on the ship the armor you want to get the max hp of.

Returns:
number: The max hp of the specified armor.

Category:
ship, armor

Description:
Returns how many hp the given armor of the ship has.

Example:

Comment:
Useful for repairing armor or doing damage proportional to the max hp of the armor.
Crying is not a proper retort!
Post Reply