Sennacherib 0 Posted July 26, 2012 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). Share this post Link to post Share on other sites
ProfTournesol 956 Posted July 26, 2012 Yep, what do you need precisely ? Share this post Link to post Share on other sites
Sennacherib 0 Posted July 26, 2012 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 :butbut: Share this post Link to post Share on other sites
ProfTournesol 956 Posted July 27, 2012 Ok, so you must have relevant sections defined in the cfgmodels, AND defined in the p3d model : 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 : class CfgVehicles { class All{}; class AllVehicles: All{}; class Land: AllVehicles{}; class Man: Land{}; class Soldier: Man{}; class Civilian: Man{}; class SoldierWB: Soldier{}; class OfficerW: SoldierWB{}; class SoldierEB: Soldier{}; class OfficerE: SoldierEB{}; class SoldierGB: Soldier{}; class OfficerG: SoldierGB{}; class my_soldier: SoldierWB { 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 : _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) : _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). Share this post Link to post Share on other sites
Sennacherib 0 Posted July 27, 2012 thx mate, I'm going to try that. Quote 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? Share this post Link to post Share on other sites
ProfTournesol 956 Posted July 27, 2012 Probably. Fab has so much more knowledge on this game than us, it's a shame he left. Share this post Link to post Share on other sites
Macser_old 0 Posted July 27, 2012 (edited) 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. Edited July 27, 2012 by Macser Share this post Link to post Share on other sites
Sennacherib 0 Posted July 27, 2012 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 :p @Prof, yes, FAB was one of the master of OFP. Share this post Link to post Share on other sites