Modding in SQL

Pazyryk

Deity
Joined
Jun 13, 2008
Messages
3,584
Just curious. Am I the only one that does this? I don't mean specialized functions that have to be in SQL. I mean ordinary table additions.

Here's an example of what it looks like:
Spoiler :
attachment.php
In my opinion, this is much easier to write, read and troubleshoot.

I know that old modders aren't going to change their ways. But I thought I'd throw this out here for new (or just getting started) modders to consider. My tutorial here shows the basic row entry structure for many rows. My pre-alpha mod is built entirely this way, so it has many examples.

Of course, I still use XML for UI stuff, and a few xml type files for graphic assets. There is one (and only one) situation that I have discovered where you need to use XML instead of SQL for normal table additions. This is when you have special characters like Éœæøðþÿ. Most of these work fine entered by XML but not from an SQL file. (XML is read as UTF-8, and I guess SQL is not; some characters like č don't work at all because they are not in the supported font set.) So I use typical XML entry for this kind of text.

I'll get around to writing a long tutorial on this eventually. One thing I do is put a special SQL command at the end of each file (adds a row to a Debug table) that I can use to make sure that every file loads completely. This saves a lot of time on troubleshooting, since comma errors and similar bugger your table but are often silent otherwise.
 
Back
Top Bottom