[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Getting values in C++ from a Lua table
- From: Jose Marin <jose_marin2@...>
- Date: Wed, 21 Apr 2004 16:18:33 -0300 (ART)
Thanks for the tip!
I would like to have Lua files with configurations for
my game. For example:
In "enemy.lua"
enemy = {
{
name = "ogre",
health = 30,
skill = 10,
sounds = { "ogresond1", "ogresound2"},
},
{
name = "orc",
health = 10,
skill = 20,
sounds = { "orcsond1", "orcsound2"},
}
-- and so on
}
In C++, I have this struct
struct CEnemy{
string name;
int health;
int skill;
string sounds[MAX_SOUND];
}
CEnemy EnemyList[MAX_ENEMY];
My problem is how to use the file "enemy.lua" to fill
the struct EnemyList.
______________________________________________________________________
Yahoo! Messenger - Fale com seus amigos online. Instale agora!
http://br.download.yahoo.com/messenger/