Search the Community
Showing results for tags 'setobjecttexture'.
Found 4 results
-
Respawn Module while keeping Textures and Pylon config
ozdeadmeat posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hi everyone, I have written a function that will allow people to configure an aircraft in the 3den editor and have it able to respawn with that exact loadout. I found that I was having very inconsistent results when the respawn module was set to delete or delete with explosion. It has been rock solid since setting the module to preserve. The function deletes the old vehicle once it has all the old data anyway. Instructions You will need two things for this function to work: You will need to create an init.sqf file in your mission folder and paste the code below into it. You will need a respawn module in your mission with the customized vehicles synced to it. Put this code into the Expression section:: [_this, 2] call RESPAWN_VEHICLE; Note: The number allows you to customize what happens with the cargo of the respawning vehicles (guns, medickits etc etc). It is all listed in the function below Optional If you want to be able to edit and move the vehicles as Zeus, you will need to add an "Add Editable Objects" module to your mission and name it ZEUS_EDITABLE and put the variable name of your zeus player unit in the owner section. In the script do a search for "ZEUS_EDITABLE" and uncomment it. Things I am trying to work out currently: - Why the sync commands don't work at all. My goal was the have it pick up all the objects the old vehicle was synced too. Alas I haven't worked that out yet. - Work out if its possible to get all the customizations like missing doors on vehicles from the old vehicle and pass them onto the new one. I have tested this in Multiplayer and it does work. DEMO MISSION AVAILABLE HERE -
Spawn vehicle with hidden selection texture - SetObjectTexture - Help appreciated
MajorBlunderbuss posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hello friends! A couple of days ago I've ran into some trouble I couldn't solve myself, and I found help here very fast. Right now, I'm at the point where I'm unable to find a solution for some sort of problem, again. What I'm trying to achive, is to spawn a vehicle - the AWC 302 Nyx (Wiesel), to be exactly - with alternate, official texture. The Nyx features the standard AAF-Camo, and alternatively an simple Olive-Camo. Since I'm making a own verison of DUWS - many of you will know what this is -, you will also know how those vehicles do spawn: Go to the headquarters, talk to the officer, choose the vehicle, spend the credits, and the vehicle will spawn outside of the HQ. Heres a little insight of how I try to spawn this vehicle with the alternate Olive-Camo: case 18: { if (commandpointsblu1 >= 28) then { hint "Vehicle ready !"; commandpointsblu1 = commandpointsblu1 - 28; ctrlSetText [1000, format["%1",commandpointsblu1]]; _vehic = "I_LT_01_AA_F" createVehicle _spawnPos; _vehic setObjectTexture [0,"Indep_Olive"]; _vehic setObjectTexture [1,"Indep_Olive"]; _vehic setObjectTexture [2,"Indep_Olive"]; _vehic animate ["showTools", 1]; _vehic animate ["showCamonetHull", 1]; _vehic animate ["showBags", 1]; _vehic animate ["showSLATHull", 0]; } else { hint "Not enough command points"; }; }; If I do place the vehicle in 3den-Editor, change it's visuals like the camo, SLAT-Armour, camonet etc., and then export it, copy paste it somewhere, the Olive-Camo is defined as "Indep_Olive", like above. Exported stuff looks like this: _veh = createVehicle ["I_LT_01_AA_F",position player,[],0,"NONE"]; [ _veh, ["Indep_Olive",1], ["showTools",1,"showCamonetHull",1,"showBags",1,"showSLATHull",0] ] call BIS_fnc_initVehicle; Of course I already found out that this won't work with SetObjectTexture, unfortunately. The vehicle does spawn with all the extras like SLAT-Armour, tools, but with missing textures (At least this showed me, that it somehow works). I then tried different things to achive my goal, changed something here and there, tried to find the path to those textures, etc. Funny enough: It's possible to use this code instead of the old one, and spawn the vehicle with all the extras and the correct textures. Bad thing is, It's spawn behaviour is totally different and all over the place - sometimes even glitches into the HQ. Results in apocalypse. If I'd use the new code instead of the old one, it'd look like this: case 18: { if (commandpointsblu1 >= 28) then { hint "Vehicle ready !"; commandpointsblu1 = commandpointsblu1 - 28; ctrlSetText [1000, format["%1",commandpointsblu1]]; _veh = createVehicle ["I_LT_01_AA_F",position player,[],25,"NONE"]; [ _veh, ["Indep_Olive",1], ["showTools",1,"showCamonetHull",1,"showBags",1,"showSLATHull",0] ] call BIS_fnc_initVehicle; } else { hint "Not enough command points"; }; }; It's a long and already ungrateful journey, and I don't know where else to look, what else to do. If there would be someone to point me in the right direction, or is able to make a functioning code of the examples above - old code or new one, doesn't matter as long as it works and the spawn behaviour is correct and identical to the old one, I'd - again - be more than very thankful. Hope to hear from you folks, enjoy your time! Regards, MajorBlunderbuss.- 3 replies
-
- setobjecttexture
- texture
-
(and 4 more)
Tagged with:
-
Configuring an object with switchable textures with setObjectTexture
theVestarr posted a topic in ARMA 3 - ADDONS - CONFIGS & SCRIPTING
Hi all, I've recently taken my first steps in arma modding and have successfully created an object in blender, added textures and materials, imported to the game etc etc. Consists of 7 components and 4 different textures. I'm attaching a picture of it below: It's basically an airport taxiway direction sign, for immersion. These 3 "displays" with letters on them are their own components in the custom LOD (display_L, display_M, display_R) and have an emissive material applied to them (no texture in the material), which works pretty great. However, I would like to be able to switch the textures on those displays with scripting (setObjectTexture command), and I''ve been trying to use hiddenSections for that with no luck so far. When I run getObjectTextures on the object, it returns the ones that are set in the config. If I run setObjectTexture and then getObjectTextures, it gets updated, but nothing changes on the model. Model has these 7 components and display_L, display_M and display_R have the same textures assigned to them in the object editor as the ones mentioned in the config. Here's my configs: model.cfg class CfgModels { class Default { skeletonName = ""; sectionsInherit = ""; sections[] = {}; }; class VAP_DTD_SIGN : Default { skeletonName = "VAP_DTD_SIGN_Skeleton"; sections[] = { "body", "display_L", "display_M", "display_R", "Leg1", "Leg2", "Leg3" }; }; }; class CfgSkeletons { class Default { isDiscrete = 1; skeletonInherit = ""; skeletonBones[] = {}; }; class VAP_DTD_SIGN_Skeleton : Default { skeletonBones[] = { "display_L", "", "display_M", "", "display_R", "" }; }; }; config.cpp class CfgPatches { class VESTARR_AIRPORT_PROPS { requiredAddons[] = {"A3_Structures_F"}; name = "Name"; author = "Vestarr"; url = ""; requiredVersion = 0.1; units[] = {"VAP_DTD_SIGN"}; weapons[] = {}; }; }; class CfgVehicles { class Thing; class VAP_DTD_SIGN : Thing { displayName = "D-T-D Taxiway Sign"; author = "Vestarr"; editorPreview = "\airportshit\data\dtd_sign\icons\dtd_sign_icon.paa"; scope = 2; mapSize = 0.9; accuracy = 1; destrType = "DestructNo"; model = "\airportshit\data\dtd_sign\objects\dtd_sign.p3d"; hiddenSelections[] = {"display_L","display_M","display_R"}; hiddenSelectionsTextures[] = {"\airportshit\data\common\textures\taxiway_dir_b_9_ca.paa", "\airportshit\data\common\textures\taxiway_mark_a_ca.paa", "\airportshit\data\common\textures\taxiway_dir_b_9_ca.paa"}; }; }; Also my material, in case it matters: ambient[]={1,1,1,1}; diffuse[]={1,1,1,1}; forcedDiffuse[]={0,0,0,1}; emmisive[]={100, 80, 28,0.2}; specular[]={0,0,0}; specularPower=2; PixelShaderID="Normal"; VertexShaderID="Basic"; Can anyone shed some light how does this thing work and how to use it properly? I'm really confused. -
Working with proxies and textures
PhoenixArma posted a topic in ARMA 3 - ADDONS - CONFIGS & SCRIPTING
Hey there! I have an object with some proxies in the .p3d file. I would like to be able to do a "setobjecttexture" onto the object and change some selections textures in game. Unfortunately, the texture doesn't change on proxy objects (same hiddenselection name). I worked through this page https://community.bistudio.com/wiki/Arma_3_Setting_Textures_for_Wrecks and tried to adapt this to my problem but no success so far. Anybody who got some experience with this topic? Essentially i want to be able to change the texture of an object and its containing proxies. Thanks in advance!