Jump to content

Captain Apple

Force vehicle color global

Recommended Posts

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
  On 4/9/2018 at 5:38 PM, 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

Yes, if in Editor object init.

  • Like 1

Share this post


Link to post
Share on other sites

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

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

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

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

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

worked, had to implement it in a sqf file, invade & annex framework.. It was overriding everything done in editor.

  • Like 1

Share this post


Link to post
Share on other sites

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.

  • Like 1

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×