function list

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

Name:
itmCreateByName

Syntax:
(itmCreateByName criteria string number)

Argument List:
criteria: the criteria that the item must meet.
string: the name or part of the name of an item.
number: the number of the item you want created.

Returns:
An itemStruct of an item that meets the criteria and has string as part of its name.

Category:
item

Description:
Makes a itemStruct of an item that meets the criteria and has string as part of its name with number of them. If more than one item meets the conditions it will pick one at random.

Example:

Code: Select all

(itmGetName (itmCreateByName "s" "generator" 1))
Returns one of the following at random Cydonian shield generator, Cydonian heavy shield generator, Kaidun shield generator, Solon shield generator, Nephren P25 shield generator, superconducting shield generator, Yoroi S100 shield generator, Yoroi S500 shield generator, Nephren B700 shield generator, Trenton field generator, Yoroi MX shield generator, plasma shield generator, Nephren X1 shield generator, or Lazarus shield generator.

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

Name:
itmCreateRandom

Syntax:
(itmCreateRandom criteria string)

Argument List:
criteria: The criteria of the item you want to create.
string: A formatted string with a series of 5 character parts separated by spaces each character represents the level of where its at. - means no chance the item will be this level. c means it is common for the item to be of this level. u means that it is uncommon for the item to be of this level. r means that it is rare for the item to be of this level.

Returns:
A itemStruct representing the randomly picked item.

Category:
item

Description:
Creates a random item matching the criteria and the string.

Example:

Code: Select all

(itmGetName (itmCreateRandom "s" "----- --c--"))
Returns the name of a random shield of level 8.

Comment:
Useful for creating a item at random.
Last edited by Betelgeuse on Fri Jan 18, 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:
itmEnumTypes

Syntax:
(itmEnumTypes criteria variable function)

Argument List:
criteria: The criteria an item must meet to be enum in this control structure.
variable: A variable that contains each item's that meets the criteria itemstruct.
function: The function you want to run for every item that meets the criteria.

Returns:
Whatever the last function run in it returns.

Category:
iteration, item

Description:
For each item that meets the criteria in the game run function with the item's itemstruct in the variable.

Example:

Code: Select all

(itmEnumTypes "s" itemType
	(dbgOutput (itmGetName itemType))
	)
This will display the name of every shield in the game.

Comment:
Useful if you want to go through all the items of a kind like in identifying 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:
itmGetActualPrice

Syntax:
(itmGetActualPrice itemStruct)

Argument List:
itemStruct: The itemStruct from what you want to get the real price from.

Returns:
number: The actual price of the object. It ignores the unknown price (like barrels before you use them all cost the same, this would see past that)

Category:
item

Description:
Returns the price of the object as if it is a known item.

Example:

Code: Select all

(itmGetActualPrice (itmCreate 0x4001))
This will return 20. Ok I know this isn't a helpful example but you can't use this function well in a simple example.

Comment:
Look at the Trading Post script for a real use of this 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:
itmGetArmorInstalledLocation

Syntax:
(itmGetArmorInstalledLocation itemStruct)

Argument List:
itemStruct: The itemStruct of the armor you want to know the location of.

Returns:
-1 one if not installed otherwise returns the segment number of where it is installed.

Category:
item, armor

Description:
Returns the location of the armor.

Example:

Code: Select all

(itmGetArmorInstalledLocation (scrGetItem gScreen))
Returns the location of the currently selected armor.

Comment:
Useful in working with armors. Such as repairing and enhancing armors.
Crying is not a proper retort!
User avatar
Betelgeuse
Fleet Officer
Fleet Officer
Posts: 1920
Joined: Sun Mar 05, 2006 6:31 am

Name:
itmGetCategory

Syntax:
(itmGetCategory itemStruct)

Argument List:
itemStruct: The item you want to know what kind of item it is.

Returns:
A flag number representing what kind of item it is.

Category:
item

Description:
Returns what kind of item it is.

Example:

Code: Select all

(itmGetCategory (itmCreate 0x4001 1))
Returns a 2.

Comment:
0x0002 is armor
0x0004 is weapon
0x0080 is shield
If someone knows the others it would be very helpful.
Also I have been using the hex numbers for itmCreate because if you want to use the debug console you have to use the numbers as it doesn't save the names in 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:
itmGetCharges

Syntax:
(itmGetCharges itemStruct)

Argument List:
itemStruct: The itemStruct of the item you want to get the charges from.

Returns:
The number of charges.

Category:
item

Description:
Returns the number of charges.

Example:

Code: Select all

(itmGetCharges gItem)
Returns the amount of charges on the invoking item.

Comment:
Useful in storing a number on an item. Look at the cash roms for an example of use.
Crying is not a proper retort!
User avatar
Ttech
Fleet Admiral
Fleet Admiral
Posts: 2767
Joined: Tue Nov 06, 2007 12:03 am
Location: Traveling in the TARDIS
Contact:

Hi,
Betelgeuse, I know you love increasing your post count. :P JK But do you wanto some space on a Wiki? I can set up one in 5 minutes and get you an account that way we can have this a bit more organized? : )
Image
Image
User avatar
Betelgeuse
Fleet Officer
Fleet Officer
Posts: 1920
Joined: Sun Mar 05, 2006 6:31 am

bimbel is already making something so no need. Plus I would like a way to get a offline version of it and I am not aware of wiki would support that.

as for my post count I am still number 3 in that regard.
Crying is not a proper retort!
User avatar
Ttech
Fleet Admiral
Fleet Admiral
Posts: 2767
Joined: Tue Nov 06, 2007 12:03 am
Location: Traveling in the TARDIS
Contact:

Betelgeuse wrote:bimbel is already making something so no need. Plus I would like a way to get a offline version of it and I am not aware of wiki would support that.

as for my post count I am still number 3 in that regard.
heh thats easy. :P Offline? YOu need a db system and a simple sync system to get the data from the db, the stuff you want - The posts.

YOur making me feel bad with post count. :P JK LOL
Image
Image
User avatar
Ttech
Fleet Admiral
Fleet Admiral
Posts: 2767
Joined: Tue Nov 06, 2007 12:03 am
Location: Traveling in the TARDIS
Contact:

Or do a db mirror system. :)
Image
Image
User avatar
Betelgeuse
Fleet Officer
Fleet Officer
Posts: 1920
Joined: Sun Mar 05, 2006 6:31 am

seems alot more complex than it needs to be. I just want some htm files in an archive. Asking people to set up this complex thing just for docs seems silly. While wiki is helpful with many things the thing bimbel is setting up will work better for the docs.
Crying is not a proper retort!
User avatar
Ttech
Fleet Admiral
Fleet Admiral
Posts: 2767
Joined: Tue Nov 06, 2007 12:03 am
Location: Traveling in the TARDIS
Contact:

Betelgeuse wrote:seems alot more complex than it needs to be. I just want some htm files in an archive. Asking people to set up this complex thing just for docs seems silly. While wiki is helpful with many things the thing bimbel is setting up will work better for the docs.


heh. Bibbel and I are going to wokr on that mod system. :P
I'm working on a similar poject htat requres DB stuff, so its simple for me to make an eays to use systme. :P
Image
Image
User avatar
bimbel
Militia Lieutenant
Militia Lieutenant
Posts: 181
Joined: Wed Jul 05, 2006 8:22 am
Location: Germany
Contact:

Ttech: it's neither bibble nor bimble :P
bimbel or bmbl please! And yeah we should speak first what features it should have and how we realise it so that we don't need to rework on it ;)
User avatar
Betelgeuse
Fleet Officer
Fleet Officer
Posts: 1920
Joined: Sun Mar 05, 2006 6:31 am

the docs or the mod prototype thing?

for the docs here is some things I would like

generate a page with links to all the functions that meet a filter
general pages so we can define general concepts or terms
comments on individual pages both general and functions
editing of pages through web interface for those with permission
a way of putting it all in a downloadable offline package that needs no extra installation to view (the comments don't need to be in there if that would be too much work)
A way to "highlight" code

The filter can filter by category (with logical operators if possible), argument types, return types, or full text search.

as for the mod prototype thing it will need to be reworked anyway due to its nature (you don't really realize what all you need until you start working with it).
Crying is not a proper retort!
Post Reply