lua-users home
lua-l archive

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


> Haw do I get out path or x,y,z from this table? 
> 
> EnemyList = {
>     
>     Enemy1 = {
>         path = ".\mesh\kock4.x",
>         x = 67,
>         y = 57,
>         z = 23
>     },
> 
>     Enemy2 = {
>         path = ".\mesh\kock2.x",
>         x = 10,
>         y = 1,
>         z = 45
>     }
> }
	Do you mean EnemyList.Enemy1.path?  Or a generic
way?  Something like:

function get (i, j)
	return EnemyList["Enemy"..i][j]
end

get (1, 'path')

	might give you the same result.
		Tomas