Sign in to follow this  

Finding a good way to create a game script

This topic is 3787 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

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"?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

This topic is 3787 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this