Integrate a 3dsmax model as a unit
From AOW HT Wiki
Contents |
Introduction
This tutorial will teach you how to configure and integrate a 3dsmax model in order to use it in Act of War as a unit.
You will need 3DSMax7 and the EugPluginASE plug-in. This plugin will convert your .max file into .Ase2ndfbin, the model file format used by the game.
Prepare your model
First open the Leclerc.max file in 3dsmax. Open the "Select objects" windows (shortcut : H key). This model contains 3 objects : "Chassis", "Tourelle" and "Canon". Theses objects will be used later to manipulate the tank.
There are also 7 small cubes. They will not be displayed in the game : they are used to indicate key positions in the model. For example, TirCanon gives the starting position of shooting.
This model uses only one texture, AoW_BaseGriseChar.tga
Export it
If you have correctly installed EugPluginASE, you may be able to choose ASCII2 Scene Export (*.ASE2NDFBIN) in the Export window. Choose the <GameDirectory>\CustomData\XFiles3\Leclerc folder and name the file Leclerc. Click "OK" in the next window without modifying the parameters.
Now you have a file named leclerclod0.Ase2ndfbin in <GameDirectory>\CustomData\XFiles3\Leclerc. Add the texture file AoW_BaseGriseChar.tga in the same folder.
Use it in the game
We will do all our tests in the DataLight/effet/TestModding/test.ndf file, so as to be able to load it with CTRL+P and test it with CTRL+D. You will have to launch the game in Test MOD Dev like explained in others tutorials.
The game has to be able to localize your model file, so you have to add :
<ndf>
const
MODEL_ASE_PATH = 'CustomData\XFiles3\Leclerc\leclerc'
end
export UsageModeleCharLeclerc is TDeclarationUsageModelAseList :
ModelAseList = STRINGLIST [ MODEL_ASE_PATH ]
</ndf>
The tank that we will create is similar to the Abrams, so copy it (TypeWarrior_AoW_US_Abrams) and paste in test.ndf. You just have two small modifications to do : rename it TypeWarrior_AoW_Leclerc and change from Model_ASE_Path_Dest1 = MODEL_ASE_PATH + '_Dest\AoW_US_Abrams_Dest01' to Model_ASE_Path_Dest1 = MODEL_ASE_PATH (because our model hasn't got an associated destroyed model).
So the code should be :
<ndf>
export TypeWarrior_AoW_Leclerc is TypeWarrior_AOW_VehiculeTireur_NiveauBlessure :
FLAG_LIST = [ $/DefaultConst/Flag_CategorieIA_Warrior,
$/DefaultConst/Flag_MustBeCount ]
Nom_Parametre_Semantique = AOW_US_ABRAMS_SEMANTIQUE
Nom_Parametre_Semantique_Graphic = AoW_US_Abrams_SEMANTIQUE_GRAPHIC
Nom_Parametre_Semantique_Hint = AoW_US_Abrams_Semantique_Hint
Nom_DataBlock = 'AOW_US_ABRAMS_SEMANTIQUE'
MODEL_ASE_PATH = MODEL_ASE_PATH + '£Chassis'
CLASSEMENT_EDITEUR = 'Custom/$Leclerc'
Ajustement_Hauteur_PointDeVie = -64
EFFET_REPOS = AOW_Generique_Vehicule_EffetRepos
EFFET_MOUVEMENT = AOW_Generique_Vehicule_EffetMouvement
Effet_HorsCombat = AoW_Generique_Vehicule_ReposHorsCombat
Effet_Mouvement_HorsCombat = AoW_Generique_Vehicule_MouvementHorsCombat
EffetGraphique = Template_Vehicule_EffetGraphique_TourelleSimple :
Model_ASE_Path_Neuf = MODEL_ASE_PATH
Model_ASE_Path_Dest1 = MODEL_ASE_PATH
// + '_Dest\AoW_US_Abrams_Dest01'
EFFET_MORT = Template_Vehicule_EffetMort_NbreFixe :
Message_Mort = AoW_US_Abrams_Semantique_Hint.TEXTE_DESTRUCTION
TYPE_WARRIOR_AS_STRING_PILOTE = 'TypeWarrior/TypeWarrior_AoW_US_PiloteChar'
IA_CATEGORY = AOW_US_ABRAMS_SEMANTIQUE.IA_CATEGORY
SCANNER_TYPE = AOW_US_ABRAMS_SEMANTIQUE.ScannerAnalysor
PeutEcraser = True
DEPLACEMENT_CATEGORY = $/DefaultConst/DEPLACEMENT_CATEGORY.ligne4
SUB_UNIT_STATE_MACHINE_DESCRIPTOR_LIST = SUSM is TemplateSubUnitStateMachineDescriptorList_VehiculeTireur_TourelleDeuxMorceaux :
EFFET_REPOS = EffetSetAnimAndSleep :
MODEL_ASE = MODEL_ASE_PATH + '£Canon'
EFFET_TOURNE = EffetSetAnimAndSleep :
MODEL_ASE = MODEL_ASE_PATH + '£Canon'
EFFET_TIR_PREPARATION = $/DefaultConst/DoNothing
EFFET_TIR = Template_AOW_EffetTirChar :
Nom_Parametre_Semantique = AOW_US_ABRAMS_SEMANTIQUE
Model_ASE_Path_Tir = MODEL_ASE_PATH + '£Canon'
MODEL_ASE_PATH_DEPART_TIR = MODEL_ASE_PATH + '£TirCanon'
EFFET_TIR_RECHARGE = $/DefaultConst/DoNothing
DEGRE_PAR_SECONDE_Horizontal = 180
Accesseur_Force_Repos = AccesseurSelf_IsHorsCombat
AccesseurTempsLatence = TAccesseurRealConstante :
Value = AOW_US_ABRAMS_SEMANTIQUE.DUREE_TIR
MODEL_ASE_PATH = MODEL_ASE_PATH
Nom_Parametre_Semantique = AOW_US_ABRAMS_SEMANTIQUE
SUSPENSION_DESCRIPTOR_TOURELLE = $/DefaultConst/SuspensionDescriptorTourelle
SUSPENSION_DESCRIPTOR_CANON = $/DefaultConst/SuspensionDescriptorCanon
+
USMD_EFVProximity :
MODEL_ASE = MODEL_ASE_PATH + '£Chassis'
CAPACITY_LIST = [
$/DefaultConst/Capacity_IsWarrior,
$/DefaultConst/Capacity_IsParachutable,
$/DefaultConst/Capacity_IsEntreurVehicule
]
COMPETENCE_LIST = TNewList :
ContentList = [AoW_US_M1Abrams_Upgrade_ReactiveArmor/CompetenceActionInstantanee]
COMPETENCE_LIST_HORS_COMBAT = TNewList :
ContentList = [AoW_US_M1Abrams_Upgrade_ReactiveArmor/CompetenceActionInstantanee]
COMPETENCE_LIST_GLOBALE = AoW_CompetenceListDeBasePourVehiculeUS
ADDITIONAL_PROPERTY_LIST = AdditionalPropertyList_US_Abrams
BinderBFXList = [
BinderBFX_Vehicule_US_Abrams,
BinderBFX_Tir0_US_Abrams,
BinderBFX_Son_US_Abrams
]
</ndf>
In the code, you can see MODEL_ASE_PATH + '£TirCanon' or MODEL_ASE_PATH + '£Chassis' That is the way to refer to the objects in 3dsmax. For example MODEL_ASE_PATH_DEPART_TIR = MODEL_ASE_PATH + '£TirCanon' gives the starting position of shooting.
Finally, add his code so you can create the unit with CTRL+D :
<ndf>
Test is TEffetCreateWarrior :
AccesseurPositionPlancher = DefaultConst/AccesseurPositionPlancher_PickedPoint
TypeWarriorAsString = '$/TypeWarrior/effettest/TypeWarrior_AoW_Leclerc'
AccesseurCamp = DefaultConst/AccesseurCampDuJoueur
</ndf>

