script cleanup/scripting standards proposal

Content and general development discussion, including quest scripts and server code. TMW Classic is a project comprising the Legacy tmwAthena server & the designated improved engine server based on evolHercules.


Forum rules

This forum houses many years of development, tracing back to some of the earliest posts that exist on the board.

Its current use is for the continued development of the server and game it has always served: TMW Classic.

User avatar
Nard
Knight
Knight
Posts: 1113
Joined: 27 Jun 2010, 12:45
Location: France, near Paris

Re: script cleanup/scripting standards proposal

Post by Nard »

o11c wrote:Yeah, it could be beneficial to add (or link) examples under the commands on this page:
http://wiki.themanaworld.org/index.php/ ... _Reference
(Don't edit the existing ones - they're signatures, not examples)

Though, a few larger examples would likely not "fit" in a single command. Wherever you introduce the larger syntax (how a warp or mob looks like; the meaning of all the pipe-and-comma separated values have and which ones are optional) might be a good place to do that. (like the current one on the "Standards" page is)
I didn't plan to include examples in the Sripting reference page, just maybe some usage code portions when not included , and as Jenalya suggests it, tricks like the one we met on Blue Sage quest. Of course, links to sample code when it will be available could be included too, but this begins to overflow my skills as I am far to know all the built in functions. To be able to read code is one thing, to be able to write some code is another one, to document a library is far beyond :?

There are definitely some major inaccuracies in the Basics page.

I would start with a brief mention of how the NPC scripts are loaded from the conf, then mention the top-level constructs besides scripts (with appropriate warnings that they should usually be generated by the converter rather than by hand), then finally scripts.
I was sure that there was a inappropriate content in this text, due to the work that was done since TMW fork exists. I included it because I bet most of the content would be useful and that the work needed to upgrade it would be far less than writing a new one from scratch.

I suppose the interpreter begins to read the .conf file, then the cascading imports through the folders hierarchy until it reaches NPC, Map, Mob and item scripts and variables, and links all that mess someway. My ears (eyes in fact) are wide open to learn if you have a nice way to explain that with simple words. :D
"The language of everyday life is clogged with sentiment, and the science of human nature has not advanced so far that we can describe individual sentiment in a clear way." Lancelot Hogben, Mathematics for the Million.
“There are two motives for reading a book; one, that you enjoy it; the other, that you can boast about it.” Bertrand Russell, Conquest of Happiness.
"If you optimize everything, you will always be unhappy." Donald Knuth.
User avatar
o11c
Grand Knight
Grand Knight
Posts: 2262
Joined: 20 Feb 2011, 21:09
Location: ^ ^

Re: script cleanup/scripting standards proposal

Post by o11c »

I added a couple sections to the Basics page. It's not very basic, but it should be complete.
Former programmer for the TMWA server.
Post Reply