If you haven’t read “How-To Begin Customizing a DayZ Mod Server“, now is a good time.
One way to add script actions is to make them a right-click on objects (via the inventory screen). This method is used to wear clothes, fill water bottles, take antibiotics and the like.
You’ll need to create a custom file named “extra_rc.hpp” and include it in description.ext of the mission.
Creating a custom compiles.sqf
-
- Create a new directory, named “custom” in the mission folder
- Create a new filed named “extra_rc.hpp” in that folder with the following contents:
class ExtraRc { // Add all your custom classes here. };
- Edit description.ext in the mission folder and and the bottom add:
#include "custom\extra_rc.hpp"
- Add custom right-click options like this:
class Skin_Soldier1_DZ { class clothing1 { text = "Wear GUE"; script = "['Skin_Soldier1_DZ','GUE_Soldier_CO'] execVM 'custom\skins\changeSkin.sqf'"; }; class clothing2 { text = "Wear GUE CO"; script = "['Skin_Soldier1_DZ','GUE_Commander'] execVM 'custom\skins\changeSkin.sqf'"; }; };
where
"Skin_Soldier1_DZ" - the classname of the object to add right-click "clothing1" and "clothing2" - should be unique if you add multiple items. There is a limit to the number of right-click options you can add(4 or 5?) text - The menu label that shows up as the right-click. script - script to run. Be very careful with the quotes. In this example, the values in the [] are the paramters passed to the script being executed via execVM.
Advertisements