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