[skip|else] if [not]|while [not]| = The possible 'Conditional' statements that can be used with this command.
<RetVar/IF> = Use a variable, if the command should return information. If a variable is used, it will contain a gate.
<RefObj> = A variable containing a sector.
<Var/Number> = A number or a variable containing one. Valid numbers are 0-5.
Returns the gate with the as <Var/Number> selected id in the as <RefObj> selected sector.
Each sector in the X-Universe can have a maximum of 6 gates. Each gate in a sector has a specific id, whereby the ids 0-3 are usually reserved for north (0), south (1), west (2) and east (3) gate. The ids 4 and 5 are free to use for additional gates, for example in the HUB or the Aldrin sector (after the Aldrin Expansion plot). Note, that it's also possible to create gates with different ids - possible ids are still 0-5, but for example you could use '1' as north gate - using the create gate[/color]-command.
Example:
$id = 6
while $id
|dec $id =
|if not $sector -> get warp gate: gate id=$id
||write to player logbook: printf: fmt='Gate id %s in sector %s is free to be used.', $id, $sector, null, null, null
|end
end
return null
Assuming the variable $sector contains a sector, this will check, which of the possible gate ids (0-5) are free to use and writes every available one with an appropriate message to the logbook.
Related Commands:
[url=http://forum.egosoft.com/viewtopic.php?t=305213]<RetVar> = <Var/Warpgate> get gate id
Command Location:
- »» Universe and Sector Commands
<RetVar/IF><RefObj> get warp gate: id=<Var/Number>