Sign in to follow this  
ID Merlin

[web] Game scripting - PHP

Recommended Posts

ID Merlin    119
I have a fairly simple scripting system built with a graphic editor that I thought would be easy to use for my non-programmer team members. Sadly, it's only obvious to me how to code a script using this system. So I'm looking for a better way, and thought that a simple language looking kind of like BASIC or even a subset of PHP would be just as good, or better, because I could code scripts much more quickly, and having a "real" language would give me much more power and be less cumbersome in some cases. Does anyone know if there is an interpreter written in PHP for a simple language or a game-type scripting language - with source code, preferably open-source? Or, would it be better to just code in PHP and use eval? (I don't like this idea much!)

Share this post

Link to post
Share on other sites
M2tM    948
I have written a basic "templating" language which is extensible in that you can write further plugins for it to make it into a domain specific language for any project you are working on. It is called Muted Template.

I would be interested in providing some assistance working with (including developing plugins for) the language if you do not mind including my name and a link to my website in the credits. It is a fairly new language and was conceived specifically to help run a CMS I'm currently developing, but it could only improve the language to consider other applications.

I am not certain it fits your needs, but you can check out a live demo on my portfolio site here: you can download the source code.

I have provided two pre-loaded examples, however let me warn you the language was not really intended for logic-heavy functions such as the binary search I implemented with it, and so situations like that may appear cumbersome (though it is possible to do.) More complicated functions and logic can reside safely hidden within your own custom PHP libraries and accessed via the {call|functionName|(parameter1)(parameter2)...)} tag. Or you could design your own custom tags with game-specific functions.

Right now it is centered around use with HTML templates with the idea of composing websites, but it would be easy to make tags which have the sole responsibility of updating players, storing things and more. It is tough to really offer more information without seeing some examples of what you are doing right now and what you need to do.

Smarty is possibly an option as well, though it has a much simpler regex-based parser which may not allow for the flexibility you require. It does, however, also support developing new language tags for parsing and sports a larger community.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this