Home   Help Search Login Register  

Author Topic: HiddenSelection and setObjectTexture  (Read 1664 times)

0 Members and 2 Guests are viewing this topic.

Offline ZNorQ

  • Members
  • *
  • ehr... uhm... duh...
HiddenSelection and setObjectTexture
« on: 06 Dec 2005, 21:14:44 »
I'm playing around with OFrP's soldiers - just to learn how stuff works. I've created my own addon that uses the OFrP_Infanterie resources and builing my own set of soldiers. But I have a problem with the setObjectTexture. I know I have the hiddenSelections[] with the right references to the 3d object, but still it wont work in the game.

Anyone know what I've might'a done wrong?


Code: [Select]

// Version
#define nsfVersion      "1.2"

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

// Boolean
#define true         1
#define false         0

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

// Weapon slots
#define WeaponNoSlot      0      // Dummy weapons
#define WeaponSlotPrimary   1      // Primary weapons
#define WeaponSlotHandGun   2      // Hand gun
#define WeaponSlotSecondary   16      // Secondary weapons
#define WeaponSlotHandGunItem   32      // Hand gun magazines
#define WeaponSlotItem      256      // Items
#define WeaponSlotBinocular   4096      // Binocular
#define WeaponHardMounted   65536      // Mounted

/////////////////////////////////////////////// LISTE DES UNITES ///////////////////////////////////////////////

class CfgPatches {
   class NSF_Inf   {
      units[]       = {
                 "NSF_XTC_LION1",  "NSF_XTC_LION2",  "NSF_XTC_LION3",  "NSF_XTC_LION4",  "NSF_XTC_LION5",  "NSF_XTC_LION6",  "NSF_XTC_LION7",
                 "NSF_XTC_SNAKE1", "NSF_XTC_SNAKE2", "NSF_XTC_SNAKE3", "NSF_XTC_SNAKE4", "NSF_XTC_SNAKE5", "NSF_XTC_SNAKE6", "NSF_XTC_SNAKE7",
                 "NSF_XTC_SHARK1", "NSF_XTC_SHARK2", "NSF_XTC_SHARK3", "NSF_XTC_SHARK4", "NSF_XTC_SHARK5", "NSF_XTC_SHARK6", "NSF_XTC_SHARK7"};
      weapons[]      = {};  
      requiredVersion    = 1.91;
      requiredAddons[]   = {OFrP_Infanterie,OFrP_Armes,BIS_Resistance};};};


/////////////////////////////////////////////// CONFIGURATION ///////////////////////////////////////////////
class CfgVehicles {
   class All{};
   class AllVehicles      : All{};
   class Land         : AllVehicles{};
   class Man         : Land{};
   class Soldier         : Man{};
   class NSF_XTC_TPL      : Soldier {
      vehicleClass      = "NSF XTC Infiltration";
      displayName      = "Template";
      nameSound      = "soldier";
      scope         = protected;
      side         = TWest;
      camouflage      = 1;
      sensitivity      = 1;
      sensitivityEar      = 0.13;
      accuracy      = 2;
      cost         = 500000;
      weaponSlots      = "1 + 16 + 10* 256 + 2* 4096 + 2 + 4* 32";
      type         = VSoft;
      threat[]      = {1, 0.05, 0.05};
      moves         = CfgMovesMC;
      additionalSound[]   = {"\OFrP_Infanterie\sons\SoldatMouvQ1.wss",0.000005,1};
      hiddenSelections[]   = {"body_grade", "body_scarf","body_patch","body_blason", "france"};
      model         = "\OFrP_Infanterie\AYO_INFbrouge2.p3d";
      picture         = "";
      armor         = 3;
      armorStructural      = 2.000000;
      armorHead      = 0.700000;
      armorbody      = 3.000000;
      armorHands      = 0.500000;
      armorLegs      = 0.500000;
      audible         = 0.05;
      maxSpeed      = 24;
      weapons[]      = {"Throw","Put","BAS_JM4MKReflex", "Binocular", "NVGoggles"};
      magazines[]      = {"JAM_W556_30mag","JAM_W556_30mag","JAM_W556_30mag","JAM_W556_30mag",
                  "JAM_12Gauge_Shotgun_Mag","JAM_12Gauge_Shotgun_Mag","JAM_12Gauge_Shotgun_Mag","JAM_12Gauge_Shotgun_Mag","JAM_12Gauge_Shotgun_Mag","JAM_12Gauge_Shotgun_Mag"};
      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_a.paa","xicht_a_zranen",
         "xicht_b.paa","xicht_w_zranen","xicht_2c.paa","xicht_a_zranen","xicht_d.paa","xicht_v_zranen",
         "xicht_e.paa","xicht_a_zranen","xicht_f.paa","xicht_a_zranen","xicht_2g.paa","xicht_w_zranen",
         "xicht_h.paa","xicht_a_zranen","xicht_i.paa","xicht_a_zranen","xicht_j.paa","xicht_a_zranen",
         "xicht_2k.paa","xicht_a_zranen","xicht_l.paa","xicht_a_zranen","xicht_m.paa","xicht_a_zranen",
         "xicht_n.paa","xicht_a_zranen","xicht_2o.paa","xicht_a_zranen","xicht_p.paa","xicht_p_zranen",
         "xicht_q.paa","xicht_a_zranen","xicht_r.paa","xicht_e_zranen","xicht_s.paa","xicht_a_zranen",
         "xicht_t.paa","xicht_a_zranen","xicht_u.paa","xicht_a_zranen","xicht_v.paa","xicht_a_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",
         "\OFrP_Infanterie\1\2_torse1a.paa","\OFrP_Infanterie\1w\2_t1a.paa","\OFrP_Infanterie\1\2_torse1b.paa",
         "\OFrP_Infanterie\1w\2_t1b.paa","\OFrP_Infanterie\1\2_torse1c.paa","\OFrP_Infanterie\1w\2_t1c.paa",
         "\OFrP_Infanterie\1\2_torse2a.paa","\OFrP_Infanterie\1w\2_t2a.paa","\OFrP_Infanterie\1\2_torse2c.paa",
         "\OFrP_Infanterie\1w\2_t2c.paa","\OFrP_Infanterie\1\2_torse2b.paa","\OFrP_Infanterie\1w\2_t2b.paa",
         "\OFrP_Infanterie\1\3_legav.pac","\OFrP_Infanterie\1w\3_lav1.paa","\OFrP_Infanterie\1\3_legar.pac",
         "\OFrP_Infanterie\1w\3_lar1.paa","\OFrP_Infanterie\1\3_legav2.pac","\OFrP_Infanterie\1w\3_lav2.paa",
         "\OFrP_Infanterie\1\3_legar2.pac","\OFrP_Infanterie\1w\3_lar2.paa","\OFrP_Infanterie\1\3_legside.pac",
         "\OFrP_Infanterie\1w\3_ls1.paa","\OFrP_Infanterie\1\3_legs2d.paa","\OFrP_Infanterie\1w\3_ls2d.paa",
         "\OFrP_Infanterie\1\3_legs2g.paa","\OFrP_Infanterie\1w\3_ls2g.paa","\OFrP_Infanterie\1\2_bras0.paa",
         "\OFrP_Infanterie\1w\2_b0.paa","\OFrP_Infanterie\1\2_brasD.paa","\OFrP_Infanterie\1w\2_b1D.paa",
         "\OFrP_Infanterie\1\2_brasG.paa","\OFrP_Infanterie\1w\2_b1G.paa","\OFrP_Infanterie\1\2_brasGa2.paa",
         "\OFrP_Infanterie\1w\2_b2G.paa","\OFrP_Infanterie\1\pack1.paa","\OFrP_Infanterie\1w\pack1.paa",
         "\OFrP_Infanterie\1\pack2.paa","\OFrP_Infanterie\1w\pack2.paa","\OFrP_Infanterie\2\2_torse1a.paa",
         "\OFrP_Infanterie\2w\2_t1a.paa","\OFrP_Infanterie\2\2_torse1b.paa","\OFrP_Infanterie\2w\2_t1b.paa",
         "\OFrP_Infanterie\2\2_torse2a.paa","\OFrP_Infanterie\2w\2_t2a.paa","\OFrP_Infanterie\2\2_torse2b.paa",
         "\OFrP_Infanterie\2w\2_t2b.paa","\OFrP_Infanterie\2\2_torse3a.paa","\OFrP_Infanterie\2w\2_t3a.paa",
         "\OFrP_Infanterie\2\2_torse3b.paa","\OFrP_Infanterie\2w\2_t3b.paa","\OFrP_Infanterie\2\3_legav.pac",
         "\OFrP_Infanterie\2w\3_lav1.paa","\OFrP_Infanterie\2\3_legar.pac","\OFrP_Infanterie\2w\3_lar1.paa",
         "\OFrP_Infanterie\2\3_legav2.paa","\OFrP_Infanterie\2w\3_lav2.paa","\OFrP_Infanterie\2\3_legar2.paa",
         "\OFrP_Infanterie\2w\3_lar2.paa","\OFrP_Infanterie\2\3_legside.pac","\OFrP_Infanterie\2w\3_ls1.paa",
         "\OFrP_Infanterie\2\3_legs2d.paa","\OFrP_Infanterie\2w\3_ls2d.paa","\OFrP_Infanterie\2\3_legs2g.paa",
         "\OFrP_Infanterie\2w\3_ls2g.paa","\OFrP_Infanterie\2\2_bras0.paa","\OFrP_Infanterie\2w\2_b0.paa",
         "\OFrP_Infanterie\2\2_brasD.paa","\OFrP_Infanterie\2w\2_b1D.paa","\OFrP_Infanterie\2\2_brasG.paa",
         "\OFrP_Infanterie\2w\2_b1G.paa","\OFrP_Infanterie\2\2_brasGa2.paa","\OFrP_Infanterie\2w\2_b2G.paa",
         "\OFrP_Infanterie\2\pack1.paa","\OFrP_Infanterie\2w\pack1.paa","\OFrP_Infanterie\2\pack2.paa",
         "\OFrP_Infanterie\2w\pack2.paa","\OFrP_Infanterie\3\2_torse1a.paa","\OFrP_Infanterie\3w\2_t1a.paa",
         "\OFrP_Infanterie\3\2_torse1b.paa","\OFrP_Infanterie\3w\2_t1b.paa","\OFrP_Infanterie\3\2_torse2a.paa",
         "\OFrP_Infanterie\3w\2_t2a.paa","\OFrP_Infanterie\3\2_torse2b.paa","\OFrP_Infanterie\3w\2_t2b.paa",
         "\OFrP_Infanterie\3\2_torse3a.paa","\OFrP_Infanterie\3w\2_t3a.paa","\OFrP_Infanterie\3\2_torse3b.paa",
         "\OFrP_Infanterie\3w\2_t3b.paa","\OFrP_Infanterie\3\3_leg.pac","\OFrP_Infanterie\3w\3_l1.paa",
         "\OFrP_Infanterie\3\3_legav.pac","\OFrP_Infanterie\3w\3_l1.paa","\OFrP_Infanterie\3\3_legar.pac",
         "\OFrP_Infanterie\3w\3_l1.paa","\OFrP_Infanterie\3\3_legside.pac","\OFrP_Infanterie\3w\3_ls1.paa",
         "\OFrP_Infanterie\3\2_bras0.paa","\OFrP_Infanterie\3w\2_b0.paa","\OFrP_Infanterie\3\2_brasD.paa",
         "\OFrP_Infanterie\3w\2_b1D.paa","\OFrP_Infanterie\3\2_brasG.paa","\OFrP_Infanterie\3w\2_b1G.paa",
         "\OFrP_Infanterie\3\3_legs2d.paa","\OFrP_Infanterie\3w\3_ls2d.paa","\OFrP_Infanterie\3\3_legs2g.paa",
         "\OFrP_Infanterie\3w\3_ls2g.paa"};

      class EventHandlers   {
         init      = "[_this select 0] exec {\NSF_XTC_Infil\bat\InitNSFSoldier.sqs}";
         dammaged   = "drop [""\O\Misc\krvava_skvrna"", """", ""SpaceObject"", 1, 120, [getpos (_this select 0) select 0, getpos (_this select 0) select 1, 0], [0,0,0],0, 0.001275, 0.001, 0, [0.3, 0.3], [[1,1,1,1], [1,1,1,1], [1,1,1,1], [1,1,1,1], [1,1,1,1], [1,1,1,0]], [0,0,0], 0, 0, """", """", """"]";
//         Fired      = "if ((_this select 1) == {OFrP_APILASLauncher} OR (_this select 1) =={OFrP_ABLLauncher} OR (_this select 1) =={OFrP_LRAC89Launcher}) then {[_this select 0, _this select 1] exec {\OFrP_Infanterie\scripts\noreload.sqs};}; if ((_this select 1) == {OFrP_LRAC89Launcher}) then {nearestObject[_this select 0, _this select 4] exec {\OFrP_Infanterie\scripts\fumrock.sqs};};";
};
};
   ///////////////////////////////////////////// LION TEAM /////////////////////////////////////////////////////////////////////
   class NSF_XTC_LION1      : NSF_XTC_TPL   {displayName = "Lion 1 OFC"; picture = ""; scope = public;      };
   class NSF_XTC_LION2      : NSF_XTC_LION1 {displayName = "Lion 2 ASL"; picture = "";            };
   class NSF_XTC_LION3      : NSF_XTC_LION1 {displayName = "Lion 3 MRT"; picture = "";            };
   class NSF_XTC_LION4      : NSF_XTC_LION1 {displayName = "Lion 4 MED"; picture = ""; attendant          = true;   };
   class NSF_XTC_LION5      : NSF_XTC_LION1 {displayName = "Lion 5 PZR"; picture = ""; canDeactivateMines = true;   };
   class NSF_XTC_LION6      : NSF_XTC_LION1 {displayName = "Lion 6 DEF"; picture = "";            };
   class NSF_XTC_LION7      : NSF_XTC_LION1 {displayName = "Lion 7 STL"; picture = ""; canHideBodies      = true;   };

   ///////////////////////////////////////////// SNAKE TEAM ////////////////////////////////////////////////////////////////////
   class NSF_XTC_SNAKE1      : NSF_XTC_LION1 {displayName = "Snake 1 OFC"; model = "\OFrP_Infanterie\AYO_INFbvert2.p3d";};
   class NSF_XTC_SNAKE2      : NSF_XTC_LION2 {displayName = "Snake 2 ASL"; model = "\OFrP_Infanterie\AYO_INFbvert2.p3d";};
   class NSF_XTC_SNAKE3      : NSF_XTC_LION3 {displayName = "Snake 3 MRT"; model = "\OFrP_Infanterie\AYO_INFbvert2.p3d";};
   class NSF_XTC_SNAKE4      : NSF_XTC_LION4 {displayName = "Snake 4 MED"; model = "\OFrP_Infanterie\AYO_INFbvert2.p3d";};
   class NSF_XTC_SNAKE5      : NSF_XTC_LION5 {displayName = "Snake 5 PZR"; model = "\OFrP_Infanterie\AYO_INFbvert2.p3d";};
   class NSF_XTC_SNAKE6      : NSF_XTC_LION6 {displayName = "Snake 6 DEF"; model = "\OFrP_Infanterie\AYO_INFbvert2.p3d";};
   class NSF_XTC_SNAKE7      : NSF_XTC_LION7 {displayName = "Snake 7 STL"; model = "\OFrP_Infanterie\AYO_INFbvert2.p3d";};

   ///////////////////////////////////////////// SHARK TEAM ////////////////////////////////////////////////////////////////////
   class NSF_XTC_SHARK1      : NSF_XTC_LION1 {displayName = "Shark 1 OFC"; model = "\OFrP_Infanterie\AYO_INFbnoir2.p3d";};
   class NSF_XTC_SHARK2      : NSF_XTC_LION2 {displayName = "Shark 2 ASL"; model = "\OFrP_Infanterie\AYO_INFbnoir2.p3d";};
   class NSF_XTC_SHARK3      : NSF_XTC_LION3 {displayName = "Shark 3 MRT"; model = "\OFrP_Infanterie\AYO_INFbnoir2.p3d";};
   class NSF_XTC_SHARK4      : NSF_XTC_LION4 {displayName = "Shark 4 MED"; model = "\OFrP_Infanterie\AYO_INFbnoir2.p3d";};
   class NSF_XTC_SHARK5      : NSF_XTC_LION5 {displayName = "Shark 5 PZR"; model = "\OFrP_Infanterie\AYO_INFbnoir2.p3d";};
   class NSF_XTC_SHARK6      : NSF_XTC_LION6 {displayName = "Shark 6 DEF"; model = "\OFrP_Infanterie\AYO_INFbnoir2.p3d";};
   class NSF_XTC_SHARK7      : NSF_XTC_LION7 {displayName = "Shark 7 STL"; model = "\OFrP_Infanterie\AYO_INFbnoir2.p3d";};

};



Offline remcen

  • Contributing Member
  • **
  • a.k.a. hottentotten_mike
    • IM:UC
Re:HiddenSelection and setObjectTexture
« Reply #1 on: 06 Dec 2005, 23:45:13 »
before you tell ofp what selections shall be hidden you have to define the selections at all. that's what the cfgmodels section is for:
Code: [Select]
class CfgModels
{
   class default {};
   class Man: Default {};
   class znorq_unit: man  //<- cfgmodels, hence the name of the .p3d here, not the classname of the cfgvehicles section
           {    
            sections[] = {
            "head injury",
            "body injury",
            "l arm injury",
            "p arm injury",
            "l leg injury",
            "p leg injury",
            "hlava",
            "krk",                  
              "selection1"
              "selection2",
            };
         sectionsInherit=Head;
            };
};

"selection1" and 2 are my examples here. you would then insert a line in the cfgvehicles section reading hiddenselections[]={"selection1", "selection2"}; .
this setobjecttexture [0,"xcz.paa"] would refer to "selection1", cos it's first in the hiddenselections array, [1,"yxc.paa"] to "selection2", etc.
« Last Edit: 06 Dec 2005, 23:46:45 by remcen »
we're looking for members: IM:UC MOD

Offline ZNorQ

  • Members
  • *
  • ehr... uhm... duh...
Re:HiddenSelection and setObjectTexture
« Reply #2 on: 07 Dec 2005, 16:43:39 »
Aaah! Thanks man! I'll try that out.

ZNorQ