Saving Entities into files?

Posted By: RedPhoenix

Saving Entities into files? - 08/14/07 11:03

I would be very glad for a function that allows to save a entity (model terrain for example) to a file, like it is already possible to save bmaps with bmap_save. This would be very helpful for saving ingame changes like mesh_manipulation or skin changes at the entities and using the changed files outside of the engine.
Posted By: bstudio

Re: Saving Entities into files? - 08/14/07 13:14

This would be handy indeed.
Posted By: FBL

Re: Saving Entities into files? - 08/14/07 13:17

You could easily write a script wich saves all important values to a file and then re-deforms the model based on the values you stored.
Posted By: Thomas_Nitschke

Re: Saving Entities into files? - 08/14/07 18:16

Except that would probably take quite some time when talking of large models, for instance models used as terrains.
I'd definitely like a function to re-save models in their altered state. Since MED can save MDLs, it should be possible to give the very same ability to A6 (<-- ! ) as well, should'nt it? Or am I mistaken here?
Posted By: Metal_Man

Re: Saving Entities into files? - 08/27/07 05:06

I agree. It would make it easier to create a built-in level editor. There are, I suppose, other purposes...
Posted By: jcl

Re: Saving Entities into files? - 08/27/07 09:54

Saving models and terrain is supported since a long time in the MED SDK.
Posted By: RedPhoenix

Re: Saving Entities into files? - 08/27/07 10:05

Yes I know this, but that's a little bit complicated for those of us who are not perfect with C++, I guess. At least I have no idea how to set it up (I read all the sdk files and the fileformat docs).
I just wanted to ask whether this could be added as a simple function like bmap_save to the liteC function list. This would be much more easier then.
Posted By: jcl

Re: Saving Entities into files? - 08/27/07 11:00

It could, but model saving functions are almost exclusively used for creating model editors. For this you'd need the SDK anyway. Implementing them in the engine would make the engine unnecessarily big, and requires to add an awful lot of data structures for meshes, bones, and so on. So model saving functions are more suited for a SDK than the engine itself.
Posted By: Thomas_Nitschke

Re: Saving Entities into files? - 08/27/07 13:57

I have to agree, that sounds logical. Now, suppose you could make these functions available in an easy to use way using a script file or something similar? I think it would make a great addition for non-professionals not so familiar with C/C++ to be able to save their freshly altered models from the running engine. So, by means of not overweighting the engine itself, you could provide these functions in a dll and provide a template script or something of the kind that makes them easier to use.
More clearly, what I am thinking of is something like that:

Code:

#include "i-want-to-save-my-models.c"

void doSomeKindOfMeshDeforming()
{
//move around vertices etc. from a loaded model
ent_savefile( "myAlteredModel.mdl" );
}





...and that would be about it. Something this easy to use would be enormously useful. From my experience, you rather often tend to use the functions for mesh deforming and those things and end up with good results that you want to use next time you start up your level. Since there is no way to save the modified entity, however, you will finally have all vertex positions written to a textfile and deform the entity at level start according to that data.
This is rather not so surprisingly not the fastest method. It would open up a whole range of possibilities being able to easily save altered entities to MDL files.
© 2024 lite-C Forums