Home   Help Search Login Register  

Author Topic: Glasses always appears on unit?  (Read 1341 times)

0 Members and 1 Guest are viewing this topic.

Offline Crackbone

  • Members
  • *
  • I'm a llama!
Glasses always appears on unit?
« on: 04 Aug 2005, 11:13:13 »
Hello,

I'm creating an add-on with new civilians. The problem that I'm experiencing is that, whenever the civilians appear within the game, they're always wearing glasses. What's the problem here? The config.cpp is very simple:

Code: [Select]
#define TEast 0
#define TWest 1
#define TGuerrila 2
#define TCivilian 3
#define TSideUnknown 4
#define TEnemy 5
#define TFriendly 6
#define TLogic 7

#define true 1
#define false 0

#define private 0
#define protected 1
#define public 2

#define WeaponNoSlot      0   
#define WeaponSlotPrimary   1   
#define WeaponSlotSecondary   16   
#define WeaponSlotHandGun   2   
#define WeaponSlotHandGunItem   32
#define WeaponSlotItem      256   
#define WeaponSlotBinocular   4096   
#define WeaponHardMounted   65536

#define CanSeeRadar 1
#define CanSeeEye 2
#define CanSeeOptics 4
#define CanSeeEar 8
#define CanSeeCompass 16
#define CanSeeRadarC CanSeeRadar+CanSeeCompass
#define CanSeeAll 31

class cfgPatches
{
   class MEastCiv
   {
      units[] =
      {
         MEastCiv_1,
                                };

      weapons[] = {};
      requiredVersion = 1.85;
   };
};

class CfgVehicles
{
   class All{};
   class AllVehicles:All{};
   class Land:AllVehicles{};
   class Man:Land{};
   class Civilian:Man{};
   class MEastCiv1:Civilian
   {
      displayName="Middle Eastern Civilian (1)";
      model="\MEastCiv\MEastCiv1";
      vehicleClass ="Civilians (Middle Eastern)";
      moves="CfgMovesMC";
      scope=2;
      side=3;

   };
};

Any ideas?


Offline remcen

  • Contributing Member
  • **
  • a.k.a. hottentotten_mike
    • IM:UC
Re:Glasses always appears on unit?
« Reply #1 on: 04 Aug 2005, 13:54:00 »
hmmm... let me guess... all your units are not only wearing glasses but also all have the same face?
that's because your config is a little bit too simple. it lacks one desicive part: the cfgmodels section.
insert this into your config somewhere above the cfgvehicles section:
Quote
class CfgModels
{
   class default {};
   class Man: Default {};
   class MEastCiv1: man
};
for a short explanation: cfgmodels was introduced with resistance. in this bit of the config you tell the game engine what to do with the MODELS hence cfgmodels - you have to type in the names of te p3d models there (without the p3d-suffix). if the game engine does not get a cfgmodels selection foryour model it does not know what to do with the named selections of the models. (the muzzle flash bug for weapons is a result of a missing cfgmodels section, too)
if you look at the commented configs of BIS you see what selections from the 'man' and 'head' classes are inherited:
Quote
class CfgModels
{
   class Default
   {
      sections[] = {};
      sectionsInherit="";
   };

   // some generic model requirements
   class Head: Default
   {
      sections[] =
      {
         "osobnost",
         "brejle"
      };
   };
   class Man: Default
   {
      sections[] =
      {
         "head injury","body injury",
         "l arm injury","r arm injury","p arm injury",
         "l leg injury","r leg injury","p leg injury",
         "medic",
         "hlava",
         "krk",
         "zasleh"
      };
      sectionsInherit=Head;
   };
you see that there is a selection reading 'brejle' in the head class. that is the named selection of the glasses. 'osobnost' manages the random setting of face textures. and this class again is inherited by the 'man' class. so it will be passedd on to your model if you insert in your config the lines i posted in the first quote ;)
« Last Edit: 04 Aug 2005, 13:57:59 by remcen »
we're looking for members: IM:UC MOD

Offline Crackbone

  • Members
  • *
  • I'm a llama!
Re:Glasses always appears on unit?
« Reply #2 on: 07 Aug 2005, 00:43:33 »
All right. This worked at first, but now I'm experiencing a new problem. I changed the config.cpp to include new models.

My models have custom face-textures. If I include a section cfgModels with the same names as the models, then default faces are shown. Only if the the names AREN'T the same as the models, then the custom face-textures are shown. But they're shown with glasses again.

My config:

Code: [Select]
#define MEastCiv_WOUNDS wounds[] = {"xicht_a.paa","xicht_a_zranen", "xicht_b.paa","xicht_a_zranen",

"xicht_c.paa","xicht_a_zranen", "xicht_d.paa","xicht_a_zranen", "xicht_e.paa","xicht_e_zranen",

"xicht_f.paa","xicht_a_zranen", "xicht_g.paa","xicht_a_zranen", "xicht_h.paa","xicht_a_zranen",

"xicht_i.paa","xicht_a_zranen", "xicht_j.paa","xicht_a_zranen", "xicht_k.paa","xicht_a_zranen",

"xicht_l.paa","xicht_a_zranen", "xicht_m.paa","xicht_a_zranen", "xicht_n.paa","xicht_a_zranen",

"xicht_o.paa","xicht_o_zranen", "xicht_p.paa","xicht_a_zranen", "xicht_q.paa","xicht_a_zranen",

"xicht_r.paa","xicht_a_zranen", "xicht_s.paa","xicht_a_zranen", "xicht_t.paa","xicht_a_zranen",

"xicht_u.paa","xicht_a_zranen", "xicht_v.paa","xicht_v_zranen", "xicht_w.paa","xicht_w_zranen",

"xicht_x.paa","xicht_a_zranen", "xicht_y.paa","xicht_a_zranen", "xicht_z.paa","xicht_a_zranen",

"xicht_2a.paa","xicht_a_zranen", "xicht_2b.paa","xicht_w_zranen", "xicht_2c.paa","xicht_a_zranen",

"xicht_2d.paa","xicht_v_zranen", "xicht_2e.paa","xicht_a_zranen", "xicht_2f.paa","xicht_a_zranen",

"xicht_2g.paa","xicht_w_zranen", "xicht_2h.paa","xicht_a_zranen", "xicht_2i.paa","xicht_a_zranen",

"xicht_2j.paa","xicht_a_zranen", "xicht_2k.paa","xicht_a_zranen", "xicht_2l.paa","xicht_a_zranen",

"xicht_2m.paa","xicht_a_zranen", "xicht_2n.paa","xicht_a_zranen", "xicht_2o.paa","xicht_a_zranen",

"xicht_2p.paa","xicht_2p_zranen", "xicht_2q.paa","xicht_a_zranen", "xicht_2r.paa","xicht_e_zranen",

"xicht_2s.paa","xicht_a_zranen", "xicht_2t.paa","xicht_a_zranen", "xicht_2u.paa","xicht_a_zranen",

"xicht_2v.paa","xicht_a_zranen", "xicht_2w.paa","xicht_w_zranen", "xicht_2x.paa","xicht_a_zranen",

"xicht_2y.paa","xicht_a_zranen", "xicht_2z.paa","xicht_a_zranen", "camoface.paa","camoface_d.paa",

"\MEastCiv\civ\blurob_bak.pack","\MEastCiv\D\civ\blurob_bak.pac",

"\MEastCiv\civ\blurob_frt.pac","\MEastCiv\D\civ\blurob_frt.pac",

"\MEastCiv\civ\brownrob_bak.pac","\MEastCiv\D\civ\brownrob_bak.pac",

"\MEastCiv\civ\brownrob_frt.pac","\MEastCiv\D\civ\brownrob_frt.pac",

"\MEastCiv\civ\dress_bak.pac","\MEastCiv\D\civ\dress_bak.pac", "\MEastCiv\civ\dress_frt.pac","\MEastCiv\D\civ\dress_frt.pac",

"\MEastCiv\civ\robe_bak.pac","\MEastCiv\D\civ\robe_bak.pac", "\MEastCiv\civ\robe_frt.pac","\MEastCiv\D\civ\robe_frt.pac"};

#define TEast 0
#define TWest 1
#define TGuerrila 2
#define TCivilian 3
#define TSideUnknown 4
#define TEnemy 5
#define TFriendly 6
#define TLogic 7

#define true 1
#define false 0

#define private 0
#define protected 1
#define public 2

#define WeaponNoSlot      0   
#define WeaponSlotPrimary   1   
#define WeaponSlotSecondary   16   
#define WeaponSlotHandGun   2   
#define WeaponSlotHandGunItem   32
#define WeaponSlotItem      256   
#define WeaponSlotBinocular   4096   
#define WeaponHardMounted   65536

#define CanSeeRadar 1
#define CanSeeEye 2
#define CanSeeOptics 4
#define CanSeeEar 8
#define CanSeeCompass 16
#define CanSeeRadarC CanSeeRadar+CanSeeCompass
#define CanSeeAll 31

class cfgPatches
{
   class MEastCivilians
   {
      units[] =
      {
         MEastMan_1
      };

      weapons[] = {};
      requiredVersion = 1.85;
   };
};

class CfgModels
{
   class Default{};
   class Man:Default{};
   class MEastCiv1:Man{};
};

class CfgVehicles
{
   class All{};
   class AllVehicles:All{};
   class Land:AllVehicles{};
   class Man:Land{};
   class Civilian:Man{};
   class MEastMan_1:Civilian
   {
      displayName="Middle Eastern Man (1)";
      model="\MEastCiv\MEastCiv1";
      vehicleClass ="Civilians (Middle Eastern)";
      moves="CfgMovesMC";
      scope=2;
      side=3;
      MEastCiv_WOUNDS
   };
};

Any ideas?

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:Glasses always appears on unit?
« Reply #3 on: 07 Aug 2005, 01:00:45 »
Code: [Select]
class cfgPatches
{
   class MEastCivilians
   {
      units[] =
      {
         MEastMan_1
      };

      weapons[] = {};
      requiredVersion = 1.85;
   };
};

Should maybe be:

Code: [Select]
class cfgPatches
{
   class MEastCiv
   {
      units[] =
      {
         MEastMan_1
      };

      weapons[] = {};
      requiredVersion = 1.85;
   };
};


Planck
I know a little about a lot, and a lot about a little.

Offline SelectThis

  • Former Staff
  • ****
  • .
Re:Glasses always appears on unit?
« Reply #4 on: 12 Aug 2005, 01:23:51 »
The custom faces don't appear because they are being overwritten by the in-game random face code. This code replaces the osobnost selection with a random face texture.

What we did for the set faces on the VC/NVA units in SEB nam pack 2 was to delete the osobnost selection name from the model itself (the name...not the actual model parts!).

An alternative would be to redefine the cfgmodel section but I think that is a riskier solution (ie you might lose some properties and/or stuff up others)

SelectThis