you dont need to.
For eg.
sourcemonster=loadmesh ("mysourcemonster")
This would be loaded and never disposed of.
Then, when you want to add say a monster or a load of trees or something:
createmonster(sourcemonster,100,0,100)
To delete all monsters when changing level:
Obviously for large unique items like the main level mesh and music etc you use a global and can clean this as normal with a simple:
For eg.
sourcemonster=loadmesh ("mysourcemonster")
This would be loaded and never disposed of.
Then, when you want to add say a monster or a load of trees or something:
createmonster(sourcemonster,100,0,100)
function createmonster(sm,x,y,z) ; m.monster=new monster m\hand=copyentity(sm) m\startpositionX=x m\startpositionY=y m\startpositionZ=z etc... end functionTo delete a monster data item ie, has been killed:
freeentity m\hand:delete mThis will not only delete the 3d resource but the entire "record" (m) in the datastructure (assuming m.monster is locally valid)
To delete all monsters when changing level:
for m.monster=each monster freeentity m\hand delete m next
Obviously for large unique items like the main level mesh and music etc you use a global and can clean this as normal with a simple:
freeentity (G_mainlevelmesh):G_mainlevelmesh=0Its always a good idea to reset the vars value to 0 as you can still use "if NOT myhandle then.... " to detect any non loaded resources (to avoid potential MAVs ).