Posted: 13th Oct 2003 1:27
This is useful if you want to know if you have already created an object, sprite, image or something. Just throw this in after you load/create anything, and dont put it in the loop

+ Code Snippet
   if file exist("exist.txt") then delete file "exist.txt"

   open to write 1,"exist.txt"
      for i=1 to 100
         if object exist(i)
            write string 1,"Model: "+str$(i)
         endif
      next i

      write string 1," "

      for j=1 to 100
         if image exist(j)
            write string 1,"Image: "+str$(j)
         endif
      next j

      write string 1," "

      for k=1 to 100
         if music exist(k)
            write string 1,"Music: "+str$(k)
         endif
      next k

      write string 1," "

      for l=1 to 100
         if sound exist(l)
            write string 1,"Sound: "+str$(l)
         endif
      next l

      write string 1," "

      for m=1 to 100
         if matrix exist(m)
            write string 1,"Matrix: "+str$(m)
         endif
      next m

      write string 1," "

      for n=1 to 100
         if sprite exist(n)
            write string 1,"Sprite: "+str$(n)
         endif
      next n

   close file 1


Yes I know you can make your own loading function, but hey, now you get a cool file to look at This will overright any existing 'exist.txt' files that are in the same directory as your code. I take no responsibility if you lose a big text document name exist.txt!!

RPGamer
Posted: 13th Oct 2003 4:59
Updated Version: Now shows which slots arent used, and makes the text file look all perrrrrrty

+ Code Snippet
 if file exist("exist.txt") then delete file "exist.txt"

   open to write 1,"exist.txt"

   write string 1,"         Models         "
   write string 1,"------------------------"
   write string 1," "
      for i=1 to 100
         if object exist(i)
            write string 1,"Model: "+str$(i)
            else
            write string 1,"OPEN: "+str$(i)
         endif
      next i

      write string 1," "

   write string 1,"         Images         "
   write string 1,"------------------------"
   write string 1," "
      for j=1 to 100
         if image exist(j)
            write string 1,"Image: "+str$(j)
            else
            write string 1,"OPEN: "+str$(j)
         endif
      next j

      write string 1," "

   write string 1,"          Music         "
   write string 1,"------------------------"
   write string 1," "
      for k=1 to 100
         if music exist(k)
            write string 1,"Music: "+str$(k)
            else
            write string 1,"OPEN: "+str$(k)
         endif
      next k

      write string 1," "

   write string 1,"         Sounds         "
   write string 1,"------------------------"
   write string 1," "
      for l=1 to 100
         if sound exist(l)
            write string 1,"Sound: "+str$(l)
            else
            write string 1,"OPEN: "+str$(l)
         endif
      next l

      write string 1," "

   write string 1,"        Matrices        "
   write string 1,"------------------------"
   write string 1," "
      for m=1 to 100
         if matrix exist(m)
            write string 1,"Matrix: "+str$(m)
            else
            write string 1,"OPEN: "+str$(m)
         endif
      next m

      write string 1," "

   write string 1,"         Sprites        "
   write string 1,"------------------------"
   write string 1," "
      for n=1 to 100
         if sprite exist(n)
            write string 1,"Sprite: "+str$(n)
            else
            write string 1,"OPEN: "+str$(n)
         endif
      next n

   close file 1
`------------------------------------------------------------


RPGamer
Posted: 13th Oct 2003 13:46
It would probably be better to create a new file format like a .xst or .mef (media existence file?) so its not confused with any .txt files. Maybe.