Jump to content
Sign in to follow this  
chaseh27

Setting Color of Offroad?

Recommended Posts

Is it possible to set the color of the Offroad Trucks in the editor? Is there some sort of script maybe? I saw on Stratis Life you can choose what color truck you want.

Share this post


Link to post
Share on other sites

not just color you can customise a lot of things. Look up in offroad folder in addons on how they did it

Share this post


Link to post
Share on other sites

Thanks for the reply. What do you mean by "Look up in offroad folder in addons"?

Share this post


Link to post
Share on other sites

For the animated states of the vehicle (set any of em to 0 to get it to show):

_this animate ["HidePolice", 1];
_this animate ["HideServices", 1];
_this animate ["HideBackpacks", 1];
_this animate ["HideBumper1", 1];
_this animate ["HideBumper2", 1];
_this animate ["HideConstruction", 1];
_this animate ["HideDoor1", 1]; 
_this animate ["HideDoor2", 1];
_this animate ["HideDoor3", 1];
_this animate ["HideGlass2", 1]; (Suppose Glass1 & 3 might also excist?)

And for the colors (change _rnd1 to prefered color. Not sure which is which):

_rnd1 = floor random 6;
_this setObjectTexture [0, ["\A3\soft_F\Offroad\Data\offroad_ext_co.paa", 
"\A3\soft_F\Offroad\Data\Offroad_ext_BASE01_CO.paa", 
"\A3\soft_F\Offroad\Data\Offroad_ext_BASE02_CO.paa", 
"\A3\soft_F\Offroad\Data\Offroad_ext_BASE03_CO.paa", 
"\A3\soft_F\Offroad\Data\Offroad_ext_BASE04_CO.paa",
"\A3\soft_F\Offroad\Data\Offroad_ext_BASE05_CO.paa"] select _rnd1 ];

_this setObjectTexture [1, ["\A3\soft_F\Offroad\Data\offroad_ext_co.paa", 
"\A3\soft_F\Offroad\Data\Offroad_ext_BASE01_CO.paa", 
"\A3\soft_F\Offroad\Data\Offroad_ext_BASE02_CO.paa", 
"\A3\soft_F\Offroad\Data\Offroad_ext_BASE03_CO.paa", 
"\A3\soft_F\Offroad\Data\Offroad_ext_BASE04_CO.paa", 
"\A3\soft_F\Offroad\Data\Offroad_ext_BASE05_CO.paa"] select _rnd1 ];

These only work local so you have to exec them on all clients.

I found these by extracting the init script of the offroad: "\A3\soft_F\Offroad\scripts\randomize.sqf".

I have no idea how to retrieve a list of animation states & textures. Searched to config files for these names but couldn't find any. Anyone can tell where to look?

Share this post


Link to post
Share on other sites
HidePolice"  //police lights on roof and grill
HideServices" //yellow roof lights and bullbar and rear rollcage, tools and bits in rear
HideBackpacks" //backpacks hanging on side of vehicle
HideBumper1" //flat iron bar style bumper
HideBumper2" //round bullbar bumper with winch
HideConstruction" //rollcage in rear
HideDoor1" //drivers door
HideDoor2" //passenger door (also needs the door glass hidden - "HideGlass2")
HideDoor3" //rear flap
HideGlass2" //passenger door glass

setObjectTexture 0 //body work
"\A3\soft_F\Offroad\Data\offroad_ext_co.paa", //red
"\A3\soft_F\Offroad\Data\Offroad_ext_BASE01_CO.paa", //yellow
"\A3\soft_F\Offroad\Data\Offroad_ext_BASE02_CO.paa", //white
"\A3\soft_F\Offroad\Data\Offroad_ext_BASE03_CO.paa", //blue
"\A3\soft_F\Offroad\Data\Offroad_ext_BASE04_CO.paa", //darkred
"\A3\soft_F\Offroad\Data\Offroad_ext_BASE05_CO.paa", //darkblue

setObjectTexture 1 //rims, varying degrees of silver - black , dirty
Using same textures as above

  • Like 1

Share this post


Link to post
Share on other sites

Where am I putting these? I tried putting "_this animate ["HidePolice", 1];" in the Debug Console but I get "Error Generic error in expression".

Edited by chaseh27

Share this post


Link to post
Share on other sites
Where am I putting these? I tried putting "_this animate ["HidePolice", 1];" in the Debug Console but I get "Error Generic error in expression".

use the vehicle name and not _this in the debug console - _this is a local variable that can only be used inside a script (and a few other places), but not in the editor

Share this post


Link to post
Share on other sites

So I name it car1 for example, and then put "car 1 animate ["HidePolice", 1]" in the debug?

Share this post


Link to post
Share on other sites

Ok, so I got the Police lights on top of the car, but now I can't get the colors to work. I did the same thing as I did with the Police lights. Can someone please post an example for making the car white? Thank you

---------- Post added at 21:16 ---------- Previous post was at 20:58 ----------

Oh, and also, if I wanted to create a mission where my friend and I play together over Internet, how do I make these customizations work? Right now, I have to go into the editor and preview the mission then go into the debug and execute it.

Edited by chaseh27

Share this post


Link to post
Share on other sites
Ok, so I got the Police lights on top of the car, but now I can't get the colors to work. I did the same thing as I did with the Police lights. Can someone please post an example for making the car white? Thank you

---------- Post added at 21:16 ---------- Previous post was at 20:58 ----------

Oh, and also, if I wanted to create a mission where my friend and I play together over Internet, how do I make these customizations work? Right now, I have to go into the editor and preview the mission then go into the debug and execute it.

Shouldn't it work from the initialisation field in multiplayer, since it's run on every client?

Try putting this in the car's init field:

this animate ["HidePolice", 0]; this setObjectTexture [0, "\A3\soft_F\Offroad\Data\Offroad_ext_BASE02_CO.paa"]; this setObjectTexture [1, "\A3\soft_F\Offroad\Data\Offroad_ext_BASE02_CO.paa"];  

Change the number in BASE01 to change between colours. 02 is white, according to Larrow's post, so I put it there.

Share this post


Link to post
Share on other sites

Anyone can shed some light on how to retrieve all the animstates/textures of an object?

Share this post


Link to post
Share on other sites

Well, I have to enable it from the debug console while in-game and there isn't one in multiplayer, only in the editor. Also, is there a reason that you put the "set object texture" twice in your code example?

Share this post


Link to post
Share on other sites

_this setObjectTexture [0 <-- vehicle color

_this setObjectTexture [1 <-- wheels, iron bars and other stuffs

For mission put this in init of a vehicle:

this animate ["HidePolice", 0];

this <--- is the vehicle object inside a init.

Then export your mission to MP and go to main menu and create game with the mission.

Share this post


Link to post
Share on other sites
Well, I have to enable it from the debug console while in-game and there isn't one in multiplayer, only in the editor.

Double click on the car, there's a huge box that reads "INITIALIZATION" next to it. Copy the code into that. No need for the debug console.

Screenshot

---------- Post added at 17:26 ---------- Previous post was at 17:16 ----------

Okay, correction incoming (I should've tested this myself instead of assuming stuff). animate and setObjectTexture do not work through object initialization. Here's another way:

1. Name the car as something (the field above initialisation), in this case I used policeoffroad

2. Create a new trigger (F3 -> double click somewhere)

3. Write "true" as the condition (instead of the original "this")

4. Add this into the trigger's On Act. field:

policeoffroad animate ["HidePolice", 0]; policeoffroad setObjectTexture [0, "\A3\soft_F\Offroad\Data\Offroad_ext_BASE02_CO.paa"]; policeoffroad setObjectTexture [1, "\A3\soft_F\Offroad\Data\Offroad_ext_BASE02_CO.paa"];

This works for me, at least. Sorry for the confusion.

Share this post


Link to post
Share on other sites

Use this in the vehicles init box

handle = this spawn {
sleep 0.1;
_this animate ["HidePolice", 0];
_this setObjectTexture [0, "\A3\soft_F\Offroad\Data\Offroad_ext_BASE02_CO.paa"];
_this setObjectTexture [1, "\A3\soft_F\Offroad\Data\Offroad_ext_BASE02_CO.paa"];
};

Just gives the vehicle a little pause before apply the changes allowing the randomisation script that BIS has placed on the vehicle time to finish before applying your changes

Share this post


Link to post
Share on other sites

This is absolutely awesome! And it's also very easy to use!

jjfuidfmKvldP_xs.jpg j0rgvBQMRBH8H_xs.jpg

jW6PntvAf0e2s_xs.jpg j7FaNqWA6rBHF_xs.jpg

I just wrote a function for an easy offroad setup. Here's a preview ...

handle = this spawn {sleep 0.1; [unit1_Offroad, "black", "police", "no_backpack", "bumper2", "construction", []] call GLT_fnc_Offroad;};

Every combination is possible. I will definately include this function into my next mod update.

  • Like 1

Share this post


Link to post
Share on other sites

is it possible to have a hardtop on the back of these?

Share this post


Link to post
Share on other sites

All the vehicle textures changed with the last classname changes

"\A3\soft_F\Offroad[color="#FF0000"]_01[/color]\Data\Offroad[color="#FF0000"]_01[/color]_ext_co.paa",        //red
"\A3\soft_F\Offroad[color="#FF0000"]_01[/color]\Data\Offroad[color="#FF0000"]_01[/color]_ext_BASE01_CO.paa",  //yellow
"\A3\soft_F\Offroad[color="#FF0000"]_01[/color]\Data\Offroad[color="#FF0000"]_01[/color]_ext_BASE02_CO.paa",  //white
"\A3\soft_F\Offroad[color="#FF0000"]_01[/color]\Data\Offroad[color="#FF0000"]_01[/color]_ext_BASE03_CO.paa",  //blue
"\A3\soft_F\Offroad[color="#FF0000"]_01[/color]\Data\Offroad[color="#FF0000"]_01[/color]_ext_BASE04_CO.paa",  //darkred
"\A3\soft_F\Offroad[color="#FF0000"]_01[/color]\Data\Offroad[color="#FF0000"]_01[/color]_ext_BASE05_CO.paa"   //darkblue

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
Sign in to follow this  

×