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

**** Tutorial **** Creating a new weapons .cmp file

Here you can discuss building custom ships, texturing and 3D modeling in Freelancer

Post Sat Mar 20, 2004 1:43 am

**** Tutorial **** Creating a new weapons .cmp file

page 1

Hello, Harrier here...

I have been asked to do a tutorial on creating and importing a new Weapons .cmp file into Freelancer.... I will also upload a new weapons .cmp for use with this tutorial....
which you can download from here.

Thanks to baked potato.... thanx

This tutorial is based not so much on the actual modelling but more on what needs to be done to get the weapon into the game... I will do this section with Parabolix and Chips offerring to help out helping doing the ini hacking... - What files you need to modify, different effects, damage, fire rates, how destroyable it is and how to set it so your weapon takes or does not take damage etc..etc..



This subject has long been considered a "secret" known only to a few.. However, Redeye's tutorial has been on TLR since July last year, and while overlooked by many it provides the bulk of the information needed.. if not the detail...

As to the secrecy...

When modding was 'new' (many moons ago), anything that was found out before anyone else was kept secret.. and when weapons creation was 'discovered' it was treated the same way... I was made privy to the info... (even tho it was there all along), and some of the additional details on the proviso that I did not reveal it...so, I never have..My ego is not at risk only my word.., I am happy to share what knowledge I have, and have since spoken to the provider of the information in the first place...who has no problems now with the "secrecy" of the knowledge....

Yes.. it is frustrating and full of pitfalls...the weapons files in freelancer have many models that are simply not used...there is a lot of stuff in freelancer that was taken out and the files left... weapons are an example of this...plus, some weapons files refer to .mat files while others have materials built in...

This is the type that is commonly used for custom weapons.. i.e. mesh and materials all in the one cmp file ... Confused?.. It gets worse.... lol.

Btw, guns are not the only thing that can be made.. rocket launchers, turrets....

Anyway..... here goes....

Harrier..

P.S. bulk text follows.... and will be made available as a downloadable version...

Thanks again to baked and Lancers...

Retreat[![! ---- I'm too badly messed up now[![!


Edited by - bakedpotato on 3/22/2004 9:29:14 PM

Post Sat Mar 20, 2004 2:18 am

page 2












Now to the important stuff... how do you do it etc...?, well there are some really sticky "rules" that need to be observbed in order to be successful...

Now to the "rules" : -

1. The textures MUST be included in the cmp file...
2. Multiple HpFire points, i.e. multibarrel will work o.k. but will have no sound.. something Microsoft/DA was unable to fix.. and some of the best weapons modders have been unable to solve.)
3. weapons should be kept to as few groups as possible and should have unique names..
I did not know about this and had trouble with "parts confusion" i.e. the base of one would be attached to another.. or you would make a new weapon.. only to find that freelancer would use a different .cmp file.. weird I know....... but frustrating. (*more on this further down)
4. the model MUST be built below the xyz axis in the same manner as a ship..e.g. upside down and facing you.. with the "turntable" flush on the "Y" axis...
5. the model MUST be centred upside down business end towards you on the XYZ axis..this is MOST important as it appears to be the reference point Freelancer uses to set the rotational axis and if problems are going to occur then it will commonly be here.
6. prior to exporting the model your first group entry in your ms3d file MUST be the base. i.e. turntable, (and unique), the base is the point the model revolves around and is the first Vmesh named in the cmp file...The second Vmesh reference would be barrels - not base -so if you open a weapons .cmp file with utf. you will see the first group in the cmp file seen is the "base." the body/barrel groups come next, as they are the elevate section of the cmp file.. again... (*more on this a bit further)
7. I dont know how important it is... BUT.... I ALWAYS name my HPFire point as the very last entry in the ms3d file.. the logic is that if the base is first...then the fire point is last... lol...
Also your hardpoint triangles should be the equilateral version as the centre of the triangle is taken as the centre of the hardpoint.. picky maybe and maybe not that important... though from my experience weapons are the hardest job to do in modelling...
8. Scale should be around the 40 or 50 times , unfortunately, there is no hard and fast rule and if the original weapon is too small then since there are no hardpoints to "give it away" then you simply cannot see it.... This happened to me I had exported a weapon and had a problem with seeing a material file so I changed it but forgot to rescale it so what had been visible was no longer "there"
...:'(Head scratching time......
9. Along with the weapons cmp you must include a .sur file otherwise "your" weapon seems to not function correctly as it cannot take damage...

Now lets dispel some myths.......

How does a weapon function? What bit controls what? What are the relationships between components. i.e. locate, rotate, elevate, fire....?

Now I am no expert on this and I work on what I have been told and have found out on my own ..however I do know that unless you have two groups in your "custom" weapons ms3d file and the exported .cmp, it will not work.. there may be exceptions to this but if so I have not found them yet.

There is more to this that does not really relate to hardpoints and making a weapon is difficult. You have to edit the .cmp file and in many instances also have to rename components within the cmp file.. as well as import the textures...

Relationships of components:

The first entry in the .ms3d file and the (subsequent) exported .cmp MUST always be the "base" i.e. turntable. When you export the cmp file this sets the "base" as the first entry -

VMeshLibrary
/- your_gun_name_turntable.lod0.vms = e.g.hellspawn_turntable.lod0.vms)

This section controls the 'ability' for a weapon to rotate left or right and this is where I believe naming conventions are important... for example.... I use a system that provides an unique prefix.. i.e. the name of the weapon -(hellspawn) _turntable.. this not only names the file but gives it an unique prefix..
The following entries in your .cmp file are the actual bits that controls the elevation and "action" cycles of the weapon.. and commonly consists of the body and barrels and will sometimes have to be renamed within the cmp file...(see Redeye's tutorial for more)..The important thing here is that if the file name references in rhe cmp file are incorrect then the weapon simply will not work.. My suggestion is that you make and export a weapon following the guidelines above and using the .cmp file included with this tutorial compare files paying particular attention to the file names... as it is normal to have to rename parts within the .cmp file...... as you must use unique names to prevent "parts confusion".. My first weapons all followed the exact same naming rules (for ease and simplicity) .. Fine if you have only the one weapon... I found that should a weapon be mounted and a name within it was used elsewhere, (i.e. the base 'name'), within another custom weapon, and that weapon was purchased.... The parts would be "confused" and appear in the wrong places on the wrong gun model...

Something from my notes that may help explain the relationship between the groups:

If for example you have 5 groups in total in your ms3d file then the cmp file should be like this;

The base subgroup should have its pivot point as the first name inside the cmp file...If its called a turntable then rename the first group to (my_gun_name)_turntable lod

The barrel group has to have the pivot point as the first name in that subgroup i.e. (gunchamber.3db)

I am really sorry if I confuse people here as it is very hard for me to explain.. its a bit like learning to ride a bike...

The hardpoints are used for the following:

HpFire is fairly obvious .. that is where the gun fire effect is originated..
HpMount controls left to right rotation of the base. but this is also partly provided by the groups in the cmp file, the "base" group, is the point that revolves on the ship.. - In fact the weapon revolves on this point and the base is fixed.... (check it out sometime) the second subgroup in the cmp file controls the elevation, (up down movement).... Its not all in the hardpoints....

The relationship of the hardpoints:

HPMount is the "mounting/fixing" point to the ship... or (structure)
HpConnect is the "connection" to the ship and relates to hp mounts that are detailed in the weapon entry in weapon_equip.ini as a statement: HP_child = HPConnect - I am not entirely sure what the exact relationship is only that they are connected to how the weapon is located and positioned on the ship... the revolute aspect of the hardpoint on the ship is controlled from within the ship .cmp.

In addition:

You have to set as the last 2 entries in the .cmp for the materials files and import the textures as they would appear in a normal .mat file... I normally use .dds files as they are smaller but .tga will also work

If ANY of the above are not right then the gun will not appear...

One thing I forgot to mention... forget the animation info in Freelancer .cmp files.... it will only throw you off the track.. from what I have been told the original Freelancer concept had animation as part of the package i.e.defender wings would fan out...weapons would pop-up out of weapons bays, barrels rotating etc... however parts animation of weapons is not supported... other than revolute and elevate..

I have just made a brand new gun for one of our ships... so I went through the problems of not being able to see it even tho I could use it ..... there was a text error in the .cmp file ..by accident I had created a gun that would work but was invisible.....not exactly what I was after..... LOL!

Umm... Will probably be back to edit this... if ya want more pictures let me know...lol

Harrier.....


Retreat[![! ---- I'm too badly messed up now[![!


Edited by - bakedpotato on 3/22/2004 7:37:22 PM

Post Sat Mar 20, 2004 5:07 am

Another good tut.... from Nova Design

Post Tue Mar 23, 2004 3:22 am

Brilliant tut...now my figher-mounted tubolaser is finally possible!

Post Tue Mar 23, 2004 1:37 pm

Harrier will be away for the next couple days on a family emergency, so until he gets back I and DarkDragon will cover this forum for him.

Post Tue Mar 23, 2004 11:17 pm

when i open the zip file it is empty answer? solution?

Post Wed Mar 24, 2004 1:38 am

The zip file is ok...
Don't know what your doing but it's all good...

Post Wed Mar 24, 2004 1:45 am

@psycoscythe:

When you download the file, select 'save as...', because if you select 'open', the zip file will be empty. So, just click on 'save as...' and put it on your harddisk where you can easily find it.

Hope this helps

Post Wed Mar 24, 2004 9:08 am

i will? uh.... i mean I WILL

Post Wed Mar 24, 2004 4:34 pm

thats right

Post Wed Mar 24, 2004 11:07 pm

It dosen't come up with that

Post Wed Mar 24, 2004 11:13 pm

the download box pops up and starts downloading to tempory internet files.

Post Wed Mar 24, 2004 11:15 pm

WINZIP IS DOING THIS

anyone know how to fix this

Post Thu Mar 25, 2004 4:09 am

Try reinstalling WinZip, I had that happen to me once. By the way, did Harrier skin that in MilkShape, because I need help with that.

Edited by - Sparky on 3/25/2004 4:10:40 AM

Post Thu Mar 25, 2004 5:22 am

Yeah the zip file is fine, it must be a problem with winzip. Or when you download it, just right click on it and use extract all.

Sparky, here is a tutorial by Harrier covering texturing in Milkshape.

Return to Freelancer 3D Modeling and Texturing Forum