Determining if a stargate is inbound or outbound

Freeform discussion about anything related to modding Transcendence.
Post Reply
Bobby
Militia Captain
Militia Captain
Posts: 675
Joined: Wed Jul 25, 2007 7:39 pm

Is there a way to determine if a stargate is "outbound" or "inbound" through code?
ImageImage
Thanks to digdug for the banners.
Drako Slyith
Fleet Officer
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:

Code: Select all

(sysGetObjectByName gSource "Outbound")
to find the outbound Stargate in the system that the ship or station that called it is in.
Image
Image
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?
Bobby
Militia Captain
Militia Captain
Posts: 675
Joined: Wed Jul 25, 2007 7:39 pm

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"))
ImageImage
Thanks to digdug for the banners.
Drako Slyith
Fleet Officer
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")
Image
Image
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?
george moromisato
Developer
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".
Drako Slyith
Fleet Officer
Fleet Officer
Posts: 1036
Joined: Wed Feb 03, 2010 4:28 am
Location: Researching how to make St. Kats star go supernova.
Contact:

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".
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... :D
Image
Image
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?
george moromisato
Developer
Developer
Posts: 2998
Joined: Thu Jul 24, 2003 9:53 pm
Contact:

Drako Slyith wrote:
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".
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... :D
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
Fleet Officer
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.
Image
Image
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?
Post Reply