Show planets names at entry

Freeform discussion about anything related to modding Transcendence.
User avatar
Mutos
Militia Lieutenant
Militia Lieutenant
Posts: 218
Joined: Thu Aug 14, 2008 3:31 am
Location: Near Paris, France
Contact:

Hi all,


I didn't find in any code exemple of how it is possible to have a system's planets show their names before you ever come close to them. In the Adventure I'm writing, I would like to have that feature as a basis...

EDIT #1 : just found the objSetKnown function. Should it be invoked in an OnCreate event, or is there an attribute on the Station tag ?
@+

Benoît 'Mutos' ROBIN
Hoshikaze 2250 Project
User avatar
Betelgeuse
Fleet Officer
Fleet Officer
Posts: 1920
Joined: Sun Mar 05, 2006 6:31 am

have you tried the <Names> tag?
look at stCommonwealthColony for an example of use

edit: The scale attribute might also be interfering but messing with that could change things in ways you don't want
Crying is not a proper retort!
User avatar
Periculi
Fleet Officer
Fleet Officer
Posts: 1282
Joined: Sat Oct 13, 2007 7:48 pm
Location: Necroposting in a forum near you

I am trying to figure this out too- how does a Commonwealth Fortress sometimes get a label in a system? What controls setting the map labels when there is no (objSetKnown in an oncreate?

The names get applied for the planets in Eridani in the system element, but they don't show up. There must be a way to set them to show... ??
Bobby
Militia Captain
Militia Captain
Posts: 675
Joined: Wed Jul 25, 2007 7:39 pm

don't those nav beacon things map what's near them?

commonwealth stations have the beacons.
Sponge
Militia Commander
Militia Commander
Posts: 250
Joined: Sun Jan 28, 2007 7:51 pm

Bobby wrote:don't those nav beacon things map what's near them?

commonwealth stations have the beacons.
Interesting. The Nav Beacons have a "beacon= true" attribute, which seems to be unique. When I placed it in a planet declaration (stCrateredPlanet), the area around planets of that type was mapped when I started up a game.
User avatar
Periculi
Fleet Officer
Fleet Officer
Posts: 1282
Joined: Sat Oct 13, 2007 7:48 pm
Location: Necroposting in a forum near you

Oh... that's what those do!

hmm... so maybe try putting a beacon near the planet- but that still won't place a label for the planet. Maybe the beacon can be the label, dropping noMapLabel="true" or something.
User avatar
Mutos
Militia Lieutenant
Militia Lieutenant
Posts: 218
Joined: Thu Aug 14, 2008 3:31 am
Location: Near Paris, France
Contact:

Hi all,


Lots of interesting paths ! I'll try to sort it out...

EDIT #1 : tried to attach beacon="true" properties to <Station> tag, to no avail...

EDIT #2 : tried this code to get the Moon marked on the Map, to no avail :

Code: Select all

	<!-- Moon -->
	<StationType UNID="&stMoon;"
		name=				"(moon)"
		scale=				"world"
		backgroundObject=	"true"
		sovereign=			"&svIndependent;"
		beacon=				"true"

		attributes=			"planet"

		ejectaType=			"&vtStoneAsteroidEjecta;"
		>
		<ImageVariants>
			<Image			imageID="&rsMoons;" imageX="0" imageY="0"  imageWidth="32" imageHeight="32" />
			<Image			imageID="&rsMoons;" imageX="0" imageY="32" imageWidth="32" imageHeight="32" />
			<Image			imageID="&rsMoons;" imageX="0" imageY="64" imageWidth="32" imageHeight="32" />
			<Image			imageID="&rsMoons;" imageX="0" imageY="96" imageWidth="32" imageHeight="32" />
		</ImageVariants>
	</StationType>
The resource images and UNID are mine, as it's an isolated item, it's easier to do a test on this...

EDIT #3 : btw, Sponge, what was exactly the code you used for your Cratered Planet and where exactly did you paste it ? I would like to test it also. Thanks in advance...

EDIT #4 : tried with the following code, still to no avail :

Code: Select all

<!-- Mercury itself -->
<Station type="&stDesertPlanet;" name="Mercury" showOrbit="true">
	<Events>
		<OnCreate>
			; Set visible label
			(objSetKnown gSource)
		</OnCreate>
	</Events>
</Station>
EDIT #5 : tried the following code in an extension, made cratered planets in the vanilla game appear with stations label around, but not the planets themselves.

Code: Select all

<?xml version="1.0" ?>
<!DOCTYPE TranscendenceExtension
	[
	<!ENTITY unidExtension				"0xD4100001">

	<!ENTITY stCrateredPlanet			"0x00002206">
	<!ENTITY rsWorlds1					"0x0000F102">
	<!ENTITY svIndependent				"0x00001003">
	]
>

<TranscendenceExtension
	UNID="&unidExtension;"
	version="0.99c"
>

	<!-- Cratered Planet -->

	<StationType UNID="&stCrateredPlanet;"
		name=				"(planet)"
		scale=				"world"
		backgroundObject=	"true" 
		sovereign=			"&svIndependent;"
		beacon=				"true"

		attributes=			"planet"
		>
		<ImageVariants>
			<Image			imageID="&rsWorlds1;" imageX="0" imageY="0"   imageWidth="128" imageHeight="128" />
			<Image			imageID="&rsWorlds1;" imageX="0" imageY="128" imageWidth="128" imageHeight="128" />
			<Image			imageID="&rsWorlds1;" imageX="0" imageY="256" imageWidth="128" imageHeight="128" />
			<Image			imageID="&rsWorlds1;" imageX="0" imageY="384" imageWidth="128" imageHeight="128" />
		</ImageVariants>
	</StationType>

</TranscendenceExtension>
Sponge, was it what you did ? Was it what you mean when you say :
the area around planets of that type was mapped when I started up a game
@+

Benoît 'Mutos' ROBIN
Hoshikaze 2250 Project
Sponge
Militia Commander
Militia Commander
Posts: 250
Joined: Sun Jan 28, 2007 7:51 pm

Yep. The planet's name was not displayed, but rather the stations around the planet were mapped. Not exactly the desired effect, but interesting nonetheless.

Possible solution:
Could a small, custom image (1x1 pixel black or possibly just transparent) be given the beacon=true attribute (but without the noMapLabel=true), generated as a close-range orbital of a planet, and dynamically given the same name as said planet? If it can be done, the only problem I see is that every station around a planet will be automatically mapped. I guess that's a pretty big problem.

Alternately, the beacon=true attribute could be dropped, causing nearby stations to not be mapped. You'd have to visit the planet for its name to appear, though.
User avatar
digdug
Fleet Admiral
Fleet Admiral
Posts: 2620
Joined: Mon Oct 29, 2007 9:23 pm
Location: Decoding hieroglyphics on Tan-Ru-Dorem

what about trying to use station satellites ? maybe they are going to show up as Sponge said.
User avatar
Mutos
Militia Lieutenant
Militia Lieutenant
Posts: 218
Joined: Thu Aug 14, 2008 3:31 am
Location: Near Paris, France
Contact:

Hi all,


What about asking George directly ? But as I don't know the traditions of the forum... He seems to be overbooked, but maybe he'll read this post ^-^ I noticed him around the forums, which is normal, talking of his game !

EDIT #1 : on <system> tag itself, I included the following <OnCreate> event :

Code: Select all

<Events>
	<OnCreate>
	' Find all objects to set them known
	(enum (sysFindObject gSource) theObj
		(objSetKnown theObj)
	)
	</OnCreate>
</Events>
It mapped everything in the system, except the planets. And when I selected "t +planet", nothing at all showed. There is something about the "planet" type preventing them from getting their name displayed...
@+

Benoît 'Mutos' ROBIN
Hoshikaze 2250 Project
User avatar
FAD
Militia Captain
Militia Captain
Posts: 732
Joined: Thu Aug 10, 2006 5:33 am
Location: Area 51

Try this in the station attributes: definiteArticle="true"
See if it'll show up then.
User avatar
digdug
Fleet Admiral
Fleet Admiral
Posts: 2620
Joined: Mon Oct 29, 2007 9:23 pm
Location: Decoding hieroglyphics on Tan-Ru-Dorem

OK, I got it.
The attribute that prevent the name to show up is

Code: Select all

 scale=            "world"
if you remove that from the stationtype of the planet the name will show up without problems

However there is a drawback, planets become targetable and probably they will do some trouble with sysFindObject because now they are at the same scale as any other station, so all of the sysFindObject of the game trying to find stations should include "-planet" (luckily stationtype of planets have that attribute)
User avatar
Mutos
Militia Lieutenant
Militia Lieutenant
Posts: 218
Joined: Thu Aug 14, 2008 3:31 am
Location: Near Paris, France
Contact:

Hi digdug,


Thanks for the info. I've at last learnt to work with the debug console, so I was about to test extensively all properties when you answered ^-^

As for the inconvenianc, I'll see it later, but I keep it in mind...
@+

Benoît 'Mutos' ROBIN
Hoshikaze 2250 Project
Sponge
Militia Commander
Militia Commander
Posts: 250
Joined: Sun Jan 28, 2007 7:51 pm

digdug wrote:OK, I got it.
Nice find. However, that's a pretty nasty drawback.
Mutos wrote: on <system> tag itself, I included the following <OnCreate> event
That's a good concept, and has given me another idea.
Going back to my previous idea about a transparent beacon.
What if, instead of making it a beacon, just give it a custom attribute (such as "planetnamer"). Create one of those as an orbital of every planet. You'd have to find some way to give it the same name as the planet it's orbiting, which I'm not sure is possible. If it is, then all you have to do from there is set all objects with the "planetnamer" attribute known in an <OnCreate> event. If it's possible, it would name all planets in a system, and I can't think of any problems that it would create.
User avatar
Periculi
Fleet Officer
Fleet Officer
Posts: 1282
Joined: Sat Oct 13, 2007 7:48 pm
Location: Necroposting in a forum near you

That works very well, good idea.

What I did was set the invisible station up to set itself known, kept it within 1 ls of the planet and targeted the planet with (sysFindObject gSource "t:planet N:1") to get the planet name.

Everything was done within the planetnamer- <Events> : <OnCreate>, The planet got a satellite "planetnamer" set to position directly 'below' the planet on screen so that the name would appear in a good spot.
Post Reply