In this in depth tutorial I’ll tell you how to load your scripts in MP. This should work for arma2 and arma2OAFor this you’ll need hex editor that can be attached to a process or any version of cheat engine. It doesn’t matter whether it’s detected or not since we are going to make changes in arma2 process before joining MP servers.
1. Create a folder, name it MyScripts and put it in arma2 directory (in the same place where arma2.eze is)
2. Inside folder MyScripts create a file and call it go.sqf (This will be our init file)
3. Place code in it and save.
keyhandler =
{
private["_handled","_ctrl", "_dikCode", "_shift", "_ctrlKey", "_alt"];
_ctrl = _this select 0;
_dikCode = _this select 1;
_shift = _this select 2;
_ctrlKey = _this select 3;
_alt = _this select 4;
_handled = false;
//hint format ["%1",_this];
if (!_shift && _ctrlKey && !_alt && (_dikCode == 219)) then {
_ctrl = nil;
_handled = true;
nil = execVM "\MyScripts\execMe.sqf";
};
_handled;
};
Missionstrr =(findDisplay 46) displayAddEventHandler ["keyDown", "_this call keyhandler"];
4.Create file execMe.sqf and place it inside MyScripts folder (you can put any script commands, for testing put hint “it works!” for example)
5.Run the game, attach hex editor or cheat engine to arma2 process and search for text and overwrite part where path (example \ca\ui\scripts\dedicatedServerInterface.sqf") in a way so it would point to your init script ("\MyScripts\go.sqf"), if your path is shorter then original one, press space to make bytes amount equal. Example: before private ["_dummy"]; _dummy = [_this,"onload"] execVM "\ca\ui\scripts\dedicatedServerInterface.sqf"; after private ["_dummy"]; _dummy = [_this,"onload"] execVM "\MyScripts\go.sqf"; >> press space to make bytes amount equal. (you should search one string, below is a list with strings, any of them should fit):
private ["_dummy"]; _dummy = [_this,"onload"] execVM "\ca\ui\scripts\dedicatedServerInterface.sqf";
if (isNil('IGUI_GEAR_activeFilter')) then { IGUI_GEAR_activeFilter = 0;}; private ['_dummy']; _dummy = [_this,'onLoad'] execVM '\ca\ui\scripts\handleGear.sqf'; _dummy; //after changing this string press server control to activate your init
["_dummy"]; _dummy = [_this,"login"] execVM "\ca\ui\scripts\dedicatedServerInterface.sqf"; //after changing this string press login button in server control to activate your init
["_dummy"]; _dummy = [_this,"vote_kick"] execVM "dedicatedServerInterface.sqf"; //after changing this string press vote kick button in server control to activate your init
["_dummy"]; _dummy = [_this,"vote_admin"] execVM "\ca\ui\scripts\dedicatedServerInterface.sqf"; //after changing this string press vote admin button in server control to activate your init
["_dummy"]; _dummy = [_this,"vote_mission"] execVM "\ca\ui\scripts\dedicatedServerInterface.sqf"; //after changing this string press vote mission button in server control to activate your init
["_dummy"]; _dummy = [_this,"vote_missions"] execVM "\ca\ui\scripts\dedicatedServerInterface.sqf"; //after changing this string press vote missions button in server control to activate your init
["_dummy"]; _dummy = [_this,"vote_reassign"] execVM "\ca\ui\scripts\dedicatedServerInterface.sqf"; //after changing this string press vote reassign button in server control to activate your init
["_dummy"]; _dummy = [_this,"vote_restart"] execVM "\ca\ui\scripts\dedicatedServerInterface.sqf"; //after changing this string press vote restart button in server control to activate your initMore strings will be added soon when I'll install the game again.
for Iron front- replace the "\ca\ui" part with "Lib\lib_gui" when searching for the dedicatedServerInterface strings
- for the handleGear thing search for "_dummy = [_this,'onLoad'] execVM 'Lib\lib_gui\LIB_GearDialog\handleGear.sqf';" (the part before it is different you so cant search for "if (isNil('IGUI_GEAR_activeFilter'))" etc.)6. Now you need to hex edit path so when you press certain button it would exec your init file (go.sqf in our case). Find with a help of CE(cheat engine) any of strings above and change "\ca\ui\scripts\dedicatedServerInterface.sqf to "\MyScripts\go.sqf”;
As an example lets search for if (isNil('IGUI_GEAR_activeFilter')) then { IGUI_GEAR_activeFilter = 0;}; private ['_dummy']; _dummy = [_this,'onLoad'] execVM '\ca\ui\scripts\handleGear.sqf'; _dummy; and replace \ca\ui\scripts\handleGear.sqf with \MyScripts\go.sqf so now we’ll have (isNil('IGUI_GEAR_activeFilter')) then { IGUI_GEAR_activeFilter = 0;}; private ['_dummy']; _dummy = [_this,'onLoad'] execVM "\MyScripts\go.sqf"; _dummy; After you made this changes close cheat engine or hex editor (depends on what you were using). Join to any server and when your character will be able to move press G button to activate your init file (go.sqf in this example). In our init we had a script that activates key combination which execs script commands placed in file execMe.sqf when you press ctrl+left win. You can put any code in this file to test it in MP. In folder MyScripts you can create unlimited amount of sqf or sqs scripts and exec them via key combinations or with a help of bugfast like menu.
If you want to make a bugfast like list of options then you need to put this code in go.sqf (you can put it in execME.sqf as well, it doesn’t matter where it will be)
_veh = vehicle player;
_veh addaction ["run", "\ MyScripts \script1.sqs"];
_veh addaction ["run1 ", "\ MyScripts \ script2.sqs"];
_veh addaction ["run2”, "\ MyScripts \ script3.sqs"];
_veh addaction ["run3 ", "\ MyScripts \ script4.sqs"];
_veh addaction ["run4 ", "\ MyScripts \ script5.sqs"];
_veh addaction ["run5", "\ MyScripts \ script6.sqs"];If you want to make options in list which will be colorful then add strings in this format
_veh addaction ["<t color=""#800000"">" +"optionNamehere", "\MyScripts\script.sqs"];
You can use scroll list and key combinations at the same time, to add new key combination you'll need to edit script in your init like this:
keyhandler =
{
private["_handled","_ctrl", "_dikCode", "_shift", "_ctrlKey", "_alt"];
_ctrl = _this select 0;
_dikCode = _this select 1;
_shift = _this select 2;
_ctrlKey = _this select 3;
_alt = _this select 4;
_handled = false;
//hint format ["%1",_this];
if (!_shift && _ctrlKey && !_alt && (_dikCode == 219)) then {
_ctrl = nil;
_handled = true;
nil = execVM "\MyScripts\execMe.sqf";
};
if (_dikCode == 83) then { // press del button to activate
_ctrl = nil;
_handled = true;
};
_handled;
};
Missionstrr =(findDisplay 46) displayAddEventHandler ["keyDown", "_this call keyhandler"];
Warning! after you have made changes with detected version of cheat engine or hex editor don't forget to save changes and close it after everything is done or battle eye will pwn you. Even if you have detected Cheat Engine version opened but it's not attached to arma2 process battle eye will still pwn you so always close it after you made all required changes P.S pm me if you'll find errors in this tutorial since I was writing it pretty fast due to lack of time