Results 1 to 8 of 8

Thread: setobjectTexture script

  1. #1

    setobjectTexture script

    hi,

    currently, I create textures for FAB's german soldiers for giving more diversity; I tried to use his setobjectTexture (used for the helmets), but without any success, someone could help me with that. In fact to use this script for the uniforms (only the vest).
    Sennacherib aka d@nte

    Un ali mat zo mat bepred Ha pa ve digant ur sot e ve

    (Good advice is always good, even though it comes from an idiot).

  2. #2

  3. #3
    Warrant Officer Sennacherib's Avatar
    Join Date
    Feb 1 2006
    Location
    Brittany
    Posts
    2,046
    Author of the Thread
    well, the way how to use this script. I want also to separate it from the whole mod. FAB used a lot of files with mutual links for example: class eventhandler: eca_manevanthandler etc etc. I tried to separate the scrip from the mod but that doesn't work. Even in oxygen I don't understand how He put different textures on the same part of a model. he used a plane but I don't understand how he attached all the textures to this plane ?: for example: helm_camo, helm_camo2, helm_camo3 etc etc

    FAB's c++ were, are, will be, always a mystery for me

  4. #4
    Ok, so

    you must have relevant sections defined in the cfgmodels, AND defined in the p3d model :


    PHP Code:
    class CfgModels
    {
        class Default
        {
            
    sections[]={};
            
    sectionsInherit="";
        };
        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",
                    
    "armpatch"
                
    };
            
    sectionsInherit=Head;
            };

        class 
    my_soldier Man{
        
    sections[]={"helmet","arm","jacket"};
         
    sectionsInherit="man";
                };


    }; 
    Then, a hiddenselection entry in the cfgvehicles :


    PHP Code:
    class CfgVehicles
    {
        class 
    All{};
        class 
    AllVehiclesAll{};
        class 
    LandAllVehicles{};
        class 
    ManLand{};
        class 
    SoldierMan{};
        class 
    CivilianMan{};
        class 
    SoldierWBSoldier{};
        class 
    OfficerWSoldierWB{};

        class 
    SoldierEBSoldier{};
        class 
    OfficerESoldierEB{};

        class 
    SoldierGBSoldier{};
        class 
    OfficerGSoldierGB{};

        class 
    my_soldierSoldierWB
                 
    {
                
    vehicleclass="blabla"
            
    side=TWest;
            
    displayName="my beautiful soldier";
            
    model="\path to my model\my_soldier.p3d";
            
    hiddenSelections[]={"helmet","arm","jacket"};
            
    weapons[]={blabla};
            
    magazines[]={blabla};

                

        };
        }; 
    Then you can use a script to hide / unhide hidden selection AND to change their textures by script with the setobjecttexture command :

    [name of the soldier] exec "texture.sqs" :

    Texture.sqs :

    PHP Code:
    _soldier _this Select 0

    _soldier setObjectTexture 
    [0"\path to my texture\my_texture.pac"]

    Exit 
    "0" in the setobjecttexture array points to the first element of the hiddenselections array ("helmet" in this example) :

    PHP Code:
    _soldier setObjectTexture [1"\path to my texture\my_texture.pac"
    points to the second element, "arm" here.

    Finally, the quality of the texture loaded may be bad (i still don't know why), so it's usually better if the texture is loaded BEFORE the setobjettexture command is launched (for example, one vertice of the model is already textured with this texture).

  5. #5
    Warrant Officer Sennacherib's Avatar
    Join Date
    Feb 1 2006
    Location
    Brittany
    Posts
    2,046
    Author of the Thread
    thx mate, I'm going to try that.

    Finally, the quality of the texture loaded may be bad (i still don't know why), so it's usually better if the texture is loaded BEFORE the setobjettexture command is launched (for example, one vertice of the model is already textured with this texture).
    ok, this is why FAB used a plane associated with the soldier model?

  6. #6
    Probably. Fab has so much more knowledge on this game than us, it's a shame he left.

  7. #7
    If you don't load the texture onto the model,somewhere,before setobjecttexture is executed,
    you'll get a horrible image.The only way I've successfully done it,is to use Vektorboson's
    Dialog method
    .I expanded on his findings slightly by using multiple images and leaving out
    the description.ext.So I ended up with an addon that contained a variety of textures,but only
    one model.A resource.cpp/bin is still needed though.

    Although it works for me,and others,some people reported odd graphical errors.

    If you go the old way,then you need to have every texture you intend to use applied to the model.
    It doesn't matter where.It's a really inefficient approach even though it works.
    Last edited by Macser; Jul 27 2012 at 14:08.


  8. #8
    Warrant Officer Sennacherib's Avatar
    Join Date
    Feb 1 2006
    Location
    Brittany
    Posts
    2,046
    Author of the Thread
    thx, but this seems too much complicated for me, i'm not at all familiar with the programming. I think that i'm going to use the inefficient approach, at least this is easier for me

    @Prof,

    yes, FAB was one of the master of OFP.

Similar Threads

  1. setObjectTexture with script
    By matosinec in forum ARMA 2 & OA : MISSIONS - Editing & Scripting
    Replies: 19
    Last Post: Jun 17 2012, 05:28
  2. setObjectTexture
    By Pidzej in forum ARMA - TROUBLESHOOTING
    Replies: 0
    Last Post: Apr 30 2008, 14:18
  3. using the setobjecttexture?
    By clemaldi in forum TROUBLESHOOTING
    Replies: 2
    Last Post: Jan 16 2006, 09:34
  4. SetObjectTexture
    By RKSL-Rock in forum OFP : CONFIGS & SCRIPTING
    Replies: 5
    Last Post: Dec 1 2004, 08:01
  5. Setobjecttexture
    By Doolittle in forum OFP : MISSION EDITING & SCRIPTING
    Replies: 3
    Last Post: Jul 2 2003, 03:27

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •