Game Development Community

removing png from txb

by Serkan Agdelen · in Torque X 2D · 11/04/2009 (8:37 pm) · 4 replies

hi to all,

i am developing a game with torquex 3.0 + VS2008,
i finished my game a month ago and it is working well,
but now i decide to make some revisions with its graphics,
for example i had a sharkAnim.png file and in the builder,
some animation using it, now i added another file sharkAnim02.png
and made some animation with it, and using that animation from now on,
up to now there is not any problem,

but when i try to delete the old one from builder, its deleted without
any problem, when i looked at the content/image folder from VS2008 i
saw sharkAnim.png file isnt deleted from there, before i delete it
i build the game and play, no problem again,
after that i right click the image and excluded it from the project,
then i build the game, no build errors,
i run the game, when it starts loading it gives this error:
"SceneLoader.Load - Error loading XML file: 'data\levels\game.txscene', ContentLoadException: 'Error loading "data\images\sharkAnim". File not found.' If you are using TXB, make sure that you saved your project, then rebuild your game in Express.


as far as i understand, game tries to load a png that isnt exist in the builder,
and this means that i cannot really remove any sprite once i add it,
and logically this doesnt make any sense, i wish i missed something,

can you tell me how i remove a png from the builder and from VS2008 also?

Thx in advance

Serkan AGDELEN

#1
11/04/2009 (8:51 pm)
continues...

after i get that error, i stop debugging the game, and open TXB, i checked, there arent any sharkAnim material or any animation relating to it, without changing anything i clicked the save button and then VS said "The Project 'Content (data)' has been modified outside the environment. Do you want to load it now?" i clicked yes,
it loads it, at the same time TXB crashed giving classic ContentNodeGenerator.exe error, then i looked at the images folder,
the png that i removed from everywhere is still there.

S.
#2
11/04/2009 (9:40 pm)
Welcome to the funderful world of removing art assets in txb! :)

It's a bit of a pain in the butt really (a one click solution would rock, but there isn't one that I know of). TXB saves the art asset information to every scene file[1] regardless of whether you need it or not. It also saves it in the tx project file.

You need to remove the image from VS - right click on it and 'delete'. Then you need to remove all the references to the image in your scene files and in the tx project file. I would usually just do a multiple file search on the image name using VS to find where it is being referenced and remove it from the xml by hand.

Be sure to also remove any animations that reference the image as well - they are also in all the scene files and the tx project file.



[1] if a scene file was last edited before you added image X then image X obviously won't be referenced by that particular scene file. but next time you edit that scene file then image X will be added to it as soon as you save it.
#3
11/05/2009 (3:42 pm)
Thanks for your reply Duncan,

i will try this technique and let you know if it works for me,

S.
#4
11/07/2009 (3:33 pm)
This needs to be fixed in the next versions of TorqueX. In fact I think we need a complete rewrite of Torque Builder completely and get away from the old TGB code base.