All this can be done using very simple code in the INIT line of a unit (shown below):
From here we can alter many properties for the character such as headgear, goggles, vests, uniforms and backpacks using a single line of code.
unit addHeadgear "Classname";
The unit component describes which soldier is to be edited, for example this or player. The addHeadgear component is the actual command, this will assign whatever object is written after it to the correct part, In this case the head, to the unit described. Finally, the "Classname" component is the actual item to be assigned. Classnames aren't as simple as just typing the name of the item, but a way to find them easily will be detailed in later post.
Those are the components that make up the command. But what about actual working code? Below is an example of a command that will place the Digital Camo Military Cap onto the soldier named s_marksman:
s_marksman addHeadgear "H_MilCap_dgtl";
Simply write this into the init line of any character and it will place it on the s_marksman soldier. If you want to place the Cap onto the current unit without a name or just for ease of coding, the unit component can be replaced with this.
this addHeadgear "H_MilCap_dgtl";
This command will assign the Digital Military Cap to whatever unit the line is placed in. It can be used in as many units as you like and will not conflict.
With these commands you can create a quick, customised character to suit your liking or environment. Here is an example to create a Recon Marksman styled soldier:
this addheadgear "H_Watchcap_camo";
this addUniform "U_I_CombatUniform";
this addVest "V_PlateCarrierIA1_dgtl";
this addBackpack "B_AssaultPack_ocamo";
this addGoggles "G_Shades_Black";
Here is what the soldier will look like after the code is placed:
The soldier is now fit for operations and also does a great job at looking awesome too. Below is a summary of all the code and components:
_________________________________________________________________________________
The basic outline of the command:
unit command "Classname";
A simple command to assign the item to the current soldier
this addHeadgear "H_MilCap_dgtl";
Completely re-dress the soldier:
this addheadgear "H_Watchcap_camo";
this addUniform "U_I_CombatUniform";
this addVest "V_PlateCarrierIA1_dgtl";
this addBackpack "B_AssaultPack_ocamo";
this addGoggles "G_Shades_Black";
this addUniform "U_I_CombatUniform";
this addVest "V_PlateCarrierIA1_dgtl";
this addBackpack "B_AssaultPack_ocamo";
this addGoggles "G_Shades_Black";
The next post will be looking at how to remove items, weapons and gear from soldiers to allow for easier customising and replacing.
Question on adding mod weapons to the script. How do I find the name of a weapon?
ReplyDeleteYou need to use the Config Viewer. To do this simply pause the game. Click "Config" to open the viewer and navigate to the CfgWeapons folder [On the left hand pane]. Once this is opened feel free to take any of the weapon classnames stored there. I will post a tutorial for this ASAP.
DeleteThanks,
Detective Potato
Exelent post man! thanks!!
ReplyDeleteThis comment has been removed by a blog administrator.
ReplyDeleteHow beautifully all the feelings have been conveyed through writing.
ReplyDeleteLesbian Flag
This is a splendid website! I"m extremely content with the remarks!. blouse back neck designs
ReplyDelete