Random textures and models for your units

Tutorial for Command & Conquer 3 C&C3

No Avatar

Chriz

Category: Code
Level: Intermediate
Created: Saturday September 15, 2007 - 5:35
Updated: Saturday September 15, 2007 - 15:05
Views: 5695
Summary: A simple way to give your troops random skins and models
Rating
  • Staff-
  • Members3.0
  • Average3.0/5.0

1 vote

Are you tired of allways having you soldiers look the same like some kind of clone troopers?

Here is a simple way of giving you units a variety of different models and skins through a simple behavior and some condition states:


I will use the Zone Troopers (GDIZoneTrooper.xml) as an example.

First, you need a new Behavior:

              
Code
            <RandomModelCondition
                id="Random_Model"
                Conditions="USER_1 USER_2 USER_3" />


Every "USER_X" stands for an own model/skin. You can have as much as you want, but keep in mind that "USER_5" is often used for Kane-Editon skins...

Now move to te modelconditionstates.

NOTE: Keep in mind that this in only an example, GUZnTrpr02.tga & GUZnTrpr03_SKN.w3d are NOT included in the game (but there are some nice Zone Trooper skins in the CC3_SampleArt)

              
Code
            <scriptedModelDraw
                id="ModuleTag_NewDraw"
                OkToChangeModelColor="true"
                InitialRecoilSpeed="0.1"
                MaxRecoilDistance="0.1"
                RecoilDamping="2.0"
                RecoilSettleSpeed="3.0"
                ExtraPublicBone="MUZZLEFLASH">
                <ModelConditionState
                    ParseCondStateType="PARSE_DEFAULT">
                    <Model
                        Name="GUZnTrpr_SKN" />
                    <WeaponFireFXBone
                        WeaponSlotType="PRIMARY_WEAPON"
                        BoneName="MUZZLEFLASH" />
                    <WeaponRecoilBone
                        WeaponSlotType="PRIMARY_WEAPON"
                        BoneName="MUZZLEFLASH" />
                    <WeaponMuzzleFlash
                        WeaponSlotType="PRIMARY_WEAPON"
                        BoneName="MUZZLEFLASH" />
                    <WeaponLaunchBone
                        WeaponSlotType="PRIMARY_WEAPON"
                        BoneName="MUZZLEFLASH" />
                </ModelConditionState>
                <ModelConditionState
                    ParseCondStateType="PARSE_NORMAL"
                    ConditionsYes="USER_1">
                    <Model
                        Name="GUZnTrpr_SKN" />
                </ModelConditionState>
                <ModelConditionState
                    ParseCondStateType="PARSE_NORMAL"
                    ConditionsYes="USER_2">
                    <Model
                        Name="GUZnTrpr_SKN" />
                    <Texture
                        Original="GUZnTrpr"
                        New="GUZnTrpr02" />
                </ModelConditionState>
                <ModelConditionState
                    ParseCondStateType="PARSE_NORMAL"
                    ConditionsYes="USER_3">
                    <Model
                        Name="GUZnTrpr03_SKN" />
                </ModelConditionState>


As you can see, it quite simple. User_1 & _3 use different models, while _2 uses a reskin from _1.
"PARSE_DEFAULT" is only used to define the weapon bones.
Quite easy, isnt it?

NOTE: For vehicles and other units, you may want to have models for damaged and detroyed states:
(just look at the Predator conding if you have no idea how to use them) ^_^

ConditionsYes="REALLYDAMAGED USER_X"
ConditionsYes="DYING USER_X"


Here is an example how it could look ingame:

http://i204.photobucket.com/albums/bb291/StrangeGuyWithAGun/sshot0050.jpg

Links / Downloads

 HitsAdded
Ingame Screenshot2075September 15, 2007 - 15:05

Comments

Display order: Newest first

Sûlherokhh - Thursday October 4, 2007 - 9:59

Apart from the fact that this is good, it's also my first glance at the HTML-Object-Code. Doesn't really seem that much different to INI-code. Only need to get used to the 'Begin/End' tags and probably a lot of indentation to make the job easier! :)

Thanks Chriz!

Boomerang Python - Saturday September 29, 2007 - 5:01

We'll so use this for Only War 2

Return to top