See the link that AP posted. (Thank you.)
The quote character is used when you don't want to evaluate the arguments in the list. The list function is used when you do.
So if you want to select or compare a value but not do anything to it then use '.
Examples from 1.8b3.3 SOTP listed here for easy reference.
Antarctica02.xml
Check for typData values with 'find'.
Code: Select all
(find '(underAttack friend) (typGetData &msEscapeFromDantalion; 'status)
also nodeIDs (CommonwealthAgricultural.xml)
(find '(SE SK CD) (@ theEntry 2))
BattleArena.xml
Select a value using 'random',
Code: Select all
(random '("Starton Eridani" "St. Katharine's Star" "Rigel Aurelius" "Centauri" "Kibo"))
(random '(-500 -250 -100 -50 -25 -25 0 0 0 +25 +25 +50 +100))
also
select an item (CommonwealthFleetMission02.xml)
(random '(&itGradeAGrains; &itWaterIce; &itMedicalSupplies; &itSalmonite;))
select a UNID (CharonPirates.xml)
(random '(&etPirateAmbush1; &etPirateAmbush2;))
select an enhancement (Volkov.xml)
(random '(0x0102 0x0105 0x0A28 0x0A38))
BattleArena.xml again
Use several options with 'itmGetName' name flags.
Can also be used with 'objGetName' in the same way.
And for the options on 'objHasItem/objRemoveItem'.
Code: Select all
(itmGetName shieldItem '(short actual))
(itmGetName theItem '(short actual capitalize))
BattleArenaMelee.xml
Set data values with 'objSetData'.
Code: Select all
(objSetData arenaObj 'results '(0 0 0 0))
CommonwealthFleetMission02.xml
Use for multiple 'map' options.
Code: Select all
(map stationList '(reduceMin original) thePair (objGetDistance (@ thePair 0) (@ thePair 1)))
also (CoreCode.xml)
(map (sysGetStargates) '(excludeNil reduceMin original) gateID (sysGetTopologyDistance (sysGetStargateDestinationNode gateID) nodeID))
CommonwealthMilitia.xml
Select a value using '@' ('item' is the same as '@' but is deprecated).
Code: Select all
(item '(Alpha Beta Gamma Delta Epsilon) count)
also (CoreExplosions.xml)
(@ '(0 40 60 90 120 165) explosionSize)
Neurohack.xml
Create a decimal format color.
Code: Select all
(cnvDrawRect 0 60 528 80 '(74 71 95))
PointJuno.xml
Create a list to select values from.
Code: Select all
(setq codes '(anvil boson cloud dour enigma fallen.........
RPGDockscreens.xml
To set multiple special options with 'scrSetActionLabel'.
Code: Select all
(scrSetActionLabel gScreen 'actionDone Nil Nil '(default cancel))
More complex examples.
Pteravores.xml
Use as an objSource value in 'objDamage'.
Code: Select all
(objDamage gSource &vtPteravoreBite; '("pteravores" 0x40) (objGetOverlayPos gSource aOverlayID))
SistersOfDomina.xml
As a list for 'enum'.
Code: Select all
(enum '(att rel desc) var
(errBlock (err)
(if (eq (typeOf (eval var)) 'list) (set var (eval (eval var))))
(printTo 'log (cat "Domina donation error: " err))
)
)
HSCompatibility.xml
Create a list of lists.
Code: Select all
(intSetCompatibleFuelEx '((&itPteracniumFuelRod; 88) (&itXenotiteFuelRod; 88) (&itHeliumAssembly; 88)))
Dall01.xml
Set data values in a 'data id'. Note use of code inside '().
Code: Select all
<StaticData>
<Data id="sisters.donation">
; attd rel text
'(Nil -1 200 (block Nil
(typSetData &itDallSphere; 'status 'donated)
(typTranslate &itDallSphere; 'donationText)
)
)
</Data>
</StaticData>
Stupid code. Do what I want, not what I typed in!