 |
forums.ps2dev.org Homebrew PS2, PSP & PS3 Development Discussions
|
| View previous topic :: View next topic |
| Author |
Message |
Danny769
Joined: 01 Feb 2006 Posts: 55
|
Posted: Fri Apr 28, 2006 10:40 am Post subject: Array? Extraction |
|
|
Ok here it the deal im making an array for a class cits
Cits need (HP,Wood,Food,Gold,Stone,Qunity,X,Y)
Ok now my question is, what is the code to extract a single cell, and to write to a single cell in an array
The Folling Is an Example of my Array
| Code: | a, b, c, d, e, f, g, h = 0
Cit = {}
for a = 0, 20 do
Cit[a] = {}
for b = 0, 20 do
Cit[a][b] = {}
for c = 0, 20 do
Cit[a][b][c] = {}
for d = 0, 20 do
Cit[a][b][c][d] = {}
for e = 0, 20 do
Cit[a][b][c][d][e] = {}
for f = 0, 20 do
Cit[a][b][c][d][e][f] = {}
for g = 0, 20 do
Cit[a][b][c][d][e][f][g] = {}
for h = 0, 20 do
Cit[a][b][c][d][e][f][g][h] = {}
end
end
end
end
end
end
end
end |
|
|
| Back to top |
|
 |
Danny769
Joined: 01 Feb 2006 Posts: 55
|
Posted: Fri Apr 28, 2006 11:09 am Post subject: |
|
|
http://www.evilmana.com/tutorials/lua_tutorial_05.php
sorry about that but i found what i wanted
Cit = {}
Cit[1] = { HP = DefaultHP, Wood = 1, Gold = 0, Stone = 0, Food = 0, Qunity = 100}
Cit[2] = { HP = DefaultHP, Wood = 1, Gold = 0, Stone = 0, Food = 0, Qunity = 100}
Cit[3] = { HP = DefaultHP, Wood = 1, Gold = 0, Stone = 0, Food = 0, Qunity = 100}
Cit[1].HP = Cit[1].HP - 10
Ok i get it now Sorry about that |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|