Jump to content
Sign in to follow this  
James_Thornton

Toggleable Ghillie suit

Recommended Posts

Hey guys, I'm still pretty new at mission editing so I have no idea if this is even possible. I was wondering if there was a way to add an action to the action menu that would toggle between a units default uniform and a ghillie suit.

To my knowledge this may not even be possible but if any of you out there more experienced than I could tell me how to make it happen or let me know that it can't work that would be great.

Share this post


Link to post
Share on other sites

Unless you use an addon, such as the one posted above, it is not possible. The gillie suit is not an item or weapon, it is character model.

Share this post


Link to post
Share on other sites

That addon is simply a collection of images you can use to swap on the fly. You could just extract the images and put them in a mission and use scripting to swap them.

Share this post


Link to post
Share on other sites

Ah, if it would be that easy....

The main problem is the config in which it is defined how good a unit is spottable. Obviously this value is lower for a unit with modelled Ghillie suit. So changing uniform (texture) wouldn't change this value, even with regular uniform the AI would still threat you as you were wearing the ghillie suit...or vice versa.

The only thing that could work would be some fancy teamswitch script.

Share this post


Link to post
Share on other sites

Could you not just destroy the character and replace it with the sniper character?? That would be the easiest way to do it...

Share this post


Link to post
Share on other sites

Bah, read this wrong, thought you were asking about changing the colors of the ghillie suit. :|

Share this post


Link to post
Share on other sites
Could you not just destroy the character and replace it with the sniper character?? That would be the easiest way to do it...

By 'destroying' the character whom he is playing, you are killing it and him. I don't think that would work too well. ;)

Share this post


Link to post
Share on other sites

Yeah I was just wondering if anyone has come up with a script to switch uniform in game. Guess not. Thanks for the input though guys.

Share this post


Link to post
Share on other sites

Not necessarily. I have made a quick script here.

On a map, add 2 units. The current player and the uniform you want to switch to.

The switch - to - ghillie suit guy must be WELLL out of harms way. Put him in the safest spot you can. And leave the Rifleman (the Player's original suit) where it should be, in a group or wherever.

Riflman - Name: rf

Sniper - Name: sni

UniSwitch.sqf

private ["_snipos","_rfmpos","_dir","_group"];

_snipos = getPos sni;
_rfmpos = getPos rf;
_dir = getDir player;
_group = group player;

titleText ["Changing Clothes", "BLACK OUT", 2];
sleep 2;
sni setPos _rfmpos;
rf setPos _snipos;

if (player == rf) then 
{
    [rf] join grpNull;
    selectPlayer sni;
    [sni] joinSilent _group;
} else
{
    [sni] join grpNull;
    selectPlayer rf;
    [rf] joinSilent _group;
};
sleep 1;
titleText ["Changing Clothes", "BLACK IN", 2];
player setDir _dir;
exit;

init.sqf

private ["_uniform"];

_uniform = rf addAction ["Change Uniform", "UniSwitch.sqf"];
_uniform = sni addAction ["Change Uniform", "UniSwitch.sqf"]; 

enableTeamSwitch false;

If anyone knows how to get the "current weapon" and "current magazine" of the player, then you can set it so that every time you change your clothes, your weapon's stay the same.

If you would like me to upload a mission i wouldnt mind.

---------- Post added at 10:49 PM ---------- Previous post was at 10:43 PM ----------

i changed the init.sqf script to say enableteamswitch false.

Edited by WoodyUK

Share this post


Link to post
Share on other sites

Isn't the how to copy the weapon stuff in the above link any use WoodyUK.

Oh I see it doesn't.

Would be cool if you can get it sorted.

Edited by F2k Sel

Share this post


Link to post
Share on other sites

Hey F2k Sel thanks for mentioning about the weapon stuff on the other script.

I incorporated it into UniSwitch.sqf and it works! Plus i added something else... current animation state of the player. If the player changes his clothes while Prone, Standing, Swimming, Crouching it will remember it and puts the uniformed unit into that same position.

private ["_snipos","_rfmpos","_dir","_group","_weapons","_primweap","_magazines","_muzzles","_mov"];

_snipos = getPos sni;
_rfmpos = getPos rf;
_dir = getDir player;
_group = group player;
_weapons = ((weapons player) - (items player));	// weapons of the old unit
_primweap = currentWeapon player;	// primaryWeapon of the old unit
_magazines = magazines player;	// magazines of the old unit
_mov = animationState player;

titleText ["Changing Clothes", "BLACK OUT", 2];
sleep 2;
sni setPos _rfmpos;
rf setPos _snipos;

if (player == rf) then 
{
    [rf] join grpNull;
    selectPlayer sni;
    [sni] joinSilent _group;
} else
{
    [sni] join grpNull;
    selectPlayer rf;
    [rf] joinSilent _group;
};
sleep 1;

player switchmove _mov;

// New Unit gets the sames weapons as the old unit
removeAllWeapons player;
{player addMagazine _x} forEach _magazines;
{player addWeapon _x} forEach _weapons;

// Select the primaryWeapon	
player selectWeapon _primweap;

// Fix for weapons with grenade launcher
_muzzles = getArray(configFile>>"cfgWeapons" >> _primweap >> "muzzles");
player selectWeapon (_muzzles select 0);

titleText ["Changing Clothes", "BLACK IN", 2];
player setDir _dir;
exit;

dont forget to credit "Cyborg11" for getting the weapons stuff to work in the other script.

Share this post


Link to post
Share on other sites

Hi Woody,

I have used a variant on your, and Cyborg's, code in a modded (highly) Domination mission.

I have a total of 9 snipers of different factions that can choose 3 different ghillie suits each

(Woodland, Grassland, and Urban) plus their default sniper outfits.

Took some lateral thinking, but it is doable.

Thanks to all for the ideas.

Share this post


Link to post
Share on other sites

i know this thread is several months old by now by i just learned about this script and am using it in several creations but i ran into a little problem

with the release of the Nimitz i thought i would build a mission where the player will start as a USMC officer get briefed by the CO and then change his uniform to his combat uniform the changing part goes as it should but only the height does'nt seem to work (i change to the seal like it should and at the location the officer was but instead of being 12meter up high i am at 0m swimming in the water (location is good but only height is false )

is there a way to get that working ? tnx in advance

(ps i use the version woodyuk posted last)

Share this post


Link to post
Share on other sites

Never having used the script I would guess that you need to spawn a little higher or you will fall into the water.

Looking at the code One or both of these may need changing

Change

sni setPos _rfmpos;
rf setPos _snipos;

To

sni setPos [getpos _rfmpos select 0,getpos _rfmpos select 1,(getpos _rfmpos select 2)+1];
rf setPos  [getpos _snipos select 0,getpos _snipos select 1,(getpos _snipos select 2)+1];

You may need to adjust the hight which is the last number on each line and you'll probably only need one of the lines changing.

Share this post


Link to post
Share on other sites

How can you get this for repeat use? Testing this, it works great putting the ghillie suit on, then taking it off. But that's it, after that you can no longer use it. Any ideas?

Share this post


Link to post
Share on other sites

Hi, I am trying to figure out a way to be able to toggle a ghillie suit in ARMA 3. Is it possible?

I've been reading a few posts from ARMA 2 and OA, and to do this, they use either an AddOn or script a uniform change with another unit.

Is there a way to just have a ghillie suit that "toggles on/off" through the action menu, while keeping any loadout the unit currently has?

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  

×