Scripted Actions?

Started by
13 comments, last by Esap1 23 years, 9 months ago
Here's an idea from Hexen: have common scripts that are associated with specific objects (Door->Open)hard-coded into the engine so they're fast and easy to use. Then you can make an additional scripting language for other operations. In addition to object-associated scripts, Hexen made use of its own language called Action Code Script, which level designers could use to produce really complex effects.

That article Great Milenko mentioned is almost required reading for anyone who wants to make a scripting language. I read it a long time ago. Actually, I copied it into WordPerfect and made a print-out because I thought it was so good.

If you're serious about making your own scripting language, there's a great series of articles at FlipCode on how to do so. Here are links to all nine articles, to make your life easier:

Part 1 (Overview)
Part 2 (The Lexical Analyzer)
Part 3 (The Parser)
Part 4 (Symbol Table & Syntax Tree)
Part 5 (Semantic Checker & Intermediate Code Generator)
Part 6 (Optimization)
Part 7 (The Virtual Machine)
Part 8 (Executable Code)
Part 9 (Advanced Subjects)

Edited by - Tom on July 19, 2000 12:19:32 AM

GDNet+. It's only $5 a month. You know you want it.

Advertisement
Quake3 does moving platforms, opening doors, etc. by flags. Because each block in the level has their own flags. Now when you collide with this block, the engine checks it''s flags. Then it makes the appropriate action. Now certain flags are not objects. So the block isn''t drawn. That''s how they do spawn points and other things.

Hope this helps!



~-=-=-=-=-=-=~
~Justin Eslinger~
~.."BlackScar"..~
~-=-=-=-=-=-=~
~-=-=-=-=-=-=~~Justin Eslinger~~.."BlackScar"..~~-=-=-=-=-=-=~
Two other disadvantages of using DLLs that have not been mentioned are that they are less secure than custom script, and they are specific to platform (both of these were issues for Quake2 I believe, which used DLLs).

Regards

Starfall
Q2 ''s dll effectivly act as the interpreter. In Q2 the level scripts are embedded in to the bsp file in an almost plaintext state. Of course the actual code that produces the effects are hard coded in to the dll, the text just spawns\configures the objects.

Effectively what Q2 does is use what I call ''world objects'' (entities) that know how to interect with the player. So, when a player walks up to a door, the door checks it configuration (speed, direction etc) and moves.

What I''m interested in is the opinions of people around here on the pro\cons of using a robust premade scripting engine like seer or small? Personally, looking at the code I cant tell too much of a difference from something like C that also needs compiling. I guess the sole good point over compiled C is it''s platform independence (providing aplatform specific interpreter is available). This makes me thing java is a better ''platform independent'' scripting language. (Not that I''m going to learn java)

So, I guess personally if my game was Win32 only then I''d just use c\c++ DLL''s, but if I were to do a platform independent game I''d want to use a PI scripter to ensure that players creating scripts don''t have to have a quad booting machine to release a single script..

Is that about the idea of it... ???

gimp

Chris Brodie
THe Dark engine has a very interesting scripting system based on COM and client DLLs. The designers can write scripts easily, partially because Looking Glass defined macros for level designers to use so they can avoid having to deal with pointers and memory in general.
VK

This topic is closed to new replies.

Advertisement