Important Message

You are browsing the archived Lancers Reactor forums. You cannot register or login.
The content may be outdated and links may not be functional.


To get the latest in Freelancer news, mods, modding and downloads, go to
The-Starport

Single mesh -> Multiple mesh VMeshData/Ref converter uplo

Here you can find the postings on the different editing utilities found for Freelancer

Post Thu Jul 24, 2003 8:04 am

Single mesh -> Multiple mesh VMeshData/Ref converter uplo

This is a command line utility that reads in a VMeshData and VMeshRef segment then outputs a new VMeshData segment and the relevant number of VMeshRef segments for you to import into a FL .cmp file.

Basically it removes the hassle of hex editing from this tutorial which describes how to manually convert a single mesh .cmp into one with multiple components.

Multiple components are required for ships having destructable parts/bay doors, custom weapon models, jumpgates that open and docking bay doors on stations.

At the moment this is very basic. You must export your model from milkshape as normal, making sure that each component is a separate group. Once you have done this open up the .cmp file and export the VMeshLibrary -> yourmodelname.lod0.vms -> VMeshData node and the yourmodelname.3db -> Multilevel -> Level0 -> VMeshPart -> VMeshRef node to separate file e.g. to two files called 'VMeshData' and 'VMeshRef'.

Move these files to the directory where you have the converter (i.e. the directory where you have put the file meshconv.exe). Now run the converter, the syntax is :

meshconv VMeshData_filename VMeshRef_filename

So if you used the filenames from above you would type :

meshconv vmeshdata vmeshref

It exports the new VMeshData segment to a file called 'newvdata' and the VMeshRef segments to files called 'meshref1', 'meshref2' etc. If these files already exist they will be overwritten. The 'meshrefX' files will go up to 9 then start being called 'meshref:' etc so dont use more than 9 meshes. I will sort this soon but dont really see any need for that many meshes so its not a priority.

You then have to import the new VMeshData segment into your .cmp in place of the old one. You will have to import the VMeshRef segments into the relevant xxxxxx.3db -> Multilevel -> Level0 -> VMeshPart -> VMeshRef (as you only have one .3db node to start with you will have to make new ones manually, unless you are using a game .cmp as a template).

Anyway thats a bit off topic, for more info on the .3db nodes etc. see the above tutorial link. Downloading the Battleaxe and using its .cmp as a template will allow you to easily see if a ship with multiple components is working.

As i said, this is a very basic version. Ultimately i hope to get it to read in the .cmp and do all the converting automatically, outputting a new .cmp with the relevant nodes all in place. Possibly with options for it to create Fix/Rev/Pris nodes for you aswell.

For the time being this will have to do Remember it is very simple and not designed to cope with all sorts of crazy input. If you give it valid VMeshData and VMeshRef it should work fine tho.

Edited by - redeye on 25-07-2003 18:50:21

Edited by - redeye on 31-07-2003 21:14:36

Post Thu Jul 24, 2003 10:41 am

Hi,
I make some researching about correctly ship viewing.

VMeshRef
{
dword 0x3c
dword VMeshID
word start_vert
word end_vert
word start_vert_reference
word end_vert_reference
word mesh_number
word number_of_meshes

float bounding_box[6 (minx, maxx, miny, maxy, minz, maxz)
float unknown[4
}

array of variables "unknown" is important for ship view, when HpMount Hardpoint is out of screen.

Example: proportions of TIE Avenger is 3 x 4 x 10m.

float bounding_box[6 (0.0, 3.0, 0.0, 4.0, 0.0, 10.0)
float unknown[4 (0.0, 0.0, 0.0, 10.0)


My researching is in progress, but its work. :-)

Sorry ... my english ...

Arachno

Post Thu Jul 24, 2003 2:51 pm

Interesting.

I had ignored the bounding box and unknowns as i couldnt see any difference if you removed them from the game ships. HCls exporter writes them as all 00's and this converter only modifies the start/end vertex/vertex_reference numbers and the mesh_number/number_of_meshes bits. Everything else is left the same.
Keep me up to date with any information you get.

Remember the end_vertex number is actually the number of vertexes that component uses and the end_vertex_reference number is actually how many vertexes that component references.

Post Fri Jul 25, 2003 7:01 am

Difference is here :
example: I have big NPC capital ship (one piece, no destroyable comp.). When you are too close (landing), this ship disappear. Engine of Freelancer has not info about size of 3D object box. Problem is .sur file, because edges of this ship are "no solid".

GAG

Post Fri Jul 25, 2003 10:05 am

what are you guys using to open the Vmeshref files, is it a hex editor or something?

Post Fri Jul 25, 2003 5:49 pm

Yeah, hex editor is your best bet. If you use the converter you shouldnt have to touch them tho. It shouldnt be much hassle to tweak the converter a bit to make it include the Bounding Box figures. Hopefully, like Arachno says, this will solve the problem with huge ships disappearing. Or will the .sur file still be a problem?

I'll post when its done.

EDIT - New version now calculates Bounding Box etc.

Version 0.7b :

This is a new version of the VMeshData / VMeshRef converter. Basic function remains the same, read in VMeshData anf Ref segments from an exported Freelancer .cmp and rewrites them to allow use of ships/weapons with multiple components.

This time support has been added for the Bounding Box figures in the VMeshRef segments. These are not written by the .cmp exporter but are probably important for correct viewing of large ships/stations. It is possible to feed in a single mesh, single objects VMesh segments just to get the Bounding Box figures.

Support has also been added for writing VMeshRef segments which span several meshes. This allows components made from separate Milkshape groups to be lumped together as one object in the .cmp.

Worked examples of common uses are provided.

Template .cmp files are included for a ship with destructable parts and a custom weapon model file along with complete instructions to get ships/weapons from Milkshape to a correctly defined .cmp file (no hex editing involved ).

Can now handle up to 100 separate meshes.

See included readme for full details/instructions.

Get it here

Edited by - redeye on 31-07-2003 21:14:05

Post Fri Mar 05, 2004 7:57 am

Will this calculate the bounding boxes of smaller ships too?

Allso, is there some way to make a custom sur file?

Post Sun Mar 28, 2004 5:03 am

Yes, it will.... as far as i rememeber anyway You should be able to feed it in a single mesh and it will calculate the bounding box figures for you.

However i'm not sure if this was ever shown to give any sort of benefit, I only put the feature in 'cause of what that Arachno guy was saying and he never got back to me on whether it had any effect.

Custom .sur files are still incredibly difficult. There are some stickied posts on the Editing Forum detailing th latest progress. The best i ever got was to modify nodes on existing .sur files - but if you look at the more recent posts they're doing some crazy maths. Good luck to them.

Return to Freelancer Editing Utilities Forum