Hello everyone!
I've been working within tmwAthena's scripts since I joined a few months ago, migrating some existing scripts into the quest log. I've noticed that there's some coding conventions that were either written before newer alternatives were added, or are simply "CONVENTION" (queue Fiddler on the Roof musical number).
I have more than a passing interest in domain-specific languages - DSLs for short - and while I haven't dived into the engine's code yet, I am curious what people's thoughts on it's capabilities and coding styles are. I know the wiki has a page about this language, but it's woefully out of date and in need of a massive facelift.
One example would be the tag "L_Close" which was often used to store the local variable within the server's database/flat file, like this:
Code: Select all
001-1,1,1,0|script|Dummy|1
{
//using @inspector as an exampel
set @inspector, ((QUEST_Hurnscald & NIBBLE_3_MASK) >> NIBBLE_3_SHIFT);
mes "[Dummy]";
mes "\"I'm a dummy, not dumb."";
goto L_Close;
L_Close:
set QUEST_Hurnscald, (QUEST_Hurnscald & ~(NIBBLE_3_MASK)) | (@inspector << NIBBLE_3_SHIFT);
close;
}
Before the quest log's ServerVar and CommonVar were added, the above seemed to be the only way to access persistent variables. Now though, quest-log.txt defines the stored variable and the useable nybble slices, so "goto L_Close" is just a wasted step.
I wonder, are there any other instances of older code or conventions that are no longer needed? Things like clear_vars.txt feels like a bad bandaid that worked at the time, but is becoming more and more unmanageable as time goes on. I feel like I'd love to write a complete up-to-date manual for this language (which is apparently called "eA script", but that name makes the "challenge everything" soundbyte play in my brain), so I wanted to ask if anyone had some input of their own.
I know Hercules has a slightly modified version of this language, so input from there would be great as well.
Couldn't hurt to at least ask, right?


