Jump to content
  • Advertisement
Sign in to follow this  

Good scripting tutorial?

This topic is 4491 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I found the gamedev scripting tutorial section, heh.. Any tips on this would be appreciated greatly, though. Hello. I was wondering if anyone knew of a good tutorial for learning how to make a simple scripting language in C++. Otherwise, it would be great if someone could help me get started. I am just a little bit confused how I should get it working so that it is organized well, and supports everything I need. Here is what I want a finished (quite simple) script to look like. This one will contain every feature that I really need. There will be several variables that should be there for the person who is scripting to use. There will be four floats (nfx, nfy, nox, noy) and 4 bools (cml,cmr,cmu,cmd). The five possible ways to end the script will be moveRight, moveLeft, moveUp, moveDown, noMove. The function for absolute value on a float will be required. It will be abs. No parenthesis will be used, to simplify the coding. All of this can be changed, if neccesary. This is just my basic idea. EDIT! Just read a part of a tutorial, and someone mentioned syntax like ASM. This struck me as an incredibly good idea, because it reduces the complexity quite a bit, if I completely avoid if-statements, and go with simple conditional 'jmp' commands.. I'll look into it more. May be much easier. if abs nfx>abs nfy if nfx<0 if cml=true moveLeft endif endif if nfy>0 if cmr=true moveRight endif endif endif if nfy<0 if cmd=true moveDown endif endif if cmu=true moveUp endif noMove How difficult would it be to get a script like this going? My program needs to set the values of the variables I mentioned before, run this script, and figure out which ending value was output. My program needs to be able to be compiled, and then allow the script to be changed without recompiling (obviously). I have almost no clue where to get started. I don't understand how I can arbitrarily have nested ifs, etc. based on the whim of some scripter. I'm willing to spend significant time on getting this to work. I really need it for my game.. I have a good idea, and I'd like to see it work out. Most of the rest of my game is already working, and I'd like the player to be able to change the script while the game is running. (Yes, it is a terribly nerdy game. ^_^ ) Thanks very much for your help, Adam [Edited by - Adams555 on July 5, 2006 12:33:20 AM]

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!