Transcendence engine's filter criteria

This is a moderated forum that collects tutorials, guides, and references for creating Transcendence extensions and scripts.
Post Reply
User avatar
Aury
Fleet Admiral
Fleet Admiral
Posts: 5421
Joined: Tue Feb 05, 2008 1:10 am
Location: Somewhere in the Frontier on a Hycrotan station, working on new ships.

This post covers the base criteria filters in the engine, based on the actual source code on github. Some details might be a bit hazy since things aren't super clear in all cases, and not everything has a nice comment explaining it all.


This is used for space object search criteria, such as with sysFindObject

Code: Select all

#this is yoinked directly from george's comments in the code. For some reason the others dont have this?

//	Parse
//
//	Parses the given criteria string and initializes our member variables. We
//	assume that we are initialized.
//
//	Parses a string and returns criteria structure
//
//		b			Include beams
//		k			Include markers
//		m			Include missiles
//		s			Include ships
//		t			Include stations (including planets)
//		v			Include intangible objects
//		x			Include missiles where targetable='true'
//		z			Include the player
//
//		A			Active objects only (i.e., objects that can attack)
//		B:xyz;		Only objects with attribute 'xyz'
//		C			(unused)
//		D:xyz;		Only objects with data 'xyz'
//		E			Enemy objects only
//		F			Friendly objects only
//		G			Stargates only
//		G:xyz;		Stargate with ID 'xyz'
//		H			Only objects whose base = source
//		I:angle		Only objects that intersect line from source
//		J			Same sovereign as source
//		J:unid;		Sovereign unid = unid
//		K			Killed objects only (i.e., objects that cannot attack)
//		L:x-y;		Objects of level x to y.
//		M			Manufactured objects only (i.e., no planets or asteroids)
//		N			Return only the nearest object to the source
//		N:nn;		Return only objects within nn light-seconds
//		O:docked;	Ships that are currently docked at source
//		O:escort;	Ships ordered to escort source
//		O:guard;	Ships ordered to guard source
//		P			Only objects that can be detected (perceived) by source
//		Q			Can perceive source only
//		R			Return only the farthest object to the source
//		R:nn;		Return only objects greater than nn light-seconds away
//		S:sort		Sort order ('d' = distance ascending; 'D' = distance descending
//		T			Include structure-scale stations
//		T:xyz;		Include stations with attribute 'xyz'
//		U			(unused)
//		V			Include virtual objects
//		W			(unused)
//		X			Only objects whose target is the source
//		Y			Enemy/angry objects only
//		Z			Exclude the player
//
//		+xyz;		Include objects with the given attribute
//		-xyz;		Exclude objects with the given attribute
//
//		=n			Level comparisons
these can be used for finding criteria but also objects, there seems to be some overlap in functionality with space object criteria, I guess because its used in other parts of the code. Normally you would be using the space object criteria though

Code: Select all


*: everything
A: active
K: killed
P: known
Q: in player's squadron
U: unknown
V: virtual

L: level

designtypes
T: stations which are structures (see 't' for the station type on its own)
    charEconomyType =                    '$',
    charAdventureDesc =                    'a',
    charItemTable =                        'b',
    charEffectType =                    'c',
    charDockScreen =                    'd',
    charSpaceEnvironmentType =            'e',
    charOverlayType =                    'f',
    charGlobals =                        'g',
    charShipTable =                        'h',
    charItemType =                        'i',
    charSound =                            'j',
    //    k
    //    l
    charImage =                            'm',
    charMissionType =                    'n',
    charImageComposite =                'o',
    charPower =                            'p',
    charSystemTable =                    'q',
    //    r
    charShipClass =                        's',
    charStationType =                    't',
    charMusic =                            'u',
    charSovereign =                        'v',
    //    w
    charGenericType =                    'x',

    charSystemType =                    'y',
    charSystemMap =                        'z',
    charTemplateType =                    '_',

+: requires a particular attribute tag (ex, +commonwealth)
-: cannot have a particular attribute tag (ex, -notForSale)


Theres also =/</> which are used contextually for integer comparisons of things like price or range
$: price range
L: level range
For example: <=$1500 means "less than or equal to 1500 credits"


|: logical "or" operation between two expression blocks
These criteria can be used for items:

Code: Select all

~: anything that isnt the following filters
^: anything that is all of the following filters

*: everything
#lowercase
a: armor
b: misc devices
c: cargo holds
d: devices (misc devices, weapon, launcher, reactor, shields, cargohold, drive) #anything that takes up a deviceslot (or would take up a deviceslot unless overridden w/ slots=0 or external=true)
f: fuel
l: launcher
m: missile
p: weapon
r: reactor
s: shields
t: misc items (as opposed to misc devices, which are installable)
u: useful items (as in, items you can use in the "use" menu)
v: drive
w: weapon
#uppercase (does not support ~/^)
I: installed
D: damaged
F: frequency parameter
L: level range (or repair level range, if the context is that of repair levels)
M: missiles that satisfy "m_bLauncherMissileOnly"
N: not damaged
S: only useful items
U: not installed
V: include virtual items

+: requires a particular attribute tag (ex, +commonwealth)
-: cannot have a particular attribute tag (ex, -notForSale)

#used with =/</>
$: price range
#: mass range
R: repairlevel range
(when used alone) level range if in a non-repairlevel range context
For example: <=$1500 means "less than or equal to 1500 credits"

|: logical "or" operation between two expression blocks
(shpOrder gPlayership 'barrelRoll)
(plySetGenome gPlayer (list 'Varalyn 'nonBinary))
Homelab Servers: Xeon Silver 4110, 16GB | Via Quadcore C4650, 16GB | Athlon 200GE, 8GB | i7 7800X, 32GB | Threadripper 1950X, 32GB | Atom x5 8350, 4GB | Opteron 8174, 16GB | Xeon E5 2620 v3, 8GB | 2x Xeon Silver 4116, 96GB, 2x 1080ti | i7 8700, 32GB, 6500XT
Workstations & Render machines: Threadripper 3990X, 128GB, 6900XT | Threadripper 2990WX, 32GB, 1080ti | Xeon Platinum 8173M, 48GB, 1070ti | R9 3900X, 16GB, Vega64 | 2x E5 2430L v2, 24GB, 970 | R7 3700X, 32GB, A6000
Gaming Systems: R9 5950X, 32GB, 6700XT
Office Systems: Xeon 5318Y, 256GB, A4000
Misc Systems: R5 3500U, 20GB | R5 2400G, 16GB | i5 7640X, 16GB, Vega56 | E5 2620, 8GB, R5 260 | P4 1.8ghz, 0.75GB, Voodoo 5 5500 | Athlon 64 x2 4400+, 1.5GB, FX 5800 Ultra | Pentium D 3.2ghz, 4GB, 7600gt | Celeron g460, 8GB, 730gt | 2x Athlon FX 74, 8GB, 8800gts 512 | FX 9590, 16GB, R9 295x2 | E350, 8GB | Phenom X4 2.6ghz, 16GB, 8800gt | random core2 duo/atom/i5/i7 laptops
User avatar
Aury
Fleet Admiral
Fleet Admiral
Posts: 5421
Joined: Tue Feb 05, 2008 1:10 am
Location: Somewhere in the Frontier on a Hycrotan station, working on new ships.

(original post updated with example of the syntax for </=/> ranges)
(shpOrder gPlayership 'barrelRoll)
(plySetGenome gPlayer (list 'Varalyn 'nonBinary))
Homelab Servers: Xeon Silver 4110, 16GB | Via Quadcore C4650, 16GB | Athlon 200GE, 8GB | i7 7800X, 32GB | Threadripper 1950X, 32GB | Atom x5 8350, 4GB | Opteron 8174, 16GB | Xeon E5 2620 v3, 8GB | 2x Xeon Silver 4116, 96GB, 2x 1080ti | i7 8700, 32GB, 6500XT
Workstations & Render machines: Threadripper 3990X, 128GB, 6900XT | Threadripper 2990WX, 32GB, 1080ti | Xeon Platinum 8173M, 48GB, 1070ti | R9 3900X, 16GB, Vega64 | 2x E5 2430L v2, 24GB, 970 | R7 3700X, 32GB, A6000
Gaming Systems: R9 5950X, 32GB, 6700XT
Office Systems: Xeon 5318Y, 256GB, A4000
Misc Systems: R5 3500U, 20GB | R5 2400G, 16GB | i5 7640X, 16GB, Vega56 | E5 2620, 8GB, R5 260 | P4 1.8ghz, 0.75GB, Voodoo 5 5500 | Athlon 64 x2 4400+, 1.5GB, FX 5800 Ultra | Pentium D 3.2ghz, 4GB, 7600gt | Celeron g460, 8GB, 730gt | 2x Athlon FX 74, 8GB, 8800gts 512 | FX 9590, 16GB, R9 295x2 | E350, 8GB | Phenom X4 2.6ghz, 16GB, 8800gt | random core2 duo/atom/i5/i7 laptops
Post Reply