Topology Help

Freeform discussion about anything related to modding Transcendence.
Post Reply
RPC
Fleet Admiral
Fleet Admiral
Posts: 2876
Joined: Thu Feb 03, 2011 5:21 am
Location: Hmm... I'm confused. Anybody have a starmap to the Core?

I'm working on an idea for Sandbox where there would be capital nodes, and the distance a node is from a faction's capital would affect station spawn values.

I talked with Drako on IRC and a very good point was brought up: it's very hard to find distances of topology nodes from one point to another, and it's almost impossible when topology loops.
I'm interested if anybody can figure out a way to track how far systems are from each other.
Tutorial List on the Wiki and Installing Mods
Get on Discord for mod help and general chat
Image
Image
Der Tod ist der zeitlose Frieden und das leben ist der Krieg
Wir müssen wissen — wir werden wissen!
I don't want any sort of copyright on my Transcendence mods. Feel free to take/modify whatever you want.
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 made this lambda

Code: Select all

(setq sovSetInfluenceLevels
	(lambda (sovereign strength)
		(block (capital)
			(setq capital (random (sysGetNodes)))
			(sysSetData capital (cat sovereign) (add 1 strength))
			(block nil
				(for a 1 strength
					(enum (sysGetNodes) node
						(block nil
							(enum (sysGetStargates node) gate
								(block (node2)
									(setq node2 (sysGetStargateDestinationNode node gate))
									(if (gr (sysGetData node2 (cat sovereign)) (add 1(sysGetData node (cat sovereign))))
										(sysSetData node (cat sovereign) (subtract (sysGetData node2 (cat sovereign)) 1))
									)
								)
							)
						)
					)
				)
			)
		)
	)
)
I haven't tested it but it stores how close the system is to the capital. If you need the distance from the capital ic can be edited to show that.
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?
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:

Here's the code for the distance from an origin.
I haven't tested it, but I think I have it right.
the syntax is (sysGetDistanceFromOrigin [nodeID] [number] [NodeID])
The first nodeID is the origin, the number is the max distance from the origin, and the last nodeID is the node you want to test. It also stores the distance data on the systems.

Code: Select all

(setq SysGetDistanceFromOrigin
	(lambda (origin maxDistance TheNode)
		(block nil
			
			(sysSetData origin 'distance 0)
			(block nil
				(for a 1 maxDistance
					(enum (sysGetNodes) node
						(block nil
							(enum (sysGetStargates node) gate
								(block (node2)
									(setq node2 (sysGetStargateDestinationNode node gate))
									(if (ls (sysGetData node2 distance) (sysGetData node distance))
										(sysSetData node distance (add (sysGetData node2 distance) 1))
									)
								)
							)
						)
					)
				)
			)
			(sysGetData TheNode 'distance)
		)
	)
)
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?
RPC
Fleet Admiral
Fleet Admiral
Posts: 2876
Joined: Thu Feb 03, 2011 5:21 am
Location: Hmm... I'm confused. Anybody have a starmap to the Core?

Ok thanks Drako. Time to start making station tables :D
Tutorial List on the Wiki and Installing Mods
Get on Discord for mod help and general chat
Image
Image
Der Tod ist der zeitlose Frieden und das leben ist der Krieg
Wir müssen wissen — wir werden wissen!
I don't want any sort of copyright on my Transcendence mods. Feel free to take/modify whatever you want.
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 was thinking the first code would be more useful, since then you can have the sovereign's data and you can base the stations on the level of infulence, so if Commonwealth has level 10 influence, Ares have level 5, and Ringers have level 3, then the commonwealth would have 2x the power of the Ares in that system, and the Ringers would have less than the ares. It also lets some systems have 0 influence, so they would be empty with just a couple pirate bases.
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