Determining if a stargate is inbound or outbound
-
- Fleet Officer
- Posts: 1036
- Joined: Wed Feb 03, 2010 4:28 am
- Location: Researching how to make St. Kats star go supernova.
- Contact:
You can use this:
to find the outbound Stargate in the system that the ship or station that called it is in.
Code: Select all
(sysGetObjectByName gSource "Outbound")
Play in over 100 systems in a network. Play the 2011 Mod Of the Year
and the highest rated mod on Xelerus, The Network.
Play the July Mod of the Month, Fellow Pilgrims!
Play My other mods as well
(Drako Slyith)* I am a person
(Eliza chatbot)> Do you believe it is normal to be a person?
Thanks, it works perfectly. Will the following still work if the system has more than two stargates? "station" is the space object being tested.
Code: Select all
(eq station (sysGetObjectByName gSource "Outbound"))
-
- Fleet Officer
- Posts: 1036
- Joined: Wed Feb 03, 2010 4:28 am
- Location: Researching how to make St. Kats star go supernova.
- Contact:
Yes, it should work with more than 2 stargates. If a system has more than 2 stargates named outbound, then it will crash. It says: (duplicate Stargate "Outbound")
Play in over 100 systems in a network. Play the 2011 Mod Of the Year
and the highest rated mod on Xelerus, The Network.
Play the July Mod of the Month, Fellow Pilgrims!
Play My other mods as well
(Drako Slyith)* I am a person
(Eliza chatbot)> Do you believe it is normal to be a person?
-
- Developer
- Posts: 2998
- Joined: Thu Jul 24, 2003 9:53 pm
- Contact:
There is also code in Huari.xml that helps you test whether or not a stargate leads (eventually) to a particular system.
For example, if you are in Sanctuary, you can loop over all stargates and ask whether one of the stargates leads to "Heretic".
For example, if you are in Sanctuary, you can loop over all stargates and ask whether one of the stargates leads to "Heretic".
-
- Fleet Officer
- Posts: 1036
- Joined: Wed Feb 03, 2010 4:28 am
- Location: Researching how to make St. Kats star go supernova.
- Contact:
Yeah, but that's a bad thing to use if you say, happen to have a network, with literally infinite ways to get to Huaramarca...george moromisato wrote:There is also code in Huari.xml that helps you test whether or not a stargate leads (eventually) to a particular system.
For example, if you are in Sanctuary, you can loop over all stargates and ask whether one of the stargates leads to "Heretic".

Play in over 100 systems in a network. Play the 2011 Mod Of the Year
and the highest rated mod on Xelerus, The Network.
Play the July Mod of the Month, Fellow Pilgrims!
Play My other mods as well
(Drako Slyith)* I am a person
(Eliza chatbot)> Do you believe it is normal to be a person?
-
- Developer
- Posts: 2998
- Joined: Thu Jul 24, 2003 9:53 pm
- Contact:
I think I wrote the code so that it works in any topology (but I haven't tested it). Basically, the code just walks the gate topology until it reaches the node that you asked for (and then it stops). If there is no way to get to the target node, then the code walks to all nodes and then stops. [It should be possible to adapt the code to return the number of systems that it will take to reach the target node.]Drako Slyith wrote:Yeah, but that's a bad thing to use if you say, happen to have a network, with literally infinite ways to get to Huaramarca...george moromisato wrote:There is also code in Huari.xml that helps you test whether or not a stargate leads (eventually) to a particular system.
For example, if you are in Sanctuary, you can loop over all stargates and ask whether one of the stargates leads to "Heretic".
-
- Fleet Officer
- Posts: 1036
- Joined: Wed Feb 03, 2010 4:28 am
- Location: Researching how to make St. Kats star go supernova.
- Contact:
I ran into trouble running it in my Network mod. But I didn't try to limit it, so I think you could probably adapt it.
Play in over 100 systems in a network. Play the 2011 Mod Of the Year
and the highest rated mod on Xelerus, The Network.
Play the July Mod of the Month, Fellow Pilgrims!
Play My other mods as well
(Drako Slyith)* I am a person
(Eliza chatbot)> Do you believe it is normal to be a person?