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

Destroyable parts of ships?

The general place to discuss MOD''ing Freelancer!

Post Thu Dec 16, 2004 10:49 am

Destroyable parts of ships?

Now, this is something I'd like to know.

How do you make destroyable parts of a ship, for example, a destroyable wing.

What I know is that has something to do with VMesh's and the Damage Hardpoints (i.e. Dp_Wing). I also found some models of the things left, when the wing is destroyed and, using the HardCMP Editor, i noticed that Hardpoints can be part of Root or other parts of the ship.

How are these parts defined, what have the Dp's to do with it and what part do the [CollisionGroup and [Simple entries in the shiparch.ini play?

Post Thu Dec 16, 2004 6:04 pm

Collision Group's are sections that can take damage/fall of during a collision.
These usually identfy the "simple" group hardpoint and item that will detach:
IE:
dmg_hp = DpPortfin
dmg_obj = li_fighter_dmg_portfin_cap
type = Port_Fin

Simple Group's are items such as antennae, fins, etc that fall off when the ship takes ANY damage.

The DP's identify what section of a ship must take damage in order for the attached section to detach.

The ship's model must be made up of several components:
1) Root-the last part of the ship to remain after all external components are blown off.
2) Detachables-fins, engines, pods, wings, whatever.
3) EVERY item must have an entry in the Shiparch.ini in order to work.

To date, I've never seen a new model that has detachable components.
There probably are some, I just haven't seen them.
Modeling of such a ship is quite time consuming, and few modelers, or programmers, go through the trouble required to make them.


Watch your 6!

Dev

Post Thu Dec 16, 2004 6:44 pm

Not only must the model (.cmp file in this case) have multiple components, but the .sur file must have groups which match the names of the model's components. If this is not the case then Freelancer will be unable to determine that damage was dealt to the the components in question, meaning it will be as though they have no hit boxes (you can mess with this and switch names of components around, which causes the wrong components to blow off, i.e. you shoot the left wing and the right wing gets destroyed). In addition, the .sur file usually has groups that go along with the components after they have been broken off (for example, you can continue to shoot an Eagle's wings for a second or two after you've shot them off, even though they are no longer a part of the original ship).

Presuming that you have a .sur file matches the .cmp file correctly, the damage hardpoints are used to determine where to attach the damaged component models after the original component has been destroyed. For example, if you shoot the side fin off of a patriot it will be replaced by a mangled piece of metal. In any CollisionGroup entry in shiparch.ini, the model to use when the original destroyed is dmg_obj and the location to place that model is dmg_hp. I wish I had shiparch.ini in front of me so I could point out where the other definitions are and what they mean, but generally speaking there must be some reference to which component in the .cmp file the CollisionGroup entry applies to. The best way to figure out what goes to what is to look in the .cmp file of the ship in question and track down the names of all the parts (not the names of the .3db files; for example, Root is always the name of the ship's primary component, but the name of its .3db file varies from ship to ship).

Anyway... yeah. That's it in a nutshell, though with some details missing since I don't have any examples sitting in front of me at the moment.

Post Thu Dec 16, 2004 10:21 pm

Great!

But how do I get multiple sections of a ship in one cmp? How do I have to export them?

When I know that I'm going to try it out.

And another question: The various lod's you can create are the models, that are defined in the LODranges ini-entry and go from lod0 (close, detailed) to lod3 or more (far, not so detailed), right? Do I have to seperate my ship into multiple destroyable parts in i.e. lod3, too? Or how are the lod's and the destroyable groups handled?

Dev

Post Thu Dec 16, 2004 11:10 pm

The vmeshdata section of the .cmp file contains the models for all components of the ship (how it is split up into the separate .3db files is determined, if I am not mistaken, by the vmeshref section). Thus, when you have multiple vmeshdata values for different LODs, you will automatically have multiple versions of each component of the ship.

As for how to export a model so that it is split into multiple components, you're going to have to be creative... I don't know of any utility that will help you with that task (but maybe there is one, who knows).

Post Fri Dec 17, 2004 6:44 am

Well, you only need destroyable parts at the closest lod, as you wouldn't see it anyway, when the ship is further away.

But I think creating mulitple parts of the ship can be done with the CMPexporter, as you can update a CMP and save new sections to it.

However, I have not tried this out. Has anybody got experience with this?

EDIT:

Ah I just looked it up: The parts are called "Or_Engine02_lod1". This suggests every part is modelles for every lod...

Edited by - Manhattan_Guy on 12/17/2004 8:16:30 AM

Return to Freelancer General Editing Forum