|
|||||||
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#61
|
||||
|
||||
|
Quote:
Code:
table = {145, 536, 2415}
Code:
table = {HP = 145, MP = 536, MS = 2415}
Code:
test = { {21, 22, 25, 22, 22, 23, 12, 12, 1, 1, 1, 1, 1, 1, 1},
{2, 4, 28, 2, 3, 4, 12, 12, 1, 1, 1, 1, 1, 1, 1},
{5, 7, 28, 5, 6, 7, 12, 12, 1, 16, 1, 1, 1, 1, 1},
{8, 10, 28, 8, 9, 10, 1, 1, 1, 1, 1, 1, 1, 1, 1},
{1, 21, 30, 23, 1, 1, 1, 1, 17, 1, 1, 16, 1, 1, 1},
{1, 1, 2, 3, 4, 1, 24, 22, 22, 26, 1, 1, 1, 1, 1},
{1, 1, 5, 6, 7, 1, 28, 2, 4, 28, 1, 1, 1, 1, 1},
{1, 11, 8, 9, 10, 1, 28, 8, 10, 28, 1, 1, 1, 1, 1},
{1, 11, 1, 1, 1, 1, 21, 22, 22, 23, 1, 1, 1, 1, 1},
{1, 11, 11, 11, 11, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
{1, 1, 1, 11, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}}
Another thing is how to best update a table like this without loading the images several times (which I noticed in my black jack actually steals resources even if it replaces the same variable): Code:
Enemy = {
{A = image.load("enemies/1A.png"),I = image.load("enemies/1I.png"),width = 22, height = 26,
HP = math.ceil(Health*(math.random(50,110)/100)), MP = 0, S = math.ceil(Strength*(math.random(50,110)/100)),
M = math.ceil(Magic*(math.random(50,110)/100)), D = math.ceil(Defence*(math.random(50,110)/100))} --enemy 1, Mistborn
}
Code:
for g=1,#Enemy do
Enemy[g].A:close()
Enemy[g].I:close()
end
dofile("enemylist.lua")
__________________
"If you are good enough at English to apologize, then there is no need to." - A good friend of mine Discovered something about the X-Fi2 you think others may not know? Post it here so others can learn about it! Have a question about X-Fi2 apps? Consult the FAQ before creating a thread about it. Like my work? Tell your friends. Don't like it? Tell me so I can improve. ^.^ |
|
|
|||
|
|
|
#62
|
|||
|
|||
|
Well it seems my work with exp is done :P Well done Brett_val!
...Perhaps I should now proceed to learn what a Lua table is... |
|
#63
|
||||
|
||||
|
It's not easy to come in as a beginner, but keep it up, you seem to know what you'redoing so just read up on stuff and you'll catch up in no time. *m not very experienced either, hence why I seek inspiration by listening to suggestions by other people. I really appreciate your contributions to this game. Keep it up, I like the ideas you have.
__________________
"If you are good enough at English to apologize, then there is no need to." - A good friend of mine Discovered something about the X-Fi2 you think others may not know? Post it here so others can learn about it! Have a question about X-Fi2 apps? Consult the FAQ before creating a thread about it. Like my work? Tell your friends. Don't like it? Tell me so I can improve. ^.^ |
|
#64
|
|||
|
|||
|
Hmm... so any other things you think I can contribute on? I quite like coding :P It takes my mind off the vicious amount of IGCSE homework I have to do
|
|
#65
|
||||
|
||||
|
Hm, well. There's of course a lot of coding to be done in the fight engine, but I've got it mostly figured out how I want it. i'm more in need of graphics and suggestions for enemies. Also easy missions you might have to solve for a boss (like navigate a labyrinth, find an object...)
One thing I could need is some enemy suggestions, and also with balancing. (as you see in the Enemy code above the "mistborn" can have a strength which is 50-110% of your's) I need some both easier and "stronger" opponents, but still well balanced so you wouldn't suddenly meet someone with 500% of all your stats. But there should be slight variations. I'm not sure if you get what I'm saying because I'm writing this in a bit of a hurry during lunch, I'm in the middle of doing research for our Uni project.
__________________
"If you are good enough at English to apologize, then there is no need to." - A good friend of mine Discovered something about the X-Fi2 you think others may not know? Post it here so others can learn about it! Have a question about X-Fi2 apps? Consult the FAQ before creating a thread about it. Like my work? Tell your friends. Don't like it? Tell me so I can improve. ^.^ |
|
#66
|
|||
|
|||
|
Hmm... if you post the full code for your 'mistborn' enemy, perhaps I can help you code some more (I know, I know... Easy much :P) without pictures...
I guess if you post the enemy code, they will all pretty much be the same thing, with different health and attack variables... am I right? Anyway, you need the elemental enemies, fire, water, earth, wind... there's a suggestion. *Edit: Elementals are pretty hard dude, maybe 100%-130% health, with an extreme amount of attack - not random. |
|
#67
|
||||
|
||||
|
You should make it like golden sun if youve ever played it, so you run around in a big world map and then when you get to a town or dungeon it zoom in to the actual size.
|
|
#68
|
|||
|
|||
|
Yea, i liked golden sun too. And world map was done well. It was in pseudo 3D (more like 2.5D) because gameboy didnt have 3D acceleration.
|
|
#69
|
||||
|
||||
|
S1M1S, the entire code for the Mistborn is up there. That is what I have so far for enemies. I forgot about the elemental aspect, if you've mentioned it before. I'm working on this pretty sporadically due to being busy with Uni, so I have about 3 half-finished features in progress, since I've only been able to quickly put in what's on my mind at the time.
Isquish/delirius, I have never played that game so I have no idea what you are talking about. Would you care to be a bit more specific? Though it sounds as if I'd have to remake my map handling if I used that idea, and depending on 'Six's status with the map editor it might be a bit late for any big changes there.
__________________
"If you are good enough at English to apologize, then there is no need to." - A good friend of mine Discovered something about the X-Fi2 you think others may not know? Post it here so others can learn about it! Have a question about X-Fi2 apps? Consult the FAQ before creating a thread about it. Like my work? Tell your friends. Don't like it? Tell me so I can improve. ^.^ |
|
#70
|
||||
|
||||
|
Quote:
And Habhome, in response to your post: You can save that two dimensional table to a file and load it from there, if that's what you mean. I did it with this command I recently found, it's very helpful to walk through tables: Code:
for key,value in pairs(table1) do print(key..": "..tostring(value)) end If you do mean you want to save different variations of tables to a file, I can try to work out a script that can handle all the examples you quoted, it's just that the second example causes some problems and I have to try some more to get this recognized by a save/load-script. Next issue: To exchange images from a table I used a substitute table, like this: (in my gta game) subst[1]=cars[1] cars[1]=subst[2] If the files are not too big you can build a substitute table with all the enemy images and exchange them from there. But if they are too big, I don't see a better way than you are already doing; closing the images and loading new ones. And yeah I also noticed that you have to close the specific files, just replacing them with another will not unload them and they'll still be in the memory. I'm not sure if I understood the problems correctly and if this was of any help, so if it's not, please explain and I'll try something else.
__________________
this is a link to my personal homepage which I haven't |
|
#71
|
||||
|
||||
|
That saving thing for my map layout sounds very interesting. The reason I want it is because I want to be able to have manipulatable objects in the map, and I want it to remember the changes you have done to it. It might not be really super necessary, it depends on what you people think. But I know that it can cause bugs if it resets stuff you've moved, you could end up on a rock, in a tree, etc.
And I'm not really following the substitute method, might be because my brain is in Shooting mode since I'm at the Junior Swedish championships atm. Could you explain it a bit better? I think it would work very well since I will be having all the images loaded in a table, the Enemy table as you can see in an earlier post. Because they won't be too big for that.
__________________
"If you are good enough at English to apologize, then there is no need to." - A good friend of mine Discovered something about the X-Fi2 you think others may not know? Post it here so others can learn about it! Have a question about X-Fi2 apps? Consult the FAQ before creating a thread about it. Like my work? Tell your friends. Don't like it? Tell me so I can improve. ^.^ |
|
#72
|
|||
|
|||
|
When the game will be released?
|
|
#73
|
||||
|
||||
|
read this post
Quote:
|
|
#74
|
||||
|
||||
|
Quote:
![]() Since all the map-tables probably have the same structure you can keep it simple, here is the smallest I could come up with to save your testmap and load it again from test.lua: Code:
--save map to file
i=0
datawrite=io.open("test.lua","w+")
for key in pairs(testmap) do
i=i+1
for key,value in pairs(testmap[i]) do
datawrite:write(value .. ",")
end
datawrite:write("\n")
end
datawrite:close()
-- build the table from the savefile
testmap={}
i=0
for lines in io.lines("test.lua") do
i=i+1
table.insert(testmap,{}) --insert secondary table
b=1 --startingpoint of cel
for a=1, string.len(lines) do
if string.sub(lines,a,a)== "," then -- look for commas and insert the stuff before the comma in the table
table.insert(testmap[i],tonumber(string.sub(lines,b,a-1)))
b=a+1 --save new startingpoint of cel
end
end
end
io.close()
Another more universally usable possibility would be to rebuild the whole table={{},} structure in the savefile, just walk through the whole table and write the contents to a file. I had some fun with that and it seems to work pretty well, and you can just use dofile() to load it. But again it doesn't seem to work for images and waves... but there's an easy workaround for that by adding those afterwards. And about the enemies, do you mean you want to change the image but still have it in the same cell/place in the table? I think that just closing the cell and loading a new one into it would work.. Or if you want to save loading-time, have them preloaded in another table and copy them from there. That's what I meant with my gta example. I think the files in a table are loaded into the memory when you build the table (the moment you call image.load()), and the cell only holds the memory-address (a print(table.img) shows this address). You can copy this address around and the memory-space will be unchanged until you close it. I also noticed this when I tried to juggle wave-files while playing with that music app in another thread. I wasn't sure what you meant by "update the table", but you want to give it new images to make some animation happen or something? I can't really help with enemy suggestions, RPGs are not really my kind of genre.. don't have much experience with it. By the way what kind of Shooting championships are that? ![]() Attached is the function I came up with, you don't have to use it but it's just to show how I tried to detect the different types of information in a table and save that in a usuable way. It works up to two dimensions. I can try and make something specific for your needs/data so it'll be a bit more efficient.
__________________
this is a link to my personal homepage which I haven't Last edited by Brett_val; 09-12-2010 at 12:13 PM. Reason: Added function |
|
#75
|
||||
|
||||
|
are you almost done with it?
__________________
I wUz he3R
|
|
#76
|
||||
|
||||
|
No, not yet. As I said Uni made me much busier than I expected so I have almost no dev time. I barely have much free time at all and what little I have I need to use for more important stuff, unfortunately. But it is slowly progressing.
__________________
"If you are good enough at English to apologize, then there is no need to." - A good friend of mine Discovered something about the X-Fi2 you think others may not know? Post it here so others can learn about it! Have a question about X-Fi2 apps? Consult the FAQ before creating a thread about it. Like my work? Tell your friends. Don't like it? Tell me so I can improve. ^.^ |
|
#77
|
||||
|
||||
|
when release the game?
|
|
#78
|
||||
|
||||
|
Please read the thread before you post. This question has been answered two times on this page already.
__________________
this is a link to my personal homepage which I haven't |
|
#79
|
||||
|
||||
|
Quote:
|
|
#80
|
||||
|
||||
|
Thanks Brett and Robs for always standing up for me.
As for you, follow their advice. I am really flattered that people are waiting in anticipation for this, but as I have stated before, I am currently VERY busy with other things in my life which are far more important than this. (Family, Formal education, Keeping my life in one piece, etc) If people keep trying to push questions like this I might decrease the time I work on this even more, I'm getting sick and tired of trying to please everyone in my surroundings. ---- On another note, I'm re-installing my rig with Windows 7 tomorrow, and yes, I've thought of backing up all my programming projects So no need to worry about that. Just a side note.
__________________
"If you are good enough at English to apologize, then there is no need to." - A good friend of mine Discovered something about the X-Fi2 you think others may not know? Post it here so others can learn about it! Have a question about X-Fi2 apps? Consult the FAQ before creating a thread about it. Like my work? Tell your friends. Don't like it? Tell me so I can improve. ^.^ |
![]() |
| Tags |
| creative, habhome, lua, neko apprentice, rpg, xfi2, zen |
«
Previous Thread
|
Next Thread
»
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
All times are GMT -5. The time now is 07:07 PM.












. I found that tables are really handy to handle a lot of data with the least amount of coding lines.


Linear Mode
