Scripting lang.

Started by
1 comment, last by Muzlack 22 years ago
Is there a tutorial on making a scripting language that can move sprites around, set animations, points for sprites to move to and junk like that that is very similiar to programming in c? Every "script" in my scripting language right now is just a big if-then statement. ON whatever THEN do whatever DONE that is the basic syntax of all of my scripts. Is there a tutorial on how to input from a file and implement a scripting language that would be more like programming? like this:
  
if(StepAtLoc(characters[ego], 100,200,500,500)) { //if ego stepped at 110,200-500,500

SetCharacterGoto(characters[ego], 15,20);// make ego go to 15,20;

SetCharacterAnim(characters[ego], anim1); //change anim of ego to 1

}
  
You get the basic idea. Is there a tutorial where I can learn how to do this?
--Muzlack
Advertisement
Take a look at the main page of this site, there is a great big ongoing tutorial about how to implement a scripting system in C++
If you dont want to do it yourself you can just use java-script for your scripts, there is a C++ embeddable virtual machine available at http://www.mozilla.org/js/spidermonkey/
Im using it in my little amateur gaming project, its pretty easy to use, but i havent had time to get enough into any problems with it.(just got a new apartment, so busy moving etc).
There are also other scripting languages out there freely available ready to be plugged into C++ and java programs, but i cant remember their URLs.
check out LUA script page.

its got some good ideas on how to implement a scripting language.

www.lua.org

you could even save time on the parser and just use LUA script for the parsing. Provided you are keen on using LUA script. (saves time in developing a scripting language)



{ Stating the obvious never helped any situation !! }

This topic is closed to new replies.

Advertisement