Auto-UNID

Freeform discussion about anything related to modding Transcendence.
Post Reply
schilcote
Militia Captain
Militia Captain
Posts: 726
Joined: Sat Feb 02, 2008 7:22 pm

Thu Oct 03, 2013 4:08 am

"I love making extensions for Transcendence, but building UNID tables is such a bore! If only there was a way to do it AUTOMATICALLY!"

Well, now you can. Hi, I'm Schilcote, here to tell you about AUTO-UNID!

Auto-UNID is the FAST AND EASY WAY to build the !ENTITY block at the top of your extension XML. Simply build your extension from the <TranscendenceExtension> tag down, then execute Auto-UNID from the command line or by dragging your XML onto the Auto-UNID executable! Auto-UNID's ALGORITHMIC ACTION will ask you for the first six digits of your extension's UNIDs (that is, your modder ID code plus two more identifying the individual extension), then magically create a table of machine-readable UNIDs at the top of your XML file! It's that easy!

Auto-UNID is not for use on XML files that make use of modules or have more than 255 UNID declarations. Auto-UNID is not guaranteed to produce working results on all XMLs without some modification. Always back up your work before using Auto-UNID. Auto-UNID has not been qualified by the FDA, and is not intended to cure, treat, or prevent any disease.

Download now!

http://www.mediafire.com/download/xi0oh ... tounid.zip

But wait! There's more! Readers of this post will also receive a Python 3 script, suitable for use with Linux or MacOS as well!

http://www.mediafire.com/?p964t7ejvlvppen

Simply invoke the script with the following command:

python autounid.py <yourxml> <unidbase>

You'll wonder how you ever made extensions without it. Try Auto-UNID today!
Last edited by schilcote on Thu Oct 03, 2013 1:54 pm, edited 1 time in total.
[schilcote] It doesn't have to be good, it just has to not be "wow is that the only thing you could think of" bad

User avatar
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?

Thu Oct 03, 2013 4:39 am

Thanks :3
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.

User avatar
pixelfck
Militia Captain
Militia Captain
Posts: 571
Joined: Tue Aug 11, 2009 8:47 pm
Location: Travelling around in Europe

Thu Oct 03, 2013 9:26 am

Sounds handy.

Does this script honor the categories?
Transcendence.xml wrote:

Code: Select all

		0x D MMM T III
(...)
T		Type ID. Within a module, the division of the namespace is
			undefined. Transcendence uses this value to represent the
			type of object assigned an UNID:

			0	star system description
			1	sovereigns
			2	station types
			3	ship classes
			4	item types
			5	special item types (virtuals)

			8	random tables (items, encounters)
			9	effects, energy fields, space env, etc
			A	dock screens
			B	powers

			F	images and sound resources

III		ID. This can be any value unique within the module and type ID.
			This is generally a monotonically increasing number.
~Pixelfck
Image
Download the Black Market Expansion from Xelerus.de today!
My other mods at xelerus.de

User avatar
digdug
Fleet Admiral
Fleet Admiral
Posts: 2614
Joined: Mon Oct 29, 2007 9:23 pm
Location: Decoding hieroglyphics on Tan-Ru-Dorem

Thu Oct 03, 2013 11:58 am

Nice ! :D

I will reinstall python, after all :P

schilcote
Militia Captain
Militia Captain
Posts: 726
Joined: Sat Feb 02, 2008 7:22 pm

Thu Oct 03, 2013 1:15 pm

pixelfck wrote:Sounds handy.

Does this script honor the categories?
Transcendence.xml wrote:

Code: Select all

		0x D MMM T III
(...)
T		Type ID. Within a module, the division of the namespace is
			undefined. Transcendence uses this value to represent the
			type of object assigned an UNID:

			0	star system description
			1	sovereigns
			2	station types
			3	ship classes
			4	item types
			5	special item types (virtuals)

			8	random tables (items, encounters)
			9	effects, energy fields, space env, etc
			A	dock screens
			B	powers

			F	images and sound resources

III		ID. This can be any value unique within the module and type ID.
			This is generally a monotonically increasing number.
~Pixelfck
No, nor does it honor module inclusions, and it will define UNIDs that are not necessary if you are overriding vanilla stuff.

It will, however, make sure that unidExtension is #00.

EDIT:

And now the super-convenient EXE version is out. Fancy, huh?
[schilcote] It doesn't have to be good, it just has to not be "wow is that the only thing you could think of" bad

User avatar
Wolfy
Fleet Admiral
Fleet Admiral
Posts: 5368
Joined: Tue Feb 05, 2008 1:10 am
Location: Somewhere in the Frontier on a Hycrotan station, working on new ships.

Thu Oct 03, 2013 3:01 pm

Hm, when you get module support, think you could enable grouping the stuff by module?

like just adding in a comment with the module name in it, then doing the unids in the module, then moving on to the next module
(shpOrder gPlayership 'barrelRoll)
(plySetGenome gPlayer (list 'hycrotan 'nonBinary))
Image

User avatar
digdug
Fleet Admiral
Fleet Admiral
Posts: 2614
Joined: Mon Oct 29, 2007 9:23 pm
Location: Decoding hieroglyphics on Tan-Ru-Dorem

Thu Oct 03, 2013 3:10 pm

will ask you for the first six digits of your extension's UNIDs
this is cool, but, as discussed, limited.

What if I could actually pass an entire UNID with 8 digits and that will be used at the first number ?
This would resolve for people with large mods (256+ UNIDs) and at the same time, you can renumber quickly all your mods, since you just have to give a starting number for each one, just by checking the last number of the previous mod. :)

schilcote
Militia Captain
Militia Captain
Posts: 726
Joined: Sat Feb 02, 2008 7:22 pm

Thu Oct 03, 2013 3:54 pm

digdug wrote:
will ask you for the first six digits of your extension's UNIDs
this is cool, but, as discussed, limited.

What if I could actually pass an entire UNID with 8 digits and that will be used at the first number ?
This would resolve for people with large mods (256+ UNIDs) and at the same time, you can renumber quickly all your mods, since you just have to give a starting number for each one, just by checking the last number of the previous mod. :)
Yeah, that's a good idea. It'll probably also have a little data file that has the next mod ID in it so you can just drag the XML on top of it next time and not have to do anything.

Remember, this only took me an hour to make. It isn't quite polished. :P
[schilcote] It doesn't have to be good, it just has to not be "wow is that the only thing you could think of" bad

schilcote
Militia Captain
Militia Captain
Posts: 726
Joined: Sat Feb 02, 2008 7:22 pm

Sun Oct 06, 2013 8:54 pm

Just updated!

Now it stores the information it needs to automatically build base IDs after you use it once with a defined base ID.

I originally planned to follow digdug's suggestion, but decided not to. Still only supports 255 unids per file.

It does not support modules yet; that'll be for next time. Was a little harder to implement than I thought it would be.
[schilcote] It doesn't have to be good, it just has to not be "wow is that the only thing you could think of" bad

User avatar
Darth Saber
Militia Commander
Militia Commander
Posts: 290
Joined: Mon Aug 04, 2008 4:53 pm
Location: Korriban

Mon Oct 07, 2013 4:45 am

Thank you Schilcote, this is a wonderful tool! I wish that I had this when I was first learning to mod. :twisted:

schilcote
Militia Captain
Militia Captain
Posts: 726
Joined: Sat Feb 02, 2008 7:22 pm

Mon Oct 07, 2013 3:39 pm

Just now corrected an issue with a left-in debugging line in the script version that causes problems on Linux. The bug is still present in the EXE version, but the bug won't happen on Windows (well, Windows 7 or less anyway), so not really a problem. :P

Although I'd really like to see what happens if you try to run it on Windows 8.
[schilcote] It doesn't have to be good, it just has to not be "wow is that the only thing you could think of" bad

FourFire
Militia Captain
Militia Captain
Posts: 567
Joined: Sun Aug 12, 2012 5:56 pm

Mon Oct 07, 2013 10:10 pm

I removed the line, and now I get the following error message:
"Error: no home directory?"
Should I substitute my own home directory instead of deleting that line completely?
(func(Admin Response)= true){
if(admin func(amiable) = true)
Create func(Helpful Posts)
else func(Keep Calm and Post derisive topics)}

schilcote
Militia Captain
Militia Captain
Posts: 726
Joined: Sat Feb 02, 2008 7:22 pm

Mon Oct 07, 2013 11:50 pm

That'd be a hackish workaround, but it'll work, yeah.

The error message means that, for god knows what reason, Python doesn't see the environment variable that defines your home directory. It's really unpredictable for whatever reason.
[schilcote] It doesn't have to be good, it just has to not be "wow is that the only thing you could think of" bad

Post Reply