function list stuff

Freeform discussion about anything related to modding Transcendence.
Post Reply
relanat
Militia Captain
Militia Captain
Posts: 941
Joined: Tue Nov 05, 2013 9:56 am

Might as well start a topic so anyone can post things they have seen regarding the function list in the one location.

Function list: 1.8b1

objChangeEquipmentStatus is missing 'TradingComputer as an equipment option.
-----------
typFind
Found in the changelog: thanks digdug.
(typFind): Added isEnemyOf:{unid} to typFind (for station types)

And NMS worked out the format to use.
"t +isEnemyOf:[sovereignUNID];"

--------------
The function list entry (- x) -> -x is prefixed with a space when it is printed to the debug log using AE-FunctionHelp. This is the only entry which has this. But none of the function list forum webpages have it!
From WordPad, but the space can also be seen in the debug log raw text.
[code]
(- x1 x2 ... xn) -> z
(- x) -> -x
(/ x y) -> x / y (real)
[/code]
EDIT: Can also be seen in the debug screen by entering "-" then "Tab".

-----------
unvFindObject now supports A and K station criteria as per sysFindObject.
------------
And many thanks to whoever is updating the function list. It is an excellent resource for modders now where before it was merely a list of functions. Well done.
Last edited by relanat on Wed Jun 19, 2019 5:52 am, edited 1 time in total.
Stupid code. Do what I want, not what I typed in!
giantcabbage
Militia Lieutenant
Militia Lieutenant
Posts: 104
Joined: Thu Apr 07, 2011 9:05 pm

I've made a PR for the changes here
relanat wrote:
Wed May 30, 2018 2:36 am
The function list entry (- x) -> -x is prefixed with a space when it is printed to the debug log using AE-FunctionHelp. This is the only entry which has this. But none of the function list forum webpages have it!
From WordPad, but the space can also be seen in the debug log raw text.
The (- x) entry is prefixed with a space in the help because it is actually part of the (- x1 x2) function help. It appears as a separate function in the forums list due to the way text is displayed in the forum - all the extra whitespace gets collapsed. This is also why all the sysFindObject criteria don't have any spaces before them.

I made a start at ways to convert the help text to other formats e.g. rst:
https://github.com/gcabbage/Transcenden ... n_list.rst

and a sphinx plugin:
https://gcabbage.github.io/TransDoc
https://gcabbage.github.io/TransDoc/aut ... bject.html

But those are a bit more effort than exporting a text file and pasting it into the forums!
relanat
Militia Captain
Militia Captain
Posts: 941
Joined: Tue Nov 05, 2013 9:56 am

giantcabbage wrote:
Wed May 30, 2018 5:46 pm
But those are a bit more effort than exporting a text file and pasting it into the forums!
Yes but definitely worth it. They look great. Much easier to read.
Nice work.
Stupid code. Do what I want, not what I typed in!
relanat
Militia Captain
Militia Captain
Posts: 941
Joined: Tue Nov 05, 2013 9:56 am

It might be worthwhile adding string to the 'subset' function help somehow.
(subset string pos [count]) -> string
I'm not sure if this is technically different to lists but it would help new modders IMO.

It currently only mentions lists.
(subset list pos [count]) -> list

====================
minor: 3 examples of Hp --> HP
It seems the convention is to capitalize HP if it is attached to the end of a term.
Lower case is for 'hp' on its own or prefixing a term; eg 'hpBonus or hpToRepair.

objGetProperty...
property (ships)...
'maxHp

typGetDataField...
field (shields):
'adjustedHp
...
'effectiveHp
=====================
From the API 30 Ministry page

sysFindObject
API 30 now honors the directives in sysFindObject for projectiles. In all cases, this
only works when combined with the m directive, which selects projectiles.
⦁ The H directive includes only projectiles fired by the source object.
⦁ The A directive includes only active projectiles. It excludes any projectile that is dead but painting its fade-out animation.
⦁ The X directive includes only projectiles whose target is the source object.

I've not had anything to do with projectiles but this might be information that is needed by new modders.
Possibly this level of information would be better on the wiki, which I haven't got time to check, (but when I had a quick look a couple of weeks ago I was very impressed by the amount of updating and expanding that has occurred, well done to those involved) rather than in the function list.
Stupid code. Do what I want, not what I typed in!
relanat
Militia Captain
Militia Captain
Posts: 941
Joined: Tue Nov 05, 2013 9:56 am

'shpEnhanceItem' doesn't return True/Nil as indicated in the function list.
It returns a number, 0-7, which as far as I can determine depends on the result of the enhancement. And this number varies depending on the option [mods] as well.

The texts used in 'intItemEnhanceStatus' give an indicator of what the result was.
Stupid code. Do what I want, not what I typed in!
relanat
Militia Captain
Militia Captain
Posts: 941
Joined: Tue Nov 05, 2013 9:56 am

1.8b3.3 (or thereabouts)

(dbgOutput [string]*) -> True if in debug mode, else Nil

It would be helpful if the function help explained that this only prints to the console.

----------------------------------
Could add the 0-359 values to objGetDestiny.

(objGetProperty obj 'destiny)

'destiny -> 0-359

---------------------------------
objRemoveItem could have
"options as objHasItem"

added (if they are the same?).

--------------------------------
Extra capital. This only shows in the function help, not in the debug hotkey fill-in.

sysSetKNown
->
sysSetKnown
Stupid code. Do what I want, not what I typed in!
relanat
Militia Captain
Militia Captain
Posts: 941
Joined: Tue Nov 05, 2013 9:56 am

1.8b3.3
'itmGetProperty'

needs property 'unknownType' added.


==========================
'ItmSetProperty'

The 'level' property needs a line break.
It currently shows on the same line as 'installed'.

Code: Select all

(itmSetProperty item property value) -> item

property

   'charges charges
   'damaged [True|Nil]
   'disrupted [True|Nil|ticks]
   'incCharges charges
   'installed [True|Nil]   'level level
Stupid code. Do what I want, not what I typed in!
relanat
Militia Captain
Militia Captain
Posts: 941
Joined: Tue Nov 05, 2013 9:56 am

Could probably add
(@ struct) -> list of keys

It is mentioned further down but would be helpful if shown in the actual function list.

(Seriously, I had this down as a post before I read the PM :lol: ).
Stupid code. Do what I want, not what I typed in!
relanat
Militia Captain
Militia Captain
Posts: 941
Joined: Tue Nov 05, 2013 9:56 am

1.8.2

Formatting:
'itmGetProperty' has an extra tab in front of 'shipCounterPerSlot' in the 'weapon' section.

Additions:
'objSetProperty' now has a 'fuelLeft' property. Seen in 'Benedict06.xml'. I didn't realize this was settable. Using '(objSetProperty theShip 'fuelLeft (objGetProperty theShip 'maxFuel)' is much easier than using 'shpRefuelFromItem'!

Not implemented in 1.8.2 but 'unvFindObject' has a 'P' criteria in 1.9a1. Selects 'known to player' objects.
Stupid code. Do what I want, not what I typed in!
Post Reply