Jump to content
Sign in to follow this  
Bbartram

Tutorial / description of how to add a custom unit

Recommended Posts

I'm trying to create a new unit for my mod, but I'm not sure how to add it such that it becomes an option from the Mission Editor.

I placed the P3D and PAA files for the model (I'm modifying the geo an existing soldier unit) in my addon directory, added this info to the config.cpp file:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">class CfgModels

{

class Default {};

class Man: Default {};

class soldier1: Man {};

};

soldier1.p3d is the name of the model.

I PBO, but don't see the name "solder1" listed in the Mission Editor anywhere. Perhaps I'm way off, totally shooting in the dark here.

I got this far from looking at an example from another addon, but haven't been able to find any documentation or tutorials about adding a new character to the game (though vehicles, weapons, and objects are covered pretty well).

Any tips appreciated...

B

Share this post


Link to post
Share on other sites

My god, you should search more around here and get BIS commented config (on BIS site) to understand how config file is working.

In brief, you should :

(1) Indicate where your p3d model is :

  model="\name of your pbo folder\name of your model";

(2) Indicate the name of your unit to find it in the editor :

  displayName="My beautiful first model";

(3) Add a config model and a config patch at the beginning of the cpp file : here's the (VERY) minimum config that you can do for a man-unit :

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

class CfgModels

{

class Default

{

sections[]={};

sectionsInherit="";

};

class Man: Default {};

Class NameofMyUnitP3d:Man {};

};

class CfgPatches

{

class MyBeautifullMod

{

units[] = {NameofMyUnit};

weapons[] = {};

requiredVersion = 1.75;

};

};

class CfgVehicles

{

class All{};

class AllVehicles: All{};

class Land: AllVehicles{};

class Man: Land{};

class Soldier: Man{};

class SoldierWB: Soldier{};

class SoldierWCrew : Soldier{};

class OfficerW: SoldierWB{};

class SoldierEB: Soldier{};

class SoldierECrew : Soldier{};

class OfficerE: SoldierEB{};

class SoldierGB: Soldier{};

class SoldierGCrew : Soldier{};

class OfficerG: SoldierGB{};

class NameofMyUnit: SoldierWB

    {

           vehicleclass="The name of the folder i would like to find my soldier in the mission editor";

           side=TWest;

//the unit will be on the west side

          displayName="The name of my beautiful first model";

          model="\name of your pbo folder\name of your model p3d";

           };

};

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×