Finally... after a while trying to figure it out I got it working. Going to make a step by step just in case anyone wants to do it.
1) Add an entry on your ATD_hud.h file for your custom icon. Must be under RSCPicture.... (or the same class as the Hud icons on screen) <-- I'm using Cen's Hud so yours may vary.
//EARPLUGS ICON
class RscPicture_1434: RscPictureGUI
{
idc = 1434;
text = "mods\hud\gui\status\earplugs.paa"; //Change to your custom icon path and name
x = 0.950 * safezoneW + safezoneX; //Change position on screen Left/Right
y = 0.345 * safezoneH + safezoneY; //Change position on screen Up/Down
w = 0.075;
h = 0.10;
colorText[] = {1,1,1,1.0}; //Change color - Current color WHITE
};
2) Open up your dayz_spaceInterrupt.sqf file and add this code (or replace if you already have it) before the line commented as " // Disable ESC after death ". Note: All the credit for this code goes to JS2k6. I do NOT take any credit for it.... I just modified it to add a toggable icon instead of the hint text box.
// JS2k6 Very Simple Earplugs Script (modified for toggable icon)
if (_dikCode == 0x16) then //Press U key to trigger. Change dikCode 0x16 to edit which key to press.
{
if (soundVolume == 1) then {
1 fadeSound 0.25;
player setVariable["plugstate",true]; //Sets Earplug state to True - Earplugs On
}
else
{
1 fadeSound 1;
player setVariable["plugstate",false]; //Sets Earplug state to False - Earplugs Off
};
};
3) Open up player_updateGUI.sqf and add "_state" to the Private scope at the top. Then add this after the _display = uiNamespace getVariable 'DAYZ_GUI_display'; line.
_state = player getVariable["plugstate",false]; // Sets Earplugs icon OFF by default when loading into the game.
_ctrlEarPlugs = _display displayCtrl 1434;
if(_state) then {
_ctrlEarPlugs ctrlShow true;
player setvariable["plugstate",true]; // If value = true, then show icon on screen. Earplugs On
} else {
_ctrlEarPlugs ctrlShow false;
player setvariable["plugstate",false]; // If value = false, then show no icon. Earplugs Off
};
4) Make your own custom icon and place it inside your Mission.PBO. Remember to add the correct directory path and name for the icon back in step 1. ( I labeled it with a comment)
should eb able to add something like
if (player getVariable"humanity") < 5000) then {
blah blah exectute script
in your self actions where you would get the scroll option, so unless you have over 5k you wont get the option to scroll
I was going at that same locking problem for ages and i believe it has something to do with me attaching deployables to P4L system but anyways, after few hours of heavy head scratching and script breaking i've found some sort of solution.
Check out and you only need step 2 like this for every deployable static gun you might ever need
if (_object isKindof "M2StaticMG") then {
_ownerID = "0";
};
Edit: If anyone wants to get this working with P4L, snap and vectors here's my file for reference, it's a mess but works without any errors :D
http://pastebin.com/SyZbD7mz
Do you ever want to use a greater inventory for example in a shed, safe or even a truck/car to craft your buildables ?
Here is the solution CraftInShed.
With this mod admins are able to allow/disallow items with inventoryspace for crafting, also admins are able to allow/disallow craftable objects for crafting in a shed (or similiar).
How to use/what it does :
When a player has the inventory/gear menu open in for example a shed and he want to craft plywood, he took one woodplank item in his inventory rightclick it and choose craft plywood,
the menu will close and the crafting process will start and show you how many items are crafted till now, how many items are left and the approximated time (in mins/secs) left to finish the whole craft process (based on max possible amount and/or space in shed).
It is interruptable at every time, the mats to craft and the crafted items are stored in the shed you use.
The mod is tested over a longer period on our customserver and should work fine, but Im sure YOU will find the one or other minor bug ;)
For admins pls look at line 55-66 for customization. ( The briefcases and weapons [sledgehammer] are disallowed cause of bugs, use at your own risk, backpacks are currently not supported for craftingIn)
I will not have much time to support you, so maybe someone wants to hop in and took the supportersrole, Im thinking of Jossy, as he is doing just fine with cKc ;)
Installation is really easy :
CraftInShed
copy the included player_craftItem.sqf to yourmission.pbo
in yourmission.pbo
open your compiles.sqf
and find :
player_craftItem = compile preprocessFileLineNumbers
then :
change the path of the player_craftItem.sqf to the location of the new one IN yourmission.pbo
CraftInShed.zip
To make the vehicles enterable, remove this code from the script:
_motor addEventHandler ["GetIn",{
_motor = _this select 0;
_player = _this select 2;
if (_player in playableUnits) then {
_player action ['getOut', _motor];
};
}];
Add a custom image to the spawn box.. You can put what ever image you want in this and make it your own :)
What mine looks like.
Add this to your mission.sqm directly above "class Markers"
class Vehicles
{
items=1;
class Item0
{
position[]={1024.3561,5.8548489,2013.7371}; // For Altis us {23600.611,2.8548489,17990.768}
azimut=180.4026;
offsetY=5;
id=1;
side="EMPTY";
vehicle="UserTexture10m_F";
skill=0.60000002;
init="this setObjectTexture [0, ""image.jpg""]";
};
};
Save any image,jpg you want in your mission root folder. Make it square or it will stretch or warp. Mine is 800x800px but i'm sure more or less wont hurt, The user texture will not grow or shrink but the image will.
*EDIT* Removed set texture not needed per VEMP whom I trust knows what hes talking about :)
*EDIT #2*
Alternative method to adding the image to spawn box by: Halvhjearne
1. Create a file called: Debugpic.sqf
2. Paste this code inside.
/*
DebugPic script
by Halv, idea from machine6fd's mission.sqm version
*/
//Change to your picture/path below
_pic = "custom\problemsolving.jpg";
//======================== Do not touch anything below this point ========================\\
if(isServer)then{
diag_log "[DebugPic]: Waiting for 'Debug_static_F' to be build ...";
waitUntil{count(nearestObjects [getMarkerPos "respawn_west", ["Debug_static_F"], 30]) > 0};
_list = nearestObjects [getMarkerPos "respawn_west", ["Debug_static_F"], 30];
_box = _list select 0;
_rPos = _box modelToWorld [-0.226563,-9.76563,-5.04319];
_rDir = (getDir _box)+180;
_obj = createVehicle ["UserTexture10m_F", _rPos, [], 0, "CAN_COLLIDE"];
_obj setDir _rDir;
_obj setPos _rPos;
_obj enableSimulation false;
_obj setObjectTextureGlobal [0,_pic];
diag_log format["[DebugPic]: build texture in %1 @ [%2,%3] with texture '%4'",worldName,_rPos,_rDir,_pic];
};
3. save and upload to mission file.
4. add image file "custom\problemsolving.jpg" or rename.
Working on Altis, Chernarus, and Bornholm (confirmed)
Original post can be found
Parachute Supply Drop Crates addon for Arma3 Epoch (Now with paratrooper AI)
Give your survivors a little love
This is a lightweight mission for dedicated or layer-based game servers. A Mohawk helicopter will fly in from North, South, East or West oceanic spawn positions (chose randomly at mission start), and drop a supply crate (via parachute) to random locations on Altis. The crates are configurable, but 4 types are pre-defined in the code.
Features:
Random landing zones for supply crates delivered by AI pilots
4 supply crate types are pre-defined: Food & Clothing / Supplies / Weapons & Ammo / Random Loot
Customizable crate loot (via editing init.sqf) also has random loot generator
500-meter radius marker for LZ lets players know where to look
Auto repeating mission once crate has been found
Virtually no BE filters - uses mostly vanilla loot (but you might need to add a few)
Latest Release: v1.0c (releases can be downloaded here: https://github.com/tdavison70/Helicopter-Supply-Drop/releases
This release has the following updates:
Added AI units that parachute down with crate and guard it
AI units each have a sub-set of skills - these guys are tough by default
AI might drop krypto
BIS_fnc_findSafePos now called from helicopter spawn position and uses world safe anchor for range
Added JIP (Join In Progress) support to eliminate multiple copies running on server
Replaced all WaitUntil loops with While (sleep) loops to fix major lag
Loitering helicopters should now be fixed (they get deleted)
I tested this PBO on my game server (Vert Hosting), and had it running side-by-side with VEMF / BlckEagl / A3AEI and had no issues. All the AI seem to have a mutual respect for one another :P
A big shout out to all the modders who inspired me to make this. Sorry, in advance, if there are tons of supply drop missions out there. This one is pretty straight-forward, and can be easily edited to your liking. Hope you enjoy!
You can download it here: https://github.com/tdavison70/Helicopter-Supply-Drop
2 - In your 'MPMissions' folder, unpack 'epoch.Altis.pbo'
3 - In your unpacked 'epoch.Altis' folder, open init.sqf and add the following at the very top :
if (isServer) then {
execVM "\q\addons\traderATMs\init.sqf";
};
Note : if there is no init.sqf in the root of your unpacked 'epoch.Altis' folder, just create one.
4 - Repack 'epoch.Altis' into 'epoch.Altis.pbo'
That's it !
**EDIT** Optimized following Kroenen's suggestions
B) WHAT IT DOES:
Earplugs script for Arma 3 Epoch (EPAH safe)
- This script allows you to put in "earplugs".
- Config.sqf will let you configure almost every possible aspect of the script.
- You can now insert and remove the earplugs by pressing a key of your choice.
- Current available keys are : F4, F5, INSERT, NUMPADMULTIPLY, NUMPADDIVIDE
- You can toggle the hotkey in case you use EPAH and wont be ablt to use hotkeys.
- Auto-insert and remove earplugs when getting in and out of vehicles.
- Inserting earplugs reduces volume down to about 25 percent.
- Removing earplugs restores volume to 100 percent.
-Thanks to mgm on epochmod.com for helping with keypress config technique.
Here is a link to the github files.
https://github.com/computermancer/cmEarplugs
B) INSTRUCTIONS:
1. Copy the cmEarplugs folder to your mission folder (altis.Epoch)
2. If you have init.sqf, copy the code in this init.sqf to yours.
2a. If you do not have an init.sqf, copy this one over to your mission folder.
3. Copy onPlayerKilled.sqf and onPlayerRespawn.sqf to your mission folder.
4. Config your personal settings in the config.sqf file in the cmEarplgus folder.
5. Edit your battleye filters.
Edit the following in your battleye filters.
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
scripts.txt (at the end of the line add the following)
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
(BIS_fnc_) First Line: !"bis_fnc_initVehicle" !"BIS_fnc_setVehicleMass_fsm" !"BIS_fnc_arsenal_type"
(displayAddEventHandler ) Line 53 (54 on notepad++) : !"EP_LOOP"
(displayAddEventHandler ) Line 53 (54 on notepad++) !"cmKeyPress"
( exec ) Line 22 (23 on notepad++) : !"clock.sqf"
( removeAllActions ) Line 31 (32 on notepad++) : !"onplayerkilled.sqf"
(displayRemoveEventHandler) Line 59 (60 on notepad++) : !"cmKeyPress"
(removeAllEventHandlers) Line 59 (60 on notepad++) : !"cmKeyPress"
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
PublicVariable.txt (at the end of the line add the following)
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
First Line: !"cmEarplugs_hotkeyDIKCodeNumber"
First Line: !"PLAYER_REJECT_NotReady1"
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
B) WHAT TO KNOW:
If you use Epoch Anti Hack, the script will work except for the keypress option.
EPAH seems to disable keydown eventhandlers.
But auto insert and menu inside vehicle work fine.
If you disable EPAH, you can use the keypress toggle as well.
This is a selfbooting addon inside your mission pbo with easy installation.
It will add a hud and hud builder on your server. Default pressing 8 for hud builder and 9 to toggle on and of.
Future plans
Opacity on images.
More options.
Saving to redis.
Config to allow hud builder or to disable it
Define your own keybinds.
Changelog
V1.2
Fixed a wrongly named variable
Infistar should work now correctly.
Commits
https://github.com/DevZupa/ZHB-A3/commit/070b15162a10c475d2872c564fb73a22a8e377d8
https://github.com/DevZupa/ZHB-A3/commit/abb6e4da1d32d953528fd27f5302fa83388dae16
https://github.com/DevZupa/ZHB-A3/commit/afc50e71910c4ab684b41aea444cff6c981055d6
V1.1
KeyUp Handlers.
Download
https://github.com/DevZupa/ZHB-A3
Feel free to push fixes/addition to the git.
Installation
Battleye Filters in Scripts.txt
Edit the following exceptions to the 7 xxx , only copy the part that starts with ! Search for the tag word and place the rest behind it.
7 displayAddEventHandler !"ZupaKeyUpWorking = (findDisplay 46) displayAddEventHandler ['KeyUp', '_this call ZHB_fnc_handleKey'];"
7 displayRemoveEventHandler !"(findDisplay 46) displayRemoveEventHandler ['KeyUp',ZupaKeyUpWorking];"
7 createDialog !="createDialog \"Z_HUD_Builder\";"
7 playableUnits !",count playableUnits ,_align,_valign"
Edit your filters as stated above.
Place the ZHB folder in your mission pbo.
Place the folowing on the bottom of your description.ext
If you already have a RscTiles or CfgFunctions, place the includes in there ofcourse.
#include "ZHB\ZHudBuilder.hpp"
class RscTitles
{
#include "ZHB\ZHud.hpp"
};
class CfgFunctions {
#include "ZHB\ZHB_Functions.hpp"
};
4. Add the following in your antihack as exception.
Z_HUD_Builder
5001, -3
5. DONE - Change the fn_initVariables to your likings.
You can edit the default hud in the initVariables.sqf
// Starting positions
Z_HUD_pos = [
0,0,0,0,0,0,0,0, // Bottom SIde -> left to right
0,0,3,4,5,6,0,0, // Right Side -> bottom to top
0,0,0,0,0,0,0,0, // Top side -> right to left
0,0,0,0,0,0,0,0 // Left side -> top to bottom
];
Numbers are as following:
// 0 = Nothing/ Blank
// 1 fps
// 2 players
// 3 damage
// 4 crypto
// 5 hunger
// 6 thirst
// 7 grid
// 8 fatique
// 9 Restart
// 10 Toxicity
// 11 Stamina
// 12 Energy
Extra
Restart timer is default disabled to be picked ( change in initVariables.sqf)
icons are 6 kb paa's, CAN U BELIEVE IT? SO SMALL
Screenshot
Since I'm not running an Altis server anymore, I thought I'd share my addons for it. The code just gets inserted in your config.cpp file in the a3_epoch_server_settings.pbo file under "class Altis", under the last entry in that section.
Look for these lines in the config.cpp and make sure you add that last , at the end of the last line, then insert the below pastebin code underneath it.:
{ "Land_CncBarrierMedium4_F", { 18464.2, 14281.7, 0.00330925 }, 62.7671 },
{ "Land_LampShabby_F", { 18451.7, 14285.3, 0 }, 221.564 },
{ "Land_HBarrier_1_F", { 18458.1, 14290.3, 0.0128841 }, 317.438 },
Code: http://pastebin.com/nUrrh4ga
The first one is a small triage area at the hospital on Altis.
The second one is a small military base at the AAC airfield.
- Script 1 runs on server (i run it at the end of the file server_functions.sqf).
- Script 2 runs on client (i run it in init.sqf).
- Script 3 does not need to run, but you need to put it in the correct place in the mission file: \terror_zombies\zombie_agent_terror.fsm.