Jump to content
  • Advertisement
Sign in to follow this  
ididntdoit

lua as a database?

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

Im not sure how to correctly (properly?) implement this, but I have (in C# code, in a console (text based) MUD like app) a loooooong list of what I call "entities" (NPCs, weapons, terrain info etc...). Im thinking it would be better to have this list in an external Lua script. ( I <3 Lua ) How else could this be done?

Share this post


Link to post
Share on other sites
Advertisement
I'm assuming you mean instances of entities, not their class definitions.

put them in an actual database. it'd be much cleaner and more robust than a hacked together lua script.

-me

Share this post


Link to post
Share on other sites
"I'm assuming you mean instances of entities, not their class definitions."

The actual data, similar to the following :

weapon1name=axe
weapon1damage=2
weapon1speed=4

weapon2name=sword
weapon2damage=1
weapon2speed=7

etc.....

Probably a horrid way to do it, but hey its what occured to me 1st and I havent seen any better way yet. It works, similar to chopping down a tree with a sledgehammer.

"put them in an actual database" - you mean like using MySQL? Interesting...

Share this post


Link to post
Share on other sites
Quote:
Original post by ididntdoit
"put them in an actual database" - you mean like using MySQL? Interesting...


heh. yes. unsurprisingly, the best answer to "what should I use as my database" is "a database" [smile]

Especially given the generic-ness of your data, a database is perfect. Robustness and ease of use aside you get other benefits. Like being able to trivially write a little PHP page or C# app or whatever to enter new items into your database.

-me

Share this post


Link to post
Share on other sites
K, its going to feel weird using SQL in a game but hey, if it works nicely Im all for it.

/now to put brushing up on SQL on my call stack....

(this issue is resolved)

Share this post


Link to post
Share on other sites
Have a look at SQLite. It's much more lightweight than something like MySQL. I'm sure someone must have created bindings for C#, by now.

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!