I seem to be having rather a lot of trouble over this, and I'm not sure why...

In order to load maps and things I've been needing to clear the level of everything previously generated on it. (Monsters, features, objects, traps).

I have no trouble at all with the monsters, features and traps, but I can't seem to delete the objects effectively.

I tried "scanning" through the level, and setting "cave(y,x).o_idx = 0" for each grid. This works the first time, and there are no objects visible on the level. However, when I then save and exit, then reenter, the objects are there again.

(This ties in with this topic on level generators, as being able to define a level generator for just one level would mean that I could tell it not to generate objects at all.)

Any help appreciated -- TheFalcon

---

TheFalcon: fixed now. :) I was just being silly and deleting the object index from the cave array, rather than the actual object. I found the function delete_object_idx(cave(j,i).o_idx), which seems to work nicely (well, it solves the problem).

Module Developers Discussion/removing objects from the floor (last edited 2006-02-12 16:31:41 by TheFalcon)