Hi guys, I''m developing a scripting language that have to be used in a MMORPG.
I got same problems, not releted to the language implementation, but to its design, usage and "usefulness".
I think to build a scripting engine that makes me able to run script designed in a way that makes the "scripter" able to make something happen when a particular event is raised. For instance, I''d like to make a programmer able to create a Fireball-semiintelligent-wand using the following script and linking it with a structure (maybe XML) that rappresent its "static" structure (syntax it''s Python like because of I''m Python-addicted
![](smile.gif)
):
#All capitals identifiers are predefined constants
#First we have to specify (for some optimization while compiling)
#the object we want the script to be linked
use as Items.Wand
#The following code is executed once,during object initialization
#It calls the set_charges() function of the Items.Wand object
#that set the wand''s charges
set_charges(100)
#the following code is executed after the player choosed to use
#the item but before performing any kind of action
when using:
#The intelligent object knows if the enemy can''t be
#hitten by fire, and if so, it tells to the player
#$tagret is a special variable that contains an object
#rappresenting the target
if $target.is_immune(FIRE):
speak “The enemy can''t be hitten by fire!”
#We avoid the "used" event, so we don''t use the
#wand
avoid used
#the actions performed by the item
when used:
#if there are enaught charges, it cast a fireball ...
if get_charges() > 0:
dec_charges()
cast_spell(FIREBALL, $target)
else:
#... else the wan tells to the player it is empty
speak “Ho finito le cariche!”
As you can see the script is not complex, but my problem is that I think it''s too powerful to be executed quickly by the server or by the client.
Do you think that OO feature and events will make the scripting engine too slow??
Which are the features that a scripting language MUST have and which one it shouldn''t?
Do you think this kind of scructure could work?? Objects are defined using C++ in the game engine, and functions used inside the scripting language are pointer to C defined functions (I think it''s not important to give the user the skill to define new functions ...)
what do you think about that??
I know my question is not so clear, but I don''t know how to structure it better
![](smile.gif)
bye