wiki: script function reference

Content and general development discussion, including maps, quests, and server code from the development team.
Post Reply
User avatar
o11c
Knight
Knight
Posts: 2262
Joined: Sun Feb 20, 2011 10:09 pm
Location: ^ ^

wiki: script function reference

Post by o11c » Tue Aug 09, 2011 6:08 am

I have created a wiki page containing all the script functions reasonably expected to work. It should be quite useful for developers.

While writing this I noticed that our version of check_weight does not do as the upstream eA document says (check for inventory space), but only check the weight. Still, it should be used ... perhaps we could write a wrapper function that calls both?

As far as I can tell "callfunc" and "callsub" should work with arguments and return values ...

Note: this page intentionally is called eAthena rather than tmwAthena, as that is whence the language is. I'm planning on a purer language for tmwA.

Note: I wrote this while referring to my rewrite branch, but I have tried to keep it generic. Anything that I may have changed should be noted as "deprecated".

Here are some ways it should be improved:
  • Sort commands into categories. A page with 142 sections is difficult.
  • Add operators, and general information about the script syntax, some of it moved from EAthena Scripting Standards? The "Standards" page should only mention our standards for using the language; this (or perhaps another) page should be a reference of what the language is.
  • wikify: replace some of my awkward syntax with templates, etc. ... Also I'm thinking of (eventually) adding a links to the packets table (which also needs updating, but probably not by you mortals)
  • Double-check method signatures. Mostly I am concerned that I might have forgotten to change some from command syntax to function syntax (check if it mentions a return value). It is also possible that, since I worked from the source code implementation, ignoring the signature strings (which were quite often wrong!), that there are some arguments that must be passed, but which are ignored.
  • Examples? I'm not sure whether that is suitable for this page - wouldn't it bloat the page even more?
  • Improve the descriptions - they were written by me, understood by me, but perhaps not all suitable for a nontechnical developer.
  • Test whether functions actually work.
Former programmer for the TMWA server.
User avatar
Crush
TMW Adviser
TMW Adviser
Posts: 8046
Joined: Thu Aug 25, 2005 5:08 pm
Location: Germany

Re: wiki: script function reference

Post by Crush » Tue Aug 09, 2011 7:45 am

Note: this page intentionally is called eAthena rather than tmwAthena, as that is whence the language is. I'm planning on a purer language for tmwA.
Have you considered to use Lua instead of writing your own language interpreter from scratch? It would save you a lot of time, give us a powerful, well-documented and mature scripting language interpreter and would make the switch from tmwAthena to Manaserv much easier for the script writers.
  • former Manasource Programmer
  • former TMW Pixel artist
  • NOT a game master

Please do not send me any inquiries regarding player accounts on TMW.


You might have heard a certain rumor about me. This rumor is completely false. You might also have heard the other rumor about me. This rumor is 100% accurate.
User avatar
o11c
Knight
Knight
Posts: 2262
Joined: Sun Feb 20, 2011 10:09 pm
Location: ^ ^

Re: wiki: script function reference

Post by o11c » Tue Aug 09, 2011 8:01 pm

Crush wrote:Have you considered to use Lua instead of writing your own language interpreter from scratch? It would save you a lot of time, give us a powerful, well-documented and mature scripting language interpreter and would make the switch from tmwAthena to Manaserv much easier for the script writers.
I'm not strictly opposed. That being said, I'll have to write half of the language just to get a good storage backend. And in my experience you spend at least half the time fighting the way the library thinks (can we say "<iostream>"?), whereas with my own system will be designed around the way I think.

The point about switching from tmwA to Manaserv is good, though, and something I had not considered. But now that I *do* think about it, there's no reason I couldn't write another autoconverter... Still, it's not what I intended autoconverters for ... but I *did* intend them to be generic enough to support it.

Basically my decision is just being put off. It has become quite clear that I will have to do a release of my new tmwAthena before having a change to replace the scripting system.
Former programmer for the TMWA server.
User avatar
Crush
TMW Adviser
TMW Adviser
Posts: 8046
Joined: Thu Aug 25, 2005 5:08 pm
Location: Germany

Re: wiki: script function reference

Post by Crush » Tue Aug 09, 2011 8:13 pm

o11c wrote:The point about switching from tmwA to Manaserv is good, though, and something I had not considered. But now that I *do* think about it, there's no reason I couldn't write another autoconverter... Still, it's not what I intended autoconverters for ... but I *did* intend them to be generic enough to support it.
I wasn't thinking about reusing old content but rather about the training of the script writers.

Scripters aren't programmers. They can't learn a new language in a weekend.
  • former Manasource Programmer
  • former TMW Pixel artist
  • NOT a game master

Please do not send me any inquiries regarding player accounts on TMW.


You might have heard a certain rumor about me. This rumor is completely false. You might also have heard the other rumor about me. This rumor is 100% accurate.
Post Reply