lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


I am making a module for T-Engine 4. The engine uses Lua with a smattering of C, while the modules are pure Lua.

The source code for the module is here: https://github.com/Zireael07/The-Veins-of-the-Earth

The list of issues is also available on git.
Any contributors would be welcome.
***
And now for the meat of this mail:

I haven't updated the side branches in quite some time, but the thing I am having most problems with is a kill count.

Every time a creature dies, this snippet is executed:

if src and src.player then
                player.all_kills = player.all_kills or {}
                player.all_kills[self.name] = player.all_kills[self.name] or 0
                player.all_kills[self.name] = player.all_kills[self.name] + 1
        end     

So it stores every kill in a table entry named after the creature killed.

I've tried to display the kill count in various ways, but none work.

The idea is to have

"orc -".. player.all_kills[orc]
without hardcoding it for every creature possible in my game.

Heelp?