[George] Function Explanations

Freeform discussion about anything related to modding Transcendence.
Post Reply
RPC
Fleet Admiral
Fleet Admiral
Posts: 2876
Joined: Thu Feb 03, 2011 5:21 am
Location: Hmm... I'm confused. Anybody have a starmap to the Core?

(objGetArmorCriticality obj item|armorSegment) -> criticalityType
(objGetFitCount ...)
(typMarkImages unid) -> True/Nil
George: can you explain what those do? (and for ObjGetFitCount, what args?)
I looked on trac for objGetArmorCriticality the returns are just Critical/NonCritical. Will there be more criticality types?
TypMarkImages... loads images? o.O
Tutorial List on the Wiki and Installing Mods
Get on Discord for mod help and general chat
Image
Image
Der Tod ist der zeitlose Frieden und das leben ist der Krieg
Wir müssen wissen — wir werden wissen!
I don't want any sort of copyright on my Transcendence mods. Feel free to take/modify whatever you want.
george moromisato
Developer
Developer
Posts: 2998
Joined: Thu Jul 24, 2003 9:53 pm
Contact:

RPC wrote:(objGetArmorCriticality obj item|armorSegment) -> criticalityType
(objGetFitCount ...)
(typMarkImages unid) -> True/Nil
George: can you explain what those do? (and for ObjGetFitCount, what args?)
I looked on trac for objGetArmorCriticality the returns are just Critical/NonCritical. Will there be more criticality types?
TypMarkImages... loads images? o.O
objGetArmorCriticality: critical/nonCritical are the only two values returned (they are the only two values that make a difference).

objGetFitCount: This is implemented inside Code.xml (there is a comment there):

(objGetFitCount obj item) -> number of items that will fit in given obj.

typMarkImages: (Bad name, I know). This take any unid and loads any images needed by the unid. For example, if you have a station and you know that the station is later going to create 100 different ship classes, then you can call typMarkImages on all those ship classes in the station's OnCreate. This will force the engine to load the images at create time instead of later (when it might interrupt the game). Note that the engine already figures out what images to load based on what it creates in the system, but it can't tell if you're going to create something with script later.
User avatar
Atarlost
Fleet Admiral
Fleet Admiral
Posts: 2391
Joined: Tue Aug 26, 2008 12:02 am

With criticality available in script the other criticality values could make a difference if the scripter wanted them to. It wouldn't be too hard for a playable capital ship to implement device damage via noncritical breaches if the actual noncritical strings were available.
Literally is the new Figuratively
Post Reply