I don't know why but my script does not update the value that is assigned to variable structure_count.
function STRU_dataBlockSegments()
local STRU_structures = {}
local structure_count = 1 -- value of that needs to be incremented
local STRU_struct_offset = 1
local STRU_structureNaming = {
[1] = "Structure ("..structure_count..") :Unknown: ",
[2] = "Structure ("..structure_count..") :Field offset: ",
[3] = "Structure ("..structure_count..") :Field amount: "
}
local STRU_block = STRU_dataBlockSize()
for i, v in ipairs(STRU_block) do
STRU_structures[#STRU_structures + 1] = {address = v.address, flags = gg.TYPE_BYTE, name = STRU_structureNaming[STRU_struct_offset]}
if STRU_struct_offset == 3 then
STRU_struct_offset = 1
structure_count = structure_count + 1 -- Should be incremented by one, however in the table STRU_structureNaming it remains 1.
else
STRU_struct_offset = STRU_struct_offset + 1
end
end
end
STRU_dataBlockSegments()
How do i access the table STRU_structureNaming and increment the value structure_count when condition is met?