What if we could make variables that are set up like players[].x/y/dir/hearts/soon? This would make so many things so much easier. Instead of looping through all of the npcs or players looking for something that must be in common for player-made bombs or such. We could just loop through the correct array variable. It could used with the putnpc command, and work the same as in java. You would put the variables of an npc in the .txt file and you could access them through filename[index].variable. For instance, a new bomb;
newbomb.txt-
NPC Code:
if (created) {
fuse = 5;
power = 2;
radius = 2;
timeout = .1;
}
and_the_bomb_script;
the x and y would be automatic, since they are set when you put the npc.
then lets say that you want to do something with the bomb, no problem! Just access the bomb's variables;
newbombscount
newbombs[index].x
newbombs[index].y
newbombs[index].fuse
newbombs[index].radius
and go to town!