Home   Help Search Login Register  

Author Topic: random face qns.  (Read 514 times)

0 Members and 1 Guest are viewing this topic.

mystic80

  • Guest
random face qns.
« on: 22 Oct 2003, 10:28:38 »
is there a way to set random face everytime i insert a soldier using the same model file???

It dun seems to work for my soldier.

Code: [Select]
class CfgPatches
{
   class Army
   {
      units[]= {"Army", "Enemy", "cm", "cf", "SGface1","SGface2","SGface3","SGface4","SGface5","SGface6","SGface7","SGface8"};
      weapons[]= {"M16S1"};
      requiredVersion=1.45;
      requiredAddons[] = {"BIS_Resistance",  "BIS_WeaponPack"};
   };
};

class CfgModels
{   
   class default {};
    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",
         "svetlo"
      };
      sectionsInherit=Head;
   };

   class cm : Man{};
   class Army : Man {};
   class Enemy : Army{};

   class Weapon: default {};
   class M16: Weapon {};
   class M16S1 : M16 {};
};


class CfgVehicles
{
   class All {};
   class AllVehicles: All {};
   class Land: AllVehicles {};
   class Man: Land   {};
   class Soldier: Man {};

   class SoldierWB : Soldier {};
   class Army : SoldierWB
   {
      vehicleClass =$STR_VC_INFANTRY;
      displayName=$STR_DN_SAF_SOLDIER;
      model="\Men\army";
      picture="\ranks\LCP.paa"; //rank
      weapons[]={"M16S1", "Put","Throw"};
      
      hiddenSelections[]={"medic", "svetlo"};
      wounds[] ={
         \Men\img\face1.paa, \Men\img\faceD.paa,
         //helmet
         \Men\w_helma_front,\Men\w_helma_front_d,
         \Men\w_helma_side2,\Men\w_helma_side2_d,
         \Men\w_helma_vnitrek,\Men\w_helma_vnitrek_d,
         //body
         \Men\w_hrud_p,\Men\w_hrud_p_d,
         \Men\w_zadaruce_z,\Men\w_zadaruce_z_d,
         //arm side
         \Men\w_ruka_bok_l,\Men\w_ruka_bok_l_d,
         \Men\w_ruka_bok_p,\Men\w_ruka_bok_p_d,
         //shoulder
         \Men\w_ramena,\Men\w_ramena_d,
         //leg
         \Men\w_nohy_bok_l.pac,\Men\w_nohy_bok_l_d.pac,
         \Men\w_nohy_bok_p.pac,\Men\w_nohy_bok_p_d.pac,
         \Men\w_nohy_p,\Men\w_nohy_p_d,
         \Men\w_nohy_z,\Men\w_nohy_z_d};
      
      magazines[]=
      {
         M16Mag, M16Mag, M16Mag, M16Mag, M16Mag, M16Mag,
         HandGrenade, HandGrenade
      };
   };

   class SoldierEB : Soldier {};
   class Enemy : SoldierEB
   {
      vehicleClass = $STR_VC_ENEMY_INFANTRY;
      displayName=$STR_DN_ENEMY;
      model="\Men\enemy";
      weapons[]={"M16S1", "Put","Throw"};
      
      hiddenSelections[]={"medic", "svetlo"};
      wounds[] ={
         \Men\img\face2, \Men\img\faceD,
         //helmet
         \Men\e_helma_front,\Men\e_helma_front_d,
         \Men\e_helma_side2,\Men\e_helma_side2_d,
         \Men\e_helma_vnitrek,\Men\w_helma_vnitrek_d,
         //body
         \Men\e_hrud_p,\Men\e_hrud_p_d,
         \Men\e_zadaruce_z,\Men\e_zadaruce_z_d,
         //arm side
         \Men\e_ruka_bok_l,\Men\e_ruka_bok_l_d,
         \Men\e_ruka_bok_p,\Men\e_ruka_bok_p_d,
         //shoulder
         \Men\e_ramena,\Men\e_ramena_d,
         //leg
         \Men\e_nohy_bok_l.pac,\Men\e_nohy_bok_l_d.pac,
         \Men\e_nohy_bok_p.pac,\Men\e_nohy_bok_p_d.pac,
         \Men\e_nohy_p,\Men\e_nohy_p_d,
         \Men\e_nohy_z,\Men\e_nohy_z_d};
      
      magazines[]=
      {
         M16Mag, M16Mag, M16Mag, M16Mag, M16Mag, M16Mag,
         HandGrenade, HandGrenade
      };
   };
class CfgFaces
{
   class SGface1
   {
      name="Reuben";
      texture="\Men\img\face1.paa";
      east=1;
      west=1;
   };

   class SGface2
   {
      name="Jayson";
      texture="\Men\img\face2.paa";
      east=1;
      west=1;
   };

   class SGface3
   {
      name="Sam";
      texture="\Men\img\face3.paa";
      east=1;
      west=1;
   };

   class SGface4
   {
      name="Marc";
      texture="\Men\img\face4.paa";
      east=1;
      west=1;
   };

   class SGface5
   {
      name="Lester";
      texture="\Men\img\face5.paa";
      east=0;
      west=1;
   };

   class SGface6
   {
      name="Robert";
      texture="\Men\img\face6.paa";
      east=0;
      west=1;
   };

   class SGface7
   {
      name="Gary";
      texture="\Men\img\face7.paa";
      east=0;
      west=1;
   };

   class SGface8
   {
      name="Hong";
      texture="\Men\img\face8.paa";
      east=0;
      west=1;
   };
};

class CfgFaceWounds
{
   access=1;
   wounds[]={"\Men\img\face1.paa","\Men\img\faceD.paa",
      "\Men\img\face2.paa","\Men\img\faceD.paa",
      "\Men\img\face3.paa","\Men\img\faceD.paa",
      "\Men\img\face4.paa","\Men\img\faceD.paa",
      "\Men\img\face5.paa","\Men\img\faceD.paa",
      "\Men\img\face6.paa","\Men\img\faceD.paa",
      "\Men\img\face8.paa","\Men\img\faceD.paa"
   };
};

???

Komuna

  • Guest
Re:random face qns.
« Reply #1 on: 22 Oct 2003, 14:56:48 »
Next time post it at the Addon Editing board! ;)

Your problem used to be my problem. But don't think that you'd get an answer very quickly: I haven't, as the unit modeling seems to be a big secret within the community - these guys don't wanna share info.

But you're lucky:

Your model (army.p3D, right?) has been surely collected from the Demo data3d and therefore, it doesn't have specified the new main selections:

nvg_proxy.01 - NVGoggles
beretta.01 - hand gun proxy
osobnost - personality: came to replace "oblicej", "skrane" and "sije" selections.

This last, osobnost, is the selection which alows the game to identify the face and hands and then retexture them with a random face/hand texture.
So, to make it work, you must redefine the head (except the mouth interior) as the "osobnost" and the same goes for the hands. Notice that both hands and head shall be well textured (according the new xicht.paa tex), otherwise the face will appear distorted!


#Edit

I see you've already posted the main model settings in the .cpp:

Quote
class CfgModels
{  
   class default {};
    class Head: default
   {
      sections[] =
        {
         "osobnost",
            "brejle"
      };
   };
...


See? You've specified the osobnost, but, maybe you haven't done such thing at the .p3D!

If you have indeed defined the osobnost at the p3D, then sorry, my post is a crap! ::) [I'll remove it to keep the secret!  :P]


#AnotherEdit

Just ocurred to my brain: have you tried this unit in other AI subjects than the player?
Cuz the player has a predefined face!

And don't forget to try the setface command.
« Last Edit: 22 Oct 2003, 15:05:11 by Komuna »

mystic80

  • Guest
Re:random face qns.
« Reply #2 on: 22 Oct 2003, 16:35:41 »
thanks man! it did really work! u r great!

so i guess its not possible to set random faces i made?

Komuna

  • Guest
Re:random face qns.
« Reply #3 on: 23 Oct 2003, 13:46:00 »
Sure you can!

First of all, you've defined your custom faces as east and west faces -  < class SGface_N   {...  east=1; west=1;}; > - which means that sonner or later you'll get some units using them... However, as it's random, the game will choose between all of the available faces; so, the probability of chosing the ones you've created is kanda remote...

Therefore, if you realy wanna make your units to use your custom faces make a random script:

Code: [Select]
LIST = ["SGFace1","SGFace2",...,"SGFace8"]
MyListOfUnits = [Dude1,Dude2,...,Dude8]

{_rndFace = (LIST select (random ((count LIST)-1)); _x setFace _rndFace; LIST = LIST - _rndFace} forEach MyListOfUnits

It will ensure your units don't get repeated faces.
However, as the number of faces is limited, so the number of units shall be.

Besides, you can also make a condition for the unit's side.