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

"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
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?

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

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: 2620
Joined: Mon Oct 29, 2007 9:23 pm
Location: Decoding hieroglyphics on Tan-Ru-Dorem

Nice ! :D

I will reinstall python, after all :P
schilcote
Militia Captain
Militia Captain
Posts: 726
Joined: Sat Feb 02, 2008 7:22 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
Aury
Fleet Admiral
Fleet Admiral
Posts: 5421
Joined: Tue Feb 05, 2008 1:10 am
Location: Somewhere in the Frontier on a Hycrotan station, working on new ships.

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 'Varalyn 'nonBinary))
Homelab Servers: Xeon Silver 4110, 16GB | Via Quadcore C4650, 16GB | Athlon 200GE, 8GB | i7 7800X, 32GB | Threadripper 1950X, 32GB | Atom x5 8350, 4GB | Opteron 8174, 16GB | Xeon E5 2620 v3, 8GB | 2x Xeon Silver 4116, 96GB, 2x 1080ti | i7 8700, 32GB, 6500XT
Workstations & Render machines: Threadripper 3990X, 128GB, 6900XT | Threadripper 2990WX, 32GB, 1080ti | Xeon Platinum 8173M, 48GB, 1070ti | R9 3900X, 16GB, Vega64 | 2x E5 2430L v2, 24GB, 970 | R7 3700X, 32GB, A6000
Gaming Systems: R9 5950X, 32GB, 6700XT
Office Systems: Xeon 5318Y, 256GB, A4000
Misc Systems: R5 3500U, 20GB | R5 2400G, 16GB | i5 7640X, 16GB, Vega56 | E5 2620, 8GB, R5 260 | P4 1.8ghz, 0.75GB, Voodoo 5 5500 | Athlon 64 x2 4400+, 1.5GB, FX 5800 Ultra | Pentium D 3.2ghz, 4GB, 7600gt | Celeron g460, 8GB, 730gt | 2x Athlon FX 74, 8GB, 8800gts 512 | FX 9590, 16GB, R9 295x2 | E350, 8GB | Phenom X4 2.6ghz, 16GB, 8800gt | random core2 duo/atom/i5/i7 laptops
User avatar
digdug
Fleet Admiral
Fleet Admiral
Posts: 2620
Joined: Mon Oct 29, 2007 9:23 pm
Location: Decoding hieroglyphics on Tan-Ru-Dorem

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

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

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

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

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

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

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