Jump to content
  • Advertisement
Sign in to follow this  
Revelation60

Finding a good way to create a game script

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

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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!