Finding a good way to create a game script

Started by
2 comments, last by Dizzy1 16 years, 8 months ago
Hi, The basics of my game engine is nearly done, so now I start focussing on creating a game itself. The problem lies in the fact that I do not want to hardcode all the events. The first thing I tried was to make a basic script engine, but when you start making more events, start making conditional branches and start making custom variables in the script txt file, this starts to get too hard to parse for me. So then I thought about putting the game code in a DLL. But I don't think I am able to change positions of objects through a DLL since I can't import my object variables from the exe to the DLL? Anyway, what do you think is the best way to implement a "script"?
Currently working on WalledIn
Advertisement
The way I usually do it is just by creating game editors.

Just make a map editor and/or object editor that lets you attach events and such to your objects and environment. Or create a dialog editor if you want to assign dialogs to certain characters (much like arcanum). You could even make a simple script editor to help you organize all of your structures and interdependencies.

You will still need to script all of the low-level actions, but you could also hardcode them if there aren't many.
Frankly, I don't know how to organize the file in my engine.

Imagine this file:

bool clickedtv
clickevent
object36
if clickedtv
opendoor

This has a bool clickedtv, and a click event for object36 that only gets executed when clickedtv is true.

I haven't got a clue on how to store this in the engine when it is read.
Currently working on WalledIn
if i get what you're saying, i can suggest creating a python interface through boost::python if you're using c++.

with Pyste and Py++ it's a breeze to make the interface, and you then can use python to access you're engine.

This topic is closed to new replies.

Advertisement