Scripting info needed

Started by
5 comments, last by Suryc 24 years, 1 month ago
I would like to do some scripting in my games but Im lost as to how to implement one. Does anyone know any good sites that cover this or that can give some examples?
"We will all descend into an oblivious amorphous continuum of homogeniality."
Advertisement
look at unreal.epicgames.com for a conceptual overview of UnrealScript (i got lots of ideas from it).
also try www.gamasutra.com and search for "script" in editorials. there''s a lot of info there.

for compiling, look at
http://iecc.com/compilers/crenshaw/

this is a set of tutorials on writing compilers (good for expression parsing info). if you can read all the articles before writing any code, you won''t have to rewrite everything a hundred times.
good luck. i''ve worked on my script engine for a while and am not happy with it yet.

crazy166

some people think i'm crazy, some people know it
I''m currently working on a scripting language of my own. In all likelyhood it is overkill for what you would want to do (I''m using it to learn compiler design). I''ve also pretty much just figured things out on my own as I''ve gone allong. For that reason the way that I do things may not be the best way. If you want to look at it you can get the source code from my web page, Useless Code. The .zip file contains the VC++ 6 project and work space also.
So what are the benefits of writing a scripter?
"I have realised that maths can explain everything. How it can is unimportant, I want to know why." -Me
quote:Original post by Chris F

So what are the benefits of writing a scripter?


Change game mechanics without recompiling.

Allow game/level designers to program events, properties, and routines for your levels without the programmer having to code in yet another custom routine which may only be used once.

A generally more human-readable way of describing game events, useful to non-programming members of the team.

A quicker way of describing game events.

Separation of gameplay from the engine allows the engine to be re-used with fewer code changes.

Ability to only distribute as much of the game as is necessary without removing code. Useful for... shareware distribution or beta testing for instance.


I''m sure there are more. But the above are enough for me.
There is a good article at Gamasutra by Robert Huebner called "Adding Language to Game Engines".
It talks about how the scripting language, "COG", in Jedi Knight: Dark Forces 2 was implemented.

It doesn't delve into the low-level details of compiling (scanning, parsing, optimizing, code gen.), but it is a good reference into how scripts can be incorporated into a game.

Edited by - Aeetes on 3/14/00 11:34:22 AM
flipcode also has a tutorial on scripting languages.

If you want a formal introduction to interpreters, I recommend Mitchell, Friendman and Wand: "Essentials of Programming Languages" and Aho, Sethi and Ulman: "Compilers Principles, Techniques and Tools."

This topic is closed to new replies.

Advertisement