Snake's Pit of ASM (and Other Stuff)

I’m gonna release a tool that I forgot to release.

Don’t like manually defining arbitrary custom IDs? Just want your definitions to be sequential and unique? No? Yes? Don’t care? Then put your hands together for :drum::drum::drum::drum::drum:

Enumerate

This is a small tool that takes lists of strings that you want to be defined and gives them all unique, sequential IDs. I find this especially useful for defining a lot of custom items, classes, characters, animations, etc where I really don’t care what the ID is, but I do care that the ID isn’t shared with some other item, class, character, animation, etc.

This tool should be easy to use I hope

This was written in Python, and as always get it from the link in the OP.

For an example on how I abuse extensively use this script, feel free to check out my working project github: https://github.com/Snakey11/Legends-of-Avenir/tree/master/Definitions

This was designed to play nicely with TableManager, my CSV assembler, which doesn’t care what IDs actually are. What I find quite nice to do (I’m totally not biased I didn’t create this system or anything) is let Enumerate hand out arbitrary IDs to all my shit, have TableManager work exclusively with definitions, then use definitions elsewhere. I think this is a much cleaner method than manually defining IDs personally.

The command line arguments for this are:

enumerate (inputfile) (outputfile) (optional -c flag to delete output flag on error)

The input file I’ll get to in a sec. The output file will contain a huge list of #define YourDefinition 0xDefinitionIDs that you can simply include.
Now the input file is a file where you list things you want to be definitions.

I'll just give a straightforward example as to how it should look.
Jasper 0x01
Derek
Val
Helmer
Baret
Walter
Vicar

This inputted will output

#define Jasper 0x01
#define Derek 0x02
#define Val 0x03
#define Helmer 0x04
#define Baret 0x05
#define Walter 0x06
#define Vicar 0x07

That’s the basic idea.

You can restart numbering like
Jasper 0x01
Derek
Val
Helmer 0x10
Baret
Walter
Vicar

and this will produce

#define Jasper 0x01
#define Derek 0x02
#define Val 0x03
#define Helmer 0x10
#define Baret 0x11
#define Walter 0x12
#define Vicar 0x13

There are a couple other directives I’ve got for ya. You can .include files to start a new numbering system. If you .avoid value1 value2, numbering will… well avoid assigning definitions between those values inclusive.

An example with avoid:
.avoid 0x03 0x05
Jasper 0x01
Derek
Val
Helmer

This will produce

#define Jasper 0x01
#define Derek 0x02
#define Val 0x06
#define Helmer 0x07

You can line comment with @ or // just the same. If you have overlapping IDs within the same file, the program will throw an error. Whitespace lines are ignored.

I think that’s about it. It’s a small script, and I’m open to suggestions for improvements and additions.

Hope this makes someone’s life easier. Enjoy! :+1:

Fast edit: I’ve also just reorganized my opening post now that there are more links accumulating there.

7 Likes