Home   Help Search Login Register  

Author Topic: Config class setobjecttexture problem  (Read 1916 times)

0 Members and 1 Guest are viewing this topic.

Offline Terox

  • Former Staff
  • ****
  • Follow the Sappers!
    • zeus-community.net
Config class setobjecttexture problem
« on: 11 Jul 2006, 18:26:00 »

Problem:
I have a series of ammo boxes which use the same model
There is a selection on the model called "label"
For each different ammocrate class, i setobjecttexture to the label, different "text"

however when previewing the ammocrate classes in game, i dont see the texture that i have set for that particular class

I didnt makde the model and have no clue about model making, however the modeller assures me the ammocrate.p3d is correct


Heres the various excerts from the config, and a snippet from the .hpp file that defines the crates

NB>> the ammocrate model is called ammocrate.p3d
Image size of textures are 512*128 .paa files


Quote
class CfgModels
{
   class Default{};
   class ammocrate: Default
      {
      sections[]={"label"};
      };
};

NB>> I inherit the ammocrates from "thing" due to the fact, the BIS ammocrates inherit from strategic:Building and i read somewhewre you cannot setobjecttexture to buidlings class

I highlighted the relevant init eventhandler section

Quote
class TxU_BaseCrate:thing
{
      scope=0;
      accuracy=1000;
      model="\Tx_Utils\Mdl\ammocrate";
      vehicleClass="TxU AmmoCargo";
      transportMaxWeapons=2000;
      transportMaxMagazines=8000;
         class TransportWeapons      {};      
         class TransportMagazines   {};
      
};   
   
//// BASE DEFINE Crate ////


class TxU_AmmoCrate:TxU_BaseCrate
{
      scope=2;
      displayName="Ammo Crate";
         
         class EventHandlers
         {
         init   = "(_this select 0) setobjecttexture [0,{\tx_utils\mdl\aclab.paa} ]; if(format[{%1},TxU_On]=={scalar bool array string 0xfcffffef})then{_this call loadfile{\Tx_Utils\TxU_init.sqf};};_this exec{\Tx_Utils\Cargo\Cargo_Init.sqs};";
         };      

         class UserActions
      {
            class Carry
              {
              displayName="Carry Ammo crate";
              position="Achse1";
              radius=2.5;
                     condition="alive this";
                     statement="this exec ""\Tx_Utils\cargo\cargo_carry.sqs"";";
                      };

       };
      
};


      class TxU_WeaponsCrate:TxU_BaseCrate
      {
         displayName="Weapons Crate";
         scope=2;
         class EventHandlers
            {
            init   = "(_this select 0) setobjecttexture [0,{\tx_utils\mdl\weplab.paa} ]; if(format[{%1},TxU_On]=={scalar bool array string 0xfcffffef})then{_this call loadfile{\Tx_Utils\TxU_init.sqf};};_this exec{\Tx_Utils\Cargo\Cargo_Init.sqs};";
            };
         class UserActions
      {
            class Carry
              {
              displayName="Carry Weapons crate";
              position="Achse1";
              radius=2.5;
                     condition="alive this";
                     statement="this exec ""\Tx_Utils\cargo\cargo_carry.sqs"";";
                      };

       };
      };


and just incase there is someone about who can check the label selection is set up correctly, here's the model (unformatted)

http://www.terox.nildram.co.uk/ofpec/mdl.rar


if the entire addon is required, i can make that possible via a pm, it isnt ready for beta testing just yet



Thanks very much in advance of any help offered, this has been bugging me for 2 weeks now



Zeus ARMA2 server IP = 77.74.193.124 :2302
Teamspeak IP = 77.74.193.123

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re: Config class setobjecttexture problem
« Reply #1 on: 11 Jul 2006, 18:38:42 »
You need to add this into the crate config

Code: [Select]
hiddenSelections[]={"label"};
Like this:
Code: [Select]
class TxU_AmmoCrate:TxU_BaseCrate
{
      scope=2;
      displayName="Ammo Crate";
      hiddenSelections[]={"label"};
         
         class EventHandlers
         {
         init   = "(_this select 0) setobjecttexture [0,{\tx_utils\mdl\aclab.paa} ]; if(format[{%1},TxU_On]=={scalar bool array string 0xfcffffef})then{_this call loadfile{\Tx_Utils\TxU_init.sqf};};_this exec{\Tx_Utils\Cargo\Cargo_Init.sqs};";
         };     

      class UserActions
      {
            class Carry
           {
              displayName="Carry Ammo crate";
              position="Achse1";
              radius=2.5;
              condition="alive this";
              statement="this exec ""\Tx_Utils\cargo\cargo_carry.sqs"";";
            };

       };
};

The integer in the setObjectTexture array refers to the hiddenSelections array...
And it works like arrays in scripting do, 0 means the first entry in the hiddenSelections, and so on...

EDIT:
Umm, and yes, you're correct, simulation="house" apparently does not support setObjectTexture (probably it just won't read hiddenSelections)...
« Last Edit: 11 Jul 2006, 18:44:32 by HateR_Kint »
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline Terox

  • Former Staff
  • ****
  • Follow the Sappers!
    • zeus-community.net
Re: Config class setobjecttexture problem
« Reply #2 on: 11 Jul 2006, 21:01:43 »
You need to add this into the crate config

Code: [Select]
hiddenSelections[]={"label"};

Thanks a lot m8, that did the trick.
I was under the impression hidden selections was only used for hiding, or making visible certain selections.

thx for the info
Zeus ARMA2 server IP = 77.74.193.124 :2302
Teamspeak IP = 77.74.193.123