Thread:LunaC/@comment-5085162-20120620204649/@comment-5085162-20120627141436

The generator script can be given a different name for the image, so it can correct spelling and the like; look in the Tsarina's Room and notice that the object is called "Lightning" and somebody spelled the image "Lightening." The script can fix something simple like that.

The scripts that extract the object names have only been well-tested on tables where the icons weren't already uploaded. As a result, I _think_ they will extract the icon associated with the name, but only if it is a simple misspelling, as above. If the icon name is a completely different form (different or misspelled scene name, not a PNG, or a different shape entirely), then the scripts won't find it. I hope those are few enough that they can be fixed by hand.

That's a long-winded way of saying that it would be easier if the images were uploaded afterward, but it's not mandatory. Right now, I don't process the simple list; the input is already in the form the generator script expects. However, if you want to add the raw icon image after the name, I can change the generator script to notice that and generate the right thing.

For the record, the normal input line expected by the generator script is just the name of the object. From that, it constructs the name for the image. Note that this is exactly what the simple list is.

If an input line is separated into two parts by spaces and a triple-equal, it uses the first part for the object name and the second part as the basis of the image name, so an input line of "Lightning === Lightening" is all that is needed for a misspelling. That's also how I add names for objects that were originally unknown; an input line like "Object Name === 71" generates the existing name for the image. I also use it for images with problematic characters in it, so in East Meets West, there's an input line of ""R" === Letter R" (too many quotes in that; the object name is "R" in quotes, but the image name is "Letter R") to keep the quotes out of the filename.

It would be easy to tweak that so that a link at the end of the line (that is, something in double brackets) would be used for the image name, so you could add the icon after the name. If you want to do that, I'm fine with it. All is flexible.

For input that is already in the simple two-column table form, I have a script that pulls out the object name and the link and prints a line as described above. The script isn't bright about the image name (it's looking for misspellings), but it doesn't care which column is name and which is image; all it cares is that one column has something that looks like a name. The output is just text, so I keep it in a text file where I can edit it (if needed) before giving it to the generator script. It's well-tested for a table without images, but I expect it to evolve as I encounter more cases of pre-existing tables.

I also have a script that will take a "new-format" table and pull out the image and object names. In theory, it will also pick up names that are in a simple list. I've tried it a few times, and it seems to work, but I've not stressed it, so it will need some more work, I'm sure.

By now, you should be able to see the workflow: If everything works right, it only takes a few minutes to do the whole thing, since most of the work is done by the scripts. It takes some care to get the details right and to check everything fully, but it's not a big deal. The problems will arise when I encounter existing Object Table sections in formats that don't match the expected form, but those should be fewer as time goes along.
 * Copy the existing information out of the Object Table section and put it in a text file.
 * Run a script over the text file to convert it to the format expected by the generator script (not needed for simple lists).
 * Edit by hand to fix any difficulties. Hopefully, this should be rare.
 * Run the generator script on the text file and grab a copy of the generated table.
 * Paste the table into the page being updated.
 * Preview the page to see if everything is OK; if not, go back to the edit step and fix the problem.
 * Publish the page.