Bug 0.99c: Resources can have duplicate UNID.

Post ideas & suggestions you have pertaining to the game here.
Post Reply
User avatar
digdug
Fleet Admiral
Fleet Admiral
Posts: 2620
Joined: Mon Oct 29, 2007 9:23 pm
Location: Decoding hieroglyphics on Tan-Ru-Dorem

I was preparing a new playership and i did an error, the image resource of the playership and the shipclass itself have the same UNID, but the mod still works !

Well there is no need to post all the mod:

Code: Select all

<?xml version="1.0" ?>
<!DOCTYPE TranscendenceExtension
[
	<!ENTITY unidExtension					"0xD25CAA01">
	<!ENTITY scfoodship9					"0xD25CAA02">
	<!ENTITY rsfoodship9					"0xD25CAA02">
]>
<TranscendenceExtension UNID="&unidExtension;" version="0.99a">	
	
	<Image UNID="&rsfoodship9;"	bitmap="foodship9.bmp"	bitmask="foodship9mask.bmp" />
	
	<!-- Player Ship: Foodship9 -->

	<ShipClass UNID="&scfoodship9;"
			manufacturer=		"Zubrin Systems"
			class=				"FoodShip9"
			type=				"yacht"
			score=				"95"
			techOrder=			"biomech"
			
Last edited by digdug on Mon Dec 22, 2008 3:27 pm, edited 2 times in total.
User avatar
Periculi
Fleet Officer
Fleet Officer
Posts: 1282
Joined: Sat Oct 13, 2007 7:48 pm
Location: Necroposting in a forum near you

Did both of them show up in the game? I had a duplicate UNID error and the last loaded UNID was the only thing that was showing up.
User avatar
digdug
Fleet Admiral
Fleet Admiral
Posts: 2620
Joined: Mon Oct 29, 2007 9:23 pm
Location: Decoding hieroglyphics on Tan-Ru-Dorem

the first is the shipclass for a new playership, the second is the image for the same shipclass.

I should get an error: duplicate UNID, instead it works :lol:
User avatar
Periculi
Fleet Officer
Fleet Officer
Posts: 1282
Joined: Sat Oct 13, 2007 7:48 pm
Location: Necroposting in a forum near you

Digdug, I know what they are. My point is- I had a duplicate UNID and it did not cause an error either- what it did do was overwrite the UNID with the last item loaded. So instead of 2 things I got 1, and the 1 was the last 1 loaded.

Did you actually go any further than loading and see if both of those were in the game?
User avatar
digdug
Fleet Admiral
Fleet Admiral
Posts: 2620
Joined: Mon Oct 29, 2007 9:23 pm
Location: Decoding hieroglyphics on Tan-Ru-Dorem

I have a working playership with the additional image ! so the image is loaded correctly and the playership works. :D

So "I have a duplicate UNID and it did not cause an error"
And it's quite scary.
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's interesting- the one I had happen was in two separate extensions. Both the extension UNID were the same, so only one loaded but with no duplicate error. I just ended up with only one extension instead of two, and it took me a bit to find what had happened because there was no error.

Now you got two items to load with the same UNID.. how does that fit into using Unique IDs?
User avatar
digdug
Fleet Admiral
Fleet Admiral
Posts: 2620
Joined: Mon Oct 29, 2007 9:23 pm
Location: Decoding hieroglyphics on Tan-Ru-Dorem

I just tested it with Transcendence 0.98d and 0.99b and the mod works there too, so the bug is there too.
Sponge
Militia Commander
Militia Commander
Posts: 250
Joined: Sun Jan 28, 2007 7:51 pm

If it's not causing any issues, is it really a bug? Seems more like an unintended feature that allows UNIDs to be conserved.
User avatar
Periculi
Fleet Officer
Fleet Officer
Posts: 1282
Joined: Sat Oct 13, 2007 7:48 pm
Location: Necroposting in a forum near you

Why conserve UNID in the first place? Aren't they meant as unique numbers to refer to specific objects in the game?

Perhaps resources are treated as a different class of objects, but if it happens with two items you may get into trouble.

Addit-

Well I tried to duplicate the UNID for some things- items won't do it, ships won't do it, in fact- it looks like it's resources. You can duplicate a unid from an item, ship, or station as a resource (graphic). So maybe it's not a bug- resources are likely treated as totally a different class of objects in the game.

You can't duplicate UNID for Item Ship, Stations, System, Sovereigns, nor does it appear you can mix them- just the resources.
User avatar
digdug
Fleet Admiral
Fleet Admiral
Posts: 2620
Joined: Mon Oct 29, 2007 9:23 pm
Location: Decoding hieroglyphics on Tan-Ru-Dorem

in fact- it looks like it's resources. You can duplicate a unid from an item, ship, or station as a resource (graphic). So maybe it's not a bug- resources are likely treated as totally a different class of objects in the game.
So it's resources.
I renamed the thread to make it more visible.


George, is really that alright ?
User avatar
digdug
Fleet Admiral
Fleet Admiral
Posts: 2620
Joined: Mon Oct 29, 2007 9:23 pm
Location: Decoding hieroglyphics on Tan-Ru-Dorem

TADA ! Duplicate UNIDs again! :?
I found something more:
2 different extensions (2 separate xml) can have the same extension reference UNID if they contain only <Globals>

Me and Betel thought of this possible explanation (however we cannot test it)
the first extension is loaded
the Globals are fetched (no UNIDs here of course)
the second extension is loaded overwriting the first
the Globals are fetched and loaded

all the Globals functions in both of the extensions works! :twisted:
Post Reply