Random Starting System/Position?

Freeform discussion about anything related to modding Transcendence.
Post Reply
Keedo420
Militia Lieutenant
Militia Lieutenant
Posts: 165
Joined: Sun Sep 04, 2011 9:31 pm

OK, ideally this is what I want to do, but I can't figure out exactly how to make it work or if it is even possible to do it the way I want:

Have the player start in a random level 1 system at a random planet, regardless of which starting ship they choose.

Alternately, if I can't do the random system part, I'd still like to have them start at a random planet in the starting system.
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?

It's possible to move the player after system generation, but really the entry point is fixed in the game due to code limitations. I think these related threads will help you out though:
http://forums.kronosaur.com/viewtopic.p ... lfy#p48490
http://forums.kronosaur.com/viewtopic.php?f=8&t=4007
http://forums.kronosaur.com/viewtopic.php?f=8&t=4006

Another much more advanced scripting technique you could use would by typCreate. You could insert random "start" elements throughout every system in your topology, then randomly choose a starting system. You can then use TypCreate to create that specific instance of ship, meaning that you can create the same ship with different starting positions, and maybe even different text to show the players where the ship starts and add specific background behind why the ship starts there in the first place.

Code: Select all

		startingSystem=		"SE"
		startingPos=		"Start"
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.
Keedo420
Militia Lieutenant
Militia Lieutenant
Posts: 165
Joined: Sun Sep 04, 2011 9:31 pm

I have those three topics saved so I can view them offline and they have already helped me quite a bit, though my current topology is just a single system for testing purposes. Since I'm still in the process of making facings for the rather large number of ships I'll be using, most of my work has just been flying each ship around to make sure they rotate properly, and to see how weapons and thrusters look. But anyway, before I get off topic ( 8-) ), I'm going to try setting up copies of the current starting system I am using (which is already much more random than the vanilla Eridani) with the Start marker at a different orbit for each copy, then use a table to choose one of these copies. I'm probably not explaining myself very well at the moment. Explaining has never been my strong point.
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 think I get it. If you need any help let me know. (I'm *really* unsure if you can use tables for this, but I haven't tested yet. Anything's possible ;) )
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.
Keedo420
Militia Lieutenant
Militia Lieutenant
Posts: 165
Joined: Sun Sep 04, 2011 9:31 pm

Well, trial and error. :wink: We'll see. I'll let you know how it works out.
Keedo420
Militia Lieutenant
Militia Lieutenant
Posts: 165
Joined: Sun Sep 04, 2011 9:31 pm

OK, well I got a working solution to have the player start near a random planet. What I did was put the following code inside each orbital group just after the Primary:

Code: Select all

<Siblings radiusInc="8">
						<Table>
							<Marker chance="50" objName="Start"/>
							<Null chance="50"/>
						</Table>
					</Siblings>
This gives a 50% chance for a marker to be created at each orbit. The game seems to always choose the last marker created (as I discovered by trying to put the marker at every orbit without the 50% chance). I tested this at least 10 times and usually started at a different orbit each try. SO FAR there has not been an instance of no marker being created, though I suppose it is statistically possible.

On a side note, there was one odd seemingly unrelated occurance.... The first time I started at orbit 1, I got the enemies detected message and noticed a few enemy ships flying around the sun. So I went after them. By the time I got there, only one was still there (the others had already flown off in random directions). So I proceeded to fight this guy that seemed to be stuck in orbit of the center of the star.... But here's the weird part.... When I destroyed him, instead of creating a wreck.... a duplicate of the ship (or at least one of the same type) spawned and then flew away.... Image
Keedo420
Militia Lieutenant
Militia Lieutenant
Posts: 165
Joined: Sun Sep 04, 2011 9:31 pm

Damn, I just realized that if I give the marker in orbit one 100% chance, it'll eliminate the possibility of no marker being generated. I should've realized that from the start. :oops:
Jay2Jay
Militia Commander
Militia Commander
Posts: 283
Joined: Fri Jan 11, 2013 12:57 am

How did you do that one smiley that's spinning around and waving its arms?

PS. TRANSCEPTION
Post Reply