Jump to content
Sign in to follow this  
L3TUC3

Add flag to vehicle

Recommended Posts

Silly little imurshun script, since every insurgent/counterinsurgent seems to have a massive flag on their ride nowadays.

 

datflag_zpsvqxyssze.jpg

_flag = "rhs_Flag_chdkz" createVehicle _pos; // create a flag at position _pos
_flag setFlagTexture 'img\isisflag.jpg'; // set the flag texture as image in mission folder "img" folder
_flag attachTo [_vehicle, [selectRandom [-0.75,0.75], -2, 0.75]]; // attach the flag to a position that makes sense

Can be adapted to just about anything as long as you have a flag image .jpg or .paa to use. Getting the flag position right on the vehicle may take some fiddling.

Edited by L3TUC3

Share this post


Link to post

There were some requests to run this from init boxes:

if (isServer) then 
{
  _null = [this, getPos this] spawn 
  { 
    _vehicle = _this select 0; 
    _pos = _this select 1; 
    _flag = "rhs_Flag_chdkz" createVehicle _pos;
    _flag setFlagTexture 'img\isisflag.jpg';
    _flag attachTo [_vehicle, [selectRandom [-0.75,0.75], -2, 0.75]];
  };
};

Now you can.

Share this post


Link to post

demflag_zpsjrrg4yrc.jpg

if (isServer) then  
{ 
  _null = [this, getPos this] spawn  
  {  
    _vehicle = _this select 0;  
    _pos = _this select 1;  
    _flag = "rhs_Flag_chdkz" createVehicle _pos; 
    _flag setFlagTexture "\A3\Data_F\Flags\flag_us_co.paa"; 
    _flag attachTo [_vehicle, [selectRandom [-0.95,0.95], -1.88, 0.80]]; 
  }; 
};

No custom image required, just stuff it in the init box.

Share this post


Link to post

Thanks for the code I'm using it with some Iraqi Units.  I have to say that adjusting the attach to is very annoying.(not your fault)  Can't seem to figure out which number does what.  Just when I think I've figured it out, what I thought was right is wrong.

Share this post


Link to post

You're looking at an array of lateral adjustments from the center of the model in [X,Y,Z]. First is the X axis (width), then Y (length) and Z (height).

 

For example:

_flag attachTo [_vehicle, [0, 0, 0]];

Will attach the flag dead center to the vehicle.

 

Breaking it down:

_flag attachTo [_vehicle, [
1, //X axis, width
1, //Y axis, length
1  //Z axis height
]];

Will attach the flag 1 meter to the right, 1 meter to the back and 1 meter up relative to the center of the model.

_flag attachTo [_vehicle, [-1, -1, -1]];

Will attach the flag 1 meter to the left, 1 meter to the front and 1 meter down relative to the center of the model.

 

By using selectrandom you can do things like this

_flag attachTo [_vehicle, [
selectRandom [-1,1],  //Put the flag 1 meter left OR right on the vehicle
1, //1 meter to the back 
1  //1 meter up
]];

That way you reduce the clone vehicle feeling.

Edited by L3TUC3

Share this post


Link to post

Good lawd I intend to use this on some Warriors... Eventually

 

f1-1.jpg

Edited by JakCurse

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...