So I’ve hit a slight snag with the way my project works in a certain area (and admittedly I may just change the way it works).
I have a part of my code that, for simplicities sake doesn’t repeat through a table, but checks row 1.
choose row 1 in the Table of Enemy Items;
It then does an if to see if a Item Name entry either is not there, or is but contains “”…
if that row is empty or contains an empty string, skip item distribution.
if there is text, there’s an item waiting to be distributed so do so.
This table is empty in code:
Table of Enemy Items
Enemy(text) Item Name(text)
with 30 blank rows
it’s populated during game play using:
choose a blank row in the Table of Enemy items;
Now Enemy entry is "Bob";
Now Item Name entry is "Gold";
The issue is, this table gives items out to enemies and such, as it does so, i want to clear out that particular entry.
So, if for example Gold gets given to Bob, then as that takes place, I do a repeat through, find Gold in the Item Name row, and now I want to effectively delete that row.
Straightforward you would say.
Use:
Blank out the whole row;
That screws up my if check though because now if any items in rows 2,3,4,5,6 etc are filled in…because row 1 is now “” “”, it assumes there’s nothing in there so no further items get distributed.
Solution I will most likely do is instead of choosing row 1, I will have to repeat through and check all rows.
The reason for the post though is…if you’re building a table dynamically…is there no way to actually DELETE a row?
The issue being…let’s say we have the following table…built dynamically in game…
Table of Items
Item Name Room
Hammer Garage
Saw Shed
Wrench Bedroom
As it works in my code…
The moment Hammer gets moved, the table becomes…
Table of Items
Item Name Room
"" ""
Saw Shed
Wrench Bedroom
What Ideally I want is row 2 to become row 1, so now theres only 2 entries in the table, not 3, where one of the 3 is now blanked out.