Skip to main content
gamedev.net
🔒 Locked

Game Engine>Scripting Language interaction

Started by Some Guy Jan 18, 2001 at 3:25 PM 2 replies 400+ views
Original Post
Some Guy
Some Guy
After you''ve written the game engine in an API, establishing all the essential mechanics of it, variables for life, ammo, etc., how would you implement a scripting library that would constantly interact with the engine? I have been closely reading an article at Gamasutra.com that talks about this subject, as well as the scripting language COG and its interaction with the Jedi Knight: DF2 engine, but it really only gives tips as to what to implement, but provides no source code or anything. I''m not expecting anyone to do that for me, so don''t get me wrong. But I have to get this project I''ve thought up off my chest, and the only way to do that is to do it. So how would the scripting library, once written, be implemented into the engine?
Dogfood
Dogfood

Well, if you''re not implementing your own language, I imagine there would be constrained by API of the language first off. If you want an example, I''m pretty sure the source code to Abuse(an older side scroller) is out on the internet, and it used a full blown LISP interpreter for its scripting language(you could edit the LISP source in a director and change the game, even the config file was in LISP).


Doing a typical language with functions, I would probably tie a "function" in the script to the actions of entities, e.g. when its time to run the AI for a monster, you call the scripting engine with a script that was attached to the monster script.execute(monster.script);


As far as interacting with the game world, providing some sort of functions that can be called from the scripting language would be the simplest way.


If you want to discuss more, try Babel its a discussion board with articles and links with lots of info about designing/implementing languages(both interpreted and compiled).

jesterlecodeur
jesterlecodeur
Just an idea, is it possible to use jscript w/ and to interpret it by windows?

Imagine I have an IDispatch compliant 3D engine, so a jscript code can deal with it, but can I define a variable with the instance of this engine before interpret the script?

Why English rules?? C pas très malin tout ça!
_______________
Jester, studient programmerThe Jester Home in French
Shannon Barber
Shannon Barber
quote:
Original post by jesterlecodeur
Just an idea, is it possible to use jscript w/ and to interpret it by windows?

Imagine I have an IDispatch compliant 3D engine, so a jscript code can deal with it, but can I define a variable with the instance of this engine before interpret the script?


Yes - so long as you follow all of the written & unwritten Automation Rules you can use VBScript, JScript, and even Python I beleive. If you provide a typelibrary, you can use it with less of a performance hit with VB and Java, you still need to follow all of the automation rules. If you break the automation rules, it will only work with C++ and Delphi.

Windows provides a COM object to interpret JScript and VBScript.

Magmai Kai Holmlor

"Oh, like you''ve never written buggy code" - Lee

"What I see is a system that _could do anything - but currently does nothing !" - Anonymous CEO
The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.