Garrulous Glaahk Isaac Posted April 10, 2004 Share Posted April 10, 2004 I wouldn't do this in a normal scenario, but here's my troublesome code. It's supposed to destroy all of the party's items, equipped or in their pack. It seems to only destroy equipped items. Code: i = 0;while(i < 40) { j = 0; while(j < 4) { if(char_ok(j)) destroy_char_item(j,i); j = j + 1; } i = i + 1;} Link to comment Share on other sites More sharing options...
Garrulous Glaahk spyderbytes Posted April 10, 2004 Share Posted April 10, 2004 Total shot in the dark here, but could it be choking on empty slots? I'd try putting a check to make sure there's something in the slot in front of the destroy_char_item() call, to see if that helps. If not, it definitely seems like a bug in either the implementation or documentation of the call... -spyderbytes EDIT: Left out a word. Link to comment Share on other sites More sharing options...
Garrulous Glaahk Isaac Posted April 10, 2004 Author Share Posted April 10, 2004 I tried putting in a check for that, but it still doesn't work: Code: i = 0; while(i < 40) { j = 0; while(j < 4) { if(char_ok(j)) if(item_type_in_slot(j,i) != -1) destroy_char_item(j,i); j = j + 1; } i = i + 1; } Link to comment Share on other sites More sharing options...
Well-Actually War Trall Spidweb Posted April 12, 2004 Share Posted April 12, 2004 When you remove an item in a pack, all items above it shift down. So if you destroy item 18, say, item 19 shifts down into 18's spot. - Jeff Link to comment Share on other sites More sharing options...
Hatchling Cockatrice Lilith Posted April 13, 2004 Share Posted April 13, 2004 Ah, of course. The first pack slot is #13, right? So all the script has to do is destroy all equipped items, then repeatedly check if there's an item in slot 13 and destroy it. Link to comment Share on other sites More sharing options...
Recommended Posts