Earlier versions of Transcendence created the game system by system as you worked your way through the galaxy. Now all the systems are created at the start of the game. This means the function 'unvFindObject' can be used to find any station or ship that is in the game.
There are some exceptions. Some stations and ships are created as you enter a system or under other conditions. unvFindObject won't be able to find these until after you have entered a system where they have been created. After that they will appear in the unvFindObject list unless they are destroyed.
---------------------------------------------
Here's what you get from the function list:
Code: Select all
(unvFindObject [nodeID] criteria) -> list of entries
criteria
s ShipClass
t StationType
+/-{attrib} Require/exclude types with given attribute
entry
({objID} {type} {nodeID} {objName} {objNameFlags})
unvFindObject by default will search every star system in a game. If you add the node ID of a star system to the code then it will limit its search to that system only. Note that the square brackets around nodeID in the function example above mean this part of the code is optional. You can leave it out without causing a code error.
A nodeID is a shortcut used by the game to identify systems. It is usually two or three letters long. eg the first system in SOTP has a nodeID of SE and is the Eridani system. More examples further down.
The 'criteria' determines what the function will list. Here's an example from Benedict03.xm1 in SOTP where the game finds a Korolov Shipping station.
Code: Select all
(unvFindObj "t +korolovShipping; +populated;")
The above criteria tells unvFindObject to search through all the star systems and find any stations ("t" criteria) that have both the attributes, "korolovShipping" and "populated". Attributes are listed in the StationUNID code of a station. The standard Korolov station has quite a few. They are found in KorolovShipping.xml.
Code: Select all
attributes= "corporate, corporateCustoms, corporateDecon, envAir, envEarth, envFire, envWater, friendly, generic, human, majorStation, korolovShipping, populated"
In an example game I have running that code generates this list. This tells us there are 3 Korolov stations in this game that have the attribute "populated".
Let's work through them.
((1274 1056775 "C3A" "Korolov Shipping" 64) (1909 1056775 "C4" "Korolov Shipping" 64) (2012 1449990 CP "Korolov Shipping" 64))
The first entry in the list is (1274 1056775 "C3A" "Korolov Shipping" 64). Looking back at the function explanation we see that the entries are in the form ({objID} {type} {nodeID} {objName} {objNameFlags}). See the similarity. Five distinct sections enclosed in brackets.
The first section is "1274". This is the objID of this station. The object ID is a unique number given to every object in the game. It is mainly used through the function 'objGetObjByID' which gives the station object used by most functions. More on this later.
The second section is "1056775". This is the type or UNID of the station. Here it is in the decimal number form. It is the same number as the hex form 0x00102007. We humans tend to use stKorolovShipping because its a bit easier for us to remember. All are the same thing to the game with one exception. Using the stKorolovShipping UNID in the debug screen gives an error. You have to use one of the number forms there.
The third section is "C3A". This is the node ID of the system that the station is in. The game uses node IDs to identity systems instead of names. This allows the game to give different names to the same system to add variety to the game. System "C3A" can be called either Lacaille or Cygni and is the system just before Rigel Aurelius (node ID of "BA", short for battle arena). In this game Cygni was picked at random. Most SOTP systems have a choice of 4 names.
The fourth section is "Korolov Shipping". Give yourself a pat on the back for working out that this is the station name! Stations (and ship and items) can have a couple of different names. An example is mining stations. You may have seen "Port Harcourt" or "Duralloy Dreams" in your galactic travels. These are both station names but using unvFindObject will give you "Commonwealth mining colony" instead. This is because all mining stations are "Commonwealth mining colonies" but are given different names, again to add variety to the game. The name you will get with this function is the one found near the attributes in the StationUNID code. For Korolov stations it is
Code: Select all
name= "Korolov Shipping"