Here is a piece of code I wrote
global script main_script {
void run() {
item drop;
item itm_1;
item itm_2;
item itm_3;
item itm_4;
item itm_5;
int item_num = 1;
while(true) {
if (item_num <= Screen->NumItems()) {
drop = Screen->LoadItem(item_num);
if (drop->Tile == 31165 && drop->CSet != 0) {
drop->Tile = 0;
drop->CSet = 0;
itm_1 = Screen->CreateItem(150);
itm_1->X = (drop->X-4)+Rand(8);
itm_1->Y = (drop->Y-4)+Rand(8);
}
item_num += 1;
}
else { item_num = 1; }
Waitframe();
}
}
}
The bug shows up here:
if (drop->Tile == 31165 && drop->CSet != 0) {
drop->Tile = 0;
drop->CSet = 0;
itm_1 = Screen->CreateItem(150);
What it SHOULD do is:
load each item on the screen (does that fine)
check the tile and cset of each item (here is where the problem is, i'll explain)
then change the tile and cset of the item (that works)
now, when it loops again, the tile = 0 and the cset = 0
BUT the if statement does not seem to respond to that
so it just keeps on creating item id# 150
Now, like I said this is a possible bug. I would like some of the codeing experts to look at this and test it for themselfs to make sure i din't do shumptin stupid :googly: