function list stuff

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

Wed May 30, 2018 2:36 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: Select all

(- x1 x2 ... xn) -> z
 (- x) -> -x
(/ x y) -> x / y (real)
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.

giantcabbage
Commonwealth Pilot
Commonwealth Pilot
Posts: 94
Joined: Thu Apr 07, 2011 9:05 pm

Wed May 30, 2018 5:46 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: 575
Joined: Tue Nov 05, 2013 9:56 am

Mon Jun 04, 2018 2:21 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.

relanat
Militia Captain
Militia Captain
Posts: 575
Joined: Tue Nov 05, 2013 9:56 am

Mon Jun 18, 2018 3:49 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.

relanat
Militia Captain
Militia Captain
Posts: 575
Joined: Tue Nov 05, 2013 9:56 am

Fri Jul 13, 2018 12:00 pm

'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.

Post Reply