Captain Apple 12 Posted April 9, 2018 I'm trying to make the SUVs (which are spawned in already after server start) to be black on global, not client only. i know the command is "setObjectTextureGlobal" but i dont know how to use it. Could anyone help me make the SUV color black? Cheers Share this post Link to post Share on other sites
Harzach 2516 Posted April 9, 2018 https://community.bistudio.com/wiki/setObjectTextureGlobal _suv setObjectMaterialGlobal [0, "\a3\data_f\default.rvmat"]; _suv setObjectTextureGlobal [0, "#(rgb,8,8,3)color(0,0,0,1)"]; Depending upon how you are spawning them, of course. I have used "_suv" as a placeholder. The color is defined by the "...color(0,0,0,1)" section. The first three numbers are RGB values, and the fourth is alpha: "...color(Red,Green,Blue,Alpha)". If you wanted something full red, it would be "...color(1,0,0,1)". If you wanted something dark green, it would be along the lines of "...color(0,0.3,0,1)". Share this post Link to post Share on other sites
Captain Apple 12 Posted April 9, 2018 Just now, Harzach said: https://community.bistudio.com/wiki/setObjectTextureGlobal _suv setObjectMaterialGlobal [0, "\a3\data_f\default.rvmat"]; _suv setObjectTextureGlobal [0, "#(rgb,8,8,3)color(0,0,0,1)"]; Depending upon how you are spawning them, of course. I have used "_suv" as a placeholder. could it just be "this"? Share this post Link to post Share on other sites
HazJ 1289 Posted April 9, 2018 Yes, if in Editor object init. 1 Share this post Link to post Share on other sites
Harzach 2516 Posted April 9, 2018 Again, it depends on how you are spawning them. Share this post Link to post Share on other sites
Captain Apple 12 Posted April 9, 2018 yeah im doing it in the init Share this post Link to post Share on other sites
Captain Apple 12 Posted April 9, 2018 now if i already have this: 0 = [ this, 30, false, {}, 100, 500, -1, true ] call QS_fnc_registerVehicle; in the init, how would i combine it with the suv thing? Share this post Link to post Share on other sites
Harzach 2516 Posted April 9, 2018 The semicolon at the end of your code defines the end of it and separates it from any following code. https://community.bistudio.com/wiki/SQF_syntax 0 = [this,30,false,{},100,500,-1,true] call QS_fnc_registerVehicle; this setObjectMaterialGlobal [0, "\a3\data_f\default.rvmat"]; this setObjectTextureGlobal [0, "#(rgb,8,8,3)color(0,0,0,1)"]; Share this post Link to post Share on other sites
Harzach 2516 Posted April 9, 2018 BTW, using this method, we are "painting over" the default texture with plain flat color, which tends to look unnatural. If you want to use the default black texture that is available to the SUV, maybe try this instead: this setVariable ["color", 1]; If you want to use the other default textures, just change the second element. 0 = red 1 = black 2 = grey 3 = orange Share this post Link to post Share on other sites
Captain Apple 12 Posted April 10, 2018 it just aint working :( Share this post Link to post Share on other sites
Harzach 2516 Posted April 10, 2018 Not working in MP, or at all? Maybe this: _null = this spawn {_this setObjectTextureGlobal [0, "\A3\Soft_F_Gamma\SUV_01\Data\SUV_01_ext_02_CO.paa"];}; I am without a dedi server for a while so I can't do any MP testing. Sorry! Share this post Link to post Share on other sites
stanhope 409 Posted April 10, 2018 If you're running that code right after spawning the vehicle in it'll most likely be overwritten by the randomizer (civilian vehicles and some other things will get a random camo after spawning in). In single player this will happen near instantly, before your command to change the color has been run. In a dedi server it could be that the randomization happens after your command has already been executed. What you could do is spawn the code as above but with half a second of sleep. That or turning of the randomization, sleeping is easier. So: _null = this spawn {sleep 0.5; _this setObjectTextureGlobal [0, "\A3\Soft_F_Gamma\SUV_01\Data\SUV_01_ext_02_CO.paa"];}; (I didn't test so no guarantees) If you're not running this code right after spawning the vehicle in ignore everything I said :) Share this post Link to post Share on other sites
Harzach 2516 Posted April 10, 2018 I think he's adding it to each unit's init in the editor? On 4/9/2018 at 1:43 PM, Captain Apple said: yeah im doing it in the init So I'm confuzzled. I know I've banged my head up against setObjectTextureGlobal before, maybe its utilization is still beyond my understanding. Share this post Link to post Share on other sites
Captain Apple 12 Posted April 11, 2018 yeah im putting it in SUVs init in the editor. No luck again with _null = this spawn {sleep 0.5; _this setObjectTextureGlobal [0, "\A3\Soft_F_Gamma\SUV_01\Data\SUV_01_ext_02_CO.paa"];}; Share this post Link to post Share on other sites
Harzach 2516 Posted April 11, 2018 Again, not working in MP, or not working at all? Share this post Link to post Share on other sites
Captain Apple 12 Posted April 11, 2018 im only testing in MP cuz i need it only in MP. Also the mission file wont work on SP, its mean for mp. Share this post Link to post Share on other sites
stanhope 409 Posted April 11, 2018 Right I just went into the editor, put down a unit, an SUV and pasted this in the int-field of the suv: this setObjectTextureGlobal [0, "\A3\Soft_F_Gamma\SUV_01\Data\SUV_01_ext_02_CO.paa"]; The SUV was black when I played the mission as multiplayer. (I also packed it into a PBO, booted up my dedi server and put the PBO on there, the SUV was black) Are you trying to do this in an existing mission? If you're editing an existing mission, which one is it? Share this post Link to post Share on other sites
Captain Apple 12 Posted April 11, 2018 worked, had to implement it in a sqf file, invade & annex framework.. It was overriding everything done in editor. 1 Share this post Link to post Share on other sites
Captain Apple 12 Posted April 11, 2018 thank you all for replying! Appreciate you sticking with me Share this post Link to post Share on other sites
Midnighters 152 Posted April 13, 2018 just to clarify: "this" (without underscore) , is an editor only thing. So inside triggers, init boxes, etc it exists / is defined. whenever you're making an SQF script you may see: _this , which will either be the parameters passed to the script, or depending on what you're using it may be a special variable for something. 1 Share this post Link to post Share on other sites