Jump to content
  • Advertisement
Sign in to follow this  
Dae

Game Scripting (and Design)

This topic is 3524 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 I'm trying to figure out how to structure (design) my game. At the moment I'm coding a simple game engine, and the game is just a demo. The game engine is C/C++ and various C/C++ libraries. I want to use LUA as the game scripting language (instead of Python, Ruby, QuakeC, etc) -instead- of hardcoded or compiled C/C++. The problem is I don't know to what extent to use LUA. I know some games (like WoW) only use it for the GUI, while other games like EVE use Python for much of the game, and games like Oblivion use scripting for NPCs, and other games use it for game world logic. Should I write the game section in C/C++ as well, and have LUA parsers for each different section (GUI, logic, controls, macros, etc). Or should I write almost the entire game section in LUA and all the game functions in the engine, or just some? The structure is like so: /Game Engine/ /Game Engine/Client/ /Game Engine/Client/Graphics/ /Game Engine/Client/Math/ /Game Engine/Client/Physics/ etc.. /Demos/ /Demos/Game Name/ /Demos/Game Name/Client/ Thanks in advance

Share this post


Link to post
Share on other sites
Advertisement
Your C++ engine should be a framework for your lua embedding. In this case you have certain entry points where you call lua functions and you have to provide a set of C++_to_Lua interfaces to access your engine content from a Lua script.

Example:
C++ Engine:
class Player
{
String mActionFunction="attack";

void doAction()
{
... call Lua script function mActionFunction ...
}

}


Lua Script:
attack = function()
..do some game logic...

-- play effect
CEngine.playeEffect("blood")
end


--
Ashaman

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!