Model Varient and Permutation Issues

Post Reply
xxpenguinxx
Posts: 1974
Joined: Sun Jan 27, 2008 4:50 am

Model Varient and Permutation Issues

Post by xxpenguinxx »

I'm trying to get permutations to work on a model. I cannot get them to work right. I think I'm missing something simple but can't figure it out. I have 6 LODs. LOD 0 works fine. It renders the correct model in game and switches to the destroyed model when damaged. The other 5 LODs randomly select a permutation, and do not respond to damage.

Here's a screenshot:

Image

The "hull" is rendered correctly. The "glass" is randomly switching between the "base" permutation and "destroyed" each time it spawns. The derpy polygon on the bottom is the destroyed state for the glass and wheels.

Here's how my tags are setup:

Mode:
LODs: 6 (0-5)
- Permutations: 2 (0-1)
Parts: 8 (0-7)
Bones: 1

HLMT:
Variants: 1
- Regions: 6 (0-5)
Model Variations: 6 (0-5)
- Permutation: 2 (0-1)

LOD Index and Permutation Index are set properly.
DemonicSandwich wrote:See that? You see that how it is highlighted down here but it's not highlighted right there? Ah, I guess that's what I get for pirating it.
In Soviet Russia, DS touches you. Say it again and I'll do more than touch. ~DS -Oh baby
A cat was licking itself to the sound of potato chips.
xxpenguinxx
Posts: 1974
Joined: Sun Jan 27, 2008 4:50 am

Re: Model Varient and Permutation Issues

Post by xxpenguinxx »

Some updated info:

Checking in "Cannot Be Chosen Randomly" under Model variations > Permutations, in the HLMT tag forces the "base" permutation to render, but it does not change after blowing up the object.

Worst case I can just attach blocs to the main bloc/vehicle, but I rather do it more properly.
DemonicSandwich wrote:See that? You see that how it is highlighted down here but it's not highlighted right there? Ah, I guess that's what I get for pirating it.
In Soviet Russia, DS touches you. Say it again and I'll do more than touch. ~DS -Oh baby
A cat was licking itself to the sound of potato chips.
xxpenguinxx
Posts: 1974
Joined: Sun Jan 27, 2008 4:50 am

Re: Model Varient and Permutation Issues

Post by xxpenguinxx »

Working with Click16 he managed to figure this part out. You need to modify your plugins to get permutations to work. Well, you don't need to, but for your sanity it's highly recommended. If you only have a single model variation, like a weapon, than you can safely ignore these values. This isn't a full tutorial, just an overview of what is needed. When I get a grip on the damage sections I'll post a proper tutorial.

Open the hlmt.ent with your favorite text editor. Go to this line:

Code: Select all

<struct name="Variants" offset="80" size="56" maxelements="64" label="Name" visible="True">
Within that structure, find this entry. It should be the second one (line 32) in the latest XZodia plugins:

Code: Select all

<unused size="16" name="_Unnamed0" offset="4" visible="True" />
Replace it with this:

Code: Select all

<byte name="Model Variant 0" offset="4" visible="True" />
	<byte name="Model Variant 1" offset="5" visible="True" />
	<byte name="Model Variant 2" offset="6" visible="True" />
	<byte name="Model Variant 3" offset="7" visible="True" />
	<byte name="Model Variant 4" offset="8" visible="True" />
	<byte name="Model Variant 5" offset="9" visible="True" />
	<byte name="Model Variant 6" offset="10" visible="True" />
	<byte name="Model Variant 7" offset="11" visible="True" />
	<byte name="Model Variant 8" offset="12" visible="True" />
	<byte name="Model Variant 9" offset="13" visible="True" />
	<byte name="Model Variant 10" offset="14" visible="True" />
	<byte name="Model Variant 11" offset="15" visible="True" />
	<byte name="Model Variant 12" offset="16" visible="True" />
	<byte name="Model Variant 13" offset="17" visible="True" />
	<byte name="Model Variant 14" offset="18" visible="True" />
	<byte name="Model Variant 15" offset="19" visible="True" />
For each region under variants, you need to point it towards a model variation. It's best to have the same number of regions as model variations and to keep the names in the same order. Lets say you have 2 model variation, "hull" [0] and "wheels" [1]. Create two regions under Variants called "hull" [0] and "wheels" [1]. Under Variants, set "Model Variant 0" to "0", and Model Variant 1 to "1". Now your model should properly spawn with working regions and damage sections, instead of being random.

If you want random permutations, I recommend using permutations and states under variants, that way the damage sections work. There's a value called "probability." 0 = 0% chance of spawning with that state, 0.5 = 50%, 1 = 100%, etc.
DemonicSandwich wrote:See that? You see that how it is highlighted down here but it's not highlighted right there? Ah, I guess that's what I get for pirating it.
In Soviet Russia, DS touches you. Say it again and I'll do more than touch. ~DS -Oh baby
A cat was licking itself to the sound of potato chips.
Post Reply