Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


Making a scripting engine/console

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

I''m making a 3D game engine, and I''ve got some nice features now. My problem is I want to let other people of my programming team use the engine as well, for map/model testing etc. Since they cannot program/compile and stuff I want to make a console so they can load in maps, models, etc. Commands will be pretty basic first (as in ''loadplayermodel /models/model.mod'', ''loadmap /maps/map.map'', etc.) but later I want to use the scripting system for the game itself, so it should also be able to do more complicated things. I have absolutely no experience for console/scripting programming, and I don''t know where to start. A good thing would be if I knew how to display and read in what the user types (the console thingy. I want the player to be able to type something and the console should display that and check the input) Also I am not sure how to do the scripting system so that it''ll still be fast if I add lots of commands. Now, are there any good articles/tutorials on this, or do you have advice for me? Anything is welcome BTW I''m using OpenGL/C++ | Panorama 3D Engine | Contact me | | MSDN | Google | SourceForge |

Share this post

Link to post
Share on other sites
Im going to use lua for mine, an example of how a command might look with lua...


or something like that

This function would be part of a real engine function but with a lua interface for it...

//an example...

int l_SetPlayerLocation(lua_State* l)
return 1;

bool InitAll()

Theres a great article here on game dev about lua,
I would suggest reading it. you could also check out the script
/ mods etc forum.

The console part would be a matter of handling input and displaying text on some sorta window, or quad...

This is how I plan on doing mine, so im not sure if its gonna work perfect, but in thoery is should.
good luck.

Share this post

Link to post
Share on other sites
I completed my console a couple of days ago, using Lua. It''s networked, so you can connect to it from a different computer to execute commands while the program is running fullscreen (I have a terminal on my desk exclusively for doing this). Really useful stuff.

How appropriate. You fight like a cow.

Share this post

Link to post
Share on other sites

Lua is VERY fast in my opinion and is easy to work with.
A bit of a pain to get installed on your system though.

Basicly, you need to make a basic text editor for the console.
I havent actually done this yet though.

Hmm, theres a good tut at
(for a small fee though)

look under GL and I think DX tutorials as well for it.

Share this post

Link to post
Share on other sites
There is a great book called ''Game scripting mastery'' which
shows you how to build a C like scripting language from the
ground up, with compiler, assembler, and a VM. There is two
chapters on command based scripting to, but that is really
simple stuff. It also teaches you how to use existing languages
like LUA, Python, and TcL. By the end of the book you will have
a scriping language which you can customize in every way
possible to fit you engine (think mod development).

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!