Spell parser toy language Mobprogs/DGScripts/?

From: Artovil (artovil@arcanerealms.org)
Date: 09/05/02


Hello there,

I am running a CircleMUD 3.0 bpl20 with DG Scripts and DG Events.  We are currently in the process of redoing spells from the ground and up, except for a few stock spell routines.  Early along I had the idea that we should use some kind of toy language for spells since I have implemented the rudimentary foundation of a spell editor.  Has anybody done anything similar to this?  If so, do you have any code I can take a look at, or perhaps even reuse?

What I had in mind was this:
In the spell editor I have a menu with effects, for instance.
Select a type (affect/damage/...)
Write a simple script in an editor that is parsed on cast; for an affect:
...
duration = (%actor.skill% / 6)
modifier = 1
bitvector = AFF_CURSE
accum_duration = true
accum_affect = true
...
Each set of af[x] would have its own script, or possibly the engine could handle arrays as well, in which case I could have all the affect code for the spell in one script?  The more simple things as location and such are set through regular OLC menus, it's just the calculations and such that I want to parse through a script engine, such as DG Scripts.

Perhaps I am totally wrong here and this won't work at all, or it will be really slow and consume lots of processing power and memory, that's why I am asking you guys what to do.  If you don't want to take this on the list feel free to email me directly instead.

I thought that if I for instance reused the DG Scripts I could easily make summon spells and such inside the editor, and it would be similar with the affects, and just apply the affect through the scripting engine instead of having everything hard-coded in magic.c.

Please, help me out, since I am a little bit miffed here.  Any help appreciated.  Preferably with direct code examples and/or solutions that could work with DG Scripts or with another toy language that I can implement with my limited knowledge.  This means: do not tell me to write a Python parser all on my own from scratch, since that's a wee bit over my level.  I am sure that I could patch one in and make it work if I had a patch or a file that someone else wrote, but to do it myself is both too time consuming and difficult, then I'd rather chose the DG Scripts and the implications they bring. :)

If the system is a little bit slower than the normal magic system I will live with that, since magic will be quite rare, and rather complicated to use in our mud, which is the whole point.  If you want to be a mage you'll have to work for it, not to mention try to find all the invocation forms that are written in latin, just to cast the spell successfully. ;)

Thank you for taking your time to read my raving rants!

Warm Regards,
Torgny Bjers
Arcane Realms

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   | Newbie List:  http://groups.yahoo.com/group/circle-newbies/   |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 06/25/03 PDT