OFPEC Forum
Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: hamis on 29 Oct 2008, 18:28:00
-
Well,is there a way to make this to work also then resuming mission:config.cpp
class CfgPatches {
class GDTModHDR {
units[] = {};
weapons[] = {};
requiredVersion = 0.14;
requiredAddons[] = {"Extended_EventHandlers"};
};
};
class Extended_Init_EventHandlers
{
class Man
{
GDTModHDR_Init_Man="_this execVM ""\GDTModHDR\GDTModHDR.sqf"";";
};
};GDTModHDR.sqf:sleep 1;
if (not (isnil ("GDTModHDRValue"))) ExitWith {};
GDTModHDRValue = -1;
Private["_keyspressed"];
setAperture GDTModHDRValue;
GDTModHDRKeypressed = compile preprocessFile "\GDTModHDR\GDTModHDRKey.sqf";
(findDisplay 46) displaySetEventHandler ["KeyDown","_this call GDTModHDRKeypressed"];
GDTModHDRKey.sqf:if ((_this select 1) == 210) then
{
GDTModApertureValue = -1;
setAperture GDTModApertureValue;
hint "HDR ON";
};
if ((_this select 1) == 199) then
{
GDTModApertureValue = 50;
setAperture GDTModApertureValue;
hint "Day";
};
if ((_this select 1) == 207) then
{
GDTModApertureValue = 0.5;
setAperture GDTModApertureValue;
hint "Night";
};
if ((_this select 1) == 211) then
{
GDTModApertureValue = 4;
setAperture GDTModApertureValue;
hint "NVG";
};
if ((_this select 1) == 209) then
{
if (GDTModApertureValue <= 99.5) then
{
if (GDTModApertureValue < 0.5) then {GDTModApertureValue = 0;};
GDTModApertureValue = GDTModApertureValue + 0.5;
setAperture GDTModApertureValue;
};
};
if ((_this select 1) == 201) then
{
if (GDTModApertureValue > 0.5) then
{
GDTModApertureValue = GDTModApertureValue - 0.5;
setAperture GDTModApertureValue;
};
};
-
I sorry but don't really understand what you are asking. I moved your post from where it was originally though, since it was clearly very off-topic.
I'll make some comments though:
* Read about why you shouldn't use preprocessFile (http://www.ofpec.com/forum/index.php?topic=32468.0) ever again ;P
* You should consider using XEH 1.9 preinit handler. Saves messing around so much (OK, not complex, but saves running a script 1000 times a mission).
* You should definitely use either SPON Core (http://www.ofpec.com/forum/index.php?topic=30274.0) key event handlers or Shole DEH (http://www.ofpec.com/forum/index.php?topic=31384.0) Display event handlers rather than taking control of the key handler yourself (both are compatible with each other and better in different ways, so choose the one that suits you). Most scripts that use keys use one or the other of these to ensure compatibility and many people won't use an addon that is incompatible.
* Consider using a switch rather than lots of ifs to make things clearer.
-
Well,this is GDTModHDR which disables terrible hdr lighting.It works only when you don't live the mission,if you quit and resume later it doesn't work.I want to know if it's possible to make it load everytime you load mission/savegame.I don't understand scripting much,so please answer very clearly.It can't be impossible,think about ECS which works all the time,whatever you do.