Game Development Community

FileDelete causes problem with resources

by Spider · in Torque Game Builder · 08/10/2007 (5:55 pm) · 2 replies

It seems like the fileDelete function doesn't remove files from the internal filelist.
This causes problems when you remove a resource from your project, then add it again. (This situation comes up when you accidentally mess up a resource and want to restore it to its original form. When you do the re-add, the editor thinks the resource is still there so it doesn't copy the files over again. However, the version in the tgb folder IS exec'ed so it looks like you have your resource, and you can use it as normal. Next time you load your game, though, you don't actually have those resources so lots of stuff is messed up!

#1
08/20/2007 (5:12 pm)
Spider,
Can you give me a solid repro case for this, what happens versus what you expect, using a standard resource as an example?

e.g. Add Fish resource,change sprite, remove it, notice X.

Thanks,
-Justin
#2
08/21/2007 (3:12 pm)
1) Add Fish Resource
2) Remove Fish Resource
3) Add Fish Resource

The fish resource files are not copied to your project. Torque thinks the files are still there, because during step 2, fileDelete doesn't update the internal file list to reflect the files being gone.