Best way to manage and edit tables in a RPG style game

I’ve been struggling with this concept for quite a while, I’ll make some progress and then seem to hit a wall. Hopefully I can be clear here and get some help.

as the title of the topic states, I have a rpg style game.

I have one table (myData) that is what I consider the master table. This table holds all my character, their stats, and equipment.

for example it looks like this, the example only shows 3 characters, but it goes up to 8.

local myData = { [1] = {name = "Blair", image = "Images/AR.png", frame = 3, active = false, class = "Warrior", level = 10, curExp = 0, expToNextLvl = 100, maxHealth = 100, health = 100, strength = 10, armor = 10, speed = .12, weaponEquip = equipInventory[1], shieldEquip = equipInventory[2], trinket1 = equipInventory[3], trinket2 = equipInventory[3], }, [2] = {name = "Lily", image = "Images/CG.png", frame = 4, active = false, class = "Rogue", level = 5, curExp = 0, expToNextLvl = 100, maxHealth = 100, health = 100, strength = 10, armor = 10, speed = .16, weaponEquip = "none", shieldEquip = "none", trinket1 = "none", trinket2 = "none", }, [3] = {name = "Kylianna", image = "Images/AP.png", frame = 2, active = false, class = "Mage", level = 6, curExp = 0, expToNextLvl = 100, maxHealth = 100, health = 100, strength = 10, armor = 10, speed = .12, weaponEquip = "none", shieldEquip = "none", trinket1 = "none", trinket2 = "none", }, }

The next table I have is what I call activeParty. This table holds the 4 active characters. this is used for when levels load and helps the game know what characters are being used etc. This table looks exactly like the myData table, but it is strictly 4 slots in the table for the active party to be used.

this is where things seem to get sticky. using the activeParty table, I have a screen for equipping items to the hero’s. When the equip screen loads, the 4 heros in the active party table are loaded and I am trying to figure out how to get the equipment to work.

I have a third table called equipInventory. this holds all items that are held in the players inventory (not currently equipped).

this table looks something like this

local equipInventory = { [1] = {name = "slot1", frame = 4, description = "Weapon", class = "Warrior", itemLevel = 1, strength = 5, armor = 0, plusHealth = 0, plusSpeed = 0, }, [2] = {name = "slot2", frame = 2, description = "Armor", class = "Warrior", itemLevel = 1, strength = 0, armor = 5, plusHealth = 0, plusSpeed = 0, }, [3] = {name = "slot3", frame = 3, description = "Trinket", class = "Warrior", itemLevel = 1, strength = 0, armor = 0, plusHealth = 0, plusSpeed = 0, }, }

The idea is that I want to take an item from the equipInventory and put it into the activeParty table and also the myData table.

one last table that I am using is for the character that is selected to have items equipped during the equipment screen. this table is called equipEdit, once again, this table looks just like active party and myData, but the idea is to make changes to the equipEdit table and then at once, move the info from that table into activeParty and myData…

I hope this jumble makes any sense and someone could help out or point out a link to an already functioning inventory equip that may be out there

This might help you:

https://codeponies.wordpress.com/2013/10/15/an-rpg-themed-oop-design-pattern-for-corona-sdk-part-1/

This might help you:

https://codeponies.wordpress.com/2013/10/15/an-rpg-themed-oop-design-pattern-for-corona-sdk-part-1/