How to make/Edit scripts/Put them into menus
So lately there's been a lot of people asking how to make scripts, Edit them, And put them into menus, So I decided I'd make a thread to help people. :D
Here's a list of scripting commands from Bohemia Interactive,
https://community.bistudio.com/wiki/C...Commands_ArmA2
So, What do you do with this?
Well, You can either make your own scripts which you might have to research how to do, Or you can edit your own. Here's how to edit.
Take this script, or any other you may have, and find below the editable part which will show to people, Shown below in red text.
Code:
if (isNil "atext") then
{
atext = 0;
};
if (atext == 0) then
{
atext = 1;
hint "3D Text ON";
_3d = "[] spawn
{
disableSerialization;
if (isNil ""BIS_fnc_3dCredits_n"") then {BIS_fnc_3dCredits_n = 2733;};
BIS_fnc_3dCredits_n cutRsc [""rscDynamicText"", ""PLAIN""];
BIS_fnc_3dCredits_n = BIS_fnc_3dCredits_n + 1;
_ctrl = ((uiNamespace getvariable ""BIS_dynamicText"") displayctrl 9999);
_ctrl ctrlShow true; _ctrl ctrlEnable true; _ctrl ctrlSetFade 0;
tdtext = true;
while {tdtext} do
{
if !(tdtext) exitWith {};
_pos = [(getPosATL player) select 0, (getPosATL player) select 1, ((getPosATL player) select 2) + 2];
_pos2D = worldToScreen _pos;
if (count _pos2D > 0) then
{
_ctrl ctrlSetPosition [(_pos2D select 0) - (safezoneW / 2), (_pos2D select 1), safezoneW, safezoneH];
_text = parseText ""<t size='0.8' color='#FF00FF'>MPGH EXAMPLE<3</t>"";
_ctrl ctrlSetStructuredText _text;
_ctrl ctrlCommit 0;
};
};
_ctrl ctrlShow false;
_ctrl ctrlEnable false;
};";
[_3d] execVM "scr\exec.sqf";
}
else
{
atext = 0;
hint "3D Text OFF";
_3d = "tdtext = false; tdtext = nil";
[_3d] execVM "scr\exec.sqf";
};
Once you have found the red part, You can change it to whatever you want. Multiple lines, etc/Different colored text, By editing the HTML color code which is shown in the #'s or Hashtags. You can find a link to all the color codes for HTML here.
HTML color codes
And of course there are a lot more websites out there where you can find better more specific colors to edit the text inside menus/scripts etc.
Next we will move onto menus and how to edit them.
Below will be an example of one. What you want to do with this, basically is find, which part of the menu you want to edit.
An example will be shown in red. Now theres 2 things you can do with this, Copy paste another line into the script, and change what the name of your custom script is, or, you can create another sub line, for the menu and make it more custom to what you want.
Of course you have to take into account which menu you're editing and how they work.
For this one, The red part shown below is what you can basically copy/paste/edit to what you want it to say. :)
Code:
/*
SniperOfGod Alternative Menu
Using the ********* DayZ Hack
*/
// DayZ Hack Directory
HMDIR = "C:\Users\Jake\Desktop\";
// Menu Scripts directory
HDIR = "dodger\Menu_Scripts\";
MENUTITLE = "Alternative AJ-Menu + Custom Scripts";
// Don't touch this!
option = []; img = [];
// Format: hack name, path, togglable, color (should be 0), var (should be 0)
img = img + [""]; option = option + ["HEAL","heal.sqf","1","0","0"];
img = img + [""]; option = option + ["HEAL others 15m","andere.sqf","1","0","0"];
img = img + [""]; option = option + ["KeyMenu","KeyMenu.sqf","1","0","0"];
img = img + [""]; option = option + ["-------- Zombie Scripts --------","empty.sqf","0","0","0"];
img = img + [""]; option = option + ["Zombie Proof","zombieproof.sqf","1","0","0"];
img = img + [""]; option = option + ["Zombie Shield","zombieshield.sqf","1","0","0"];
img = img + [""]; option = option + ["-------- Vehicle Scripts --------","empty.sqf","0","0","0"];
img = img + [""]; option = option + ["Helicopter spawn","vehicle_Spawn.sqf","1","0","0"];
img = img + [""]; option = option + ["Car God","CarGodMode.sqf","1","0","0"];
img = img + [""]; option = option + ["Vehicle Speed","VehicleSpeed.sqf","1","0","0"];
img = img + [""]; option = option + ["Repair","Repair.sqf","1","0","0"];
img = img + [""]; option = option + ["Flip Vehicle","flipvehicle.sqf","1","0","0"];
img = img + [""]; option = option + ["-------- Teleport Scripts --------","empty.sqf","0","0","0"];
img = img + [""]; option = option + ["Teleport to Player","MeToPlayer.sqf","1","0","0"];
img = img + [""]; option = option + ["Teleport All","TeleAll.sqf","1","0","0"];
img = img + [""]; option = option + ["Teleport to Vehicle","SpawnToVehicle.sqf","1","0","0"];
img = img + [""]; option = option + ["Teleport to Me","TeleportToMe.sqf","1","0","0"];
img = img + [""]; option = option + ["Vehicle Delivery","VehicleDelivery.sqf","1","0","0"];
img = img + [""]; option = option + ["-------- Game Kits --------","empty.sqf","0","0","0"];
img = img + [""]; option = option + ["M4 Kit","AssaultLoadout.sqf","1","0","0"];
img = img + [""]; option = option + ["Shit Kit","MainLoadout.sqf","1","0","0"];
img = img + [""]; option = option + ["Sniper Kit","SniperLoadout.sqf","1","0","0"];
img = img + [""]; option = option + ["-------- Fun Scripts --------","empty.sqf","0","0","0"];
img = img + [""]; option = option + ["Rains Kill","RainKill.sqf","1","0","0"];
img = img + [""]; option = option + ["AllTheirVehiclesRBelongToUs","GlueAllVehiclesToMe.sqf","1","0","0"];
img = img + [""]; option = option + ["Summon A Fuckton Of Crows","caw.sqf","1","0","0"];
img = img + [""]; option = option + ["Antihacks","Antihacks.sqf","1","0","0"];
img = img + [""]; option = option + ["Antihacks Invis","Antihacks2.sqf","1","0","0"];
img = img + [""]; option = option + ["3D Text","3Dtext.sqf","1","0","0"];
img = img + [""]; option = option + ["Spawn 100 Planes","100Planes.sqf","1","0","0"];
img = img + [""]; option = option + ["Explosions!","HEBullets.sqf","1","0","0"];
img = img + [""]; option = option + ["Dance1","Dance1.sqf","1","0","0"];
img = img + [""]; option = option + ["Dance2","Dance2.sqf","1","0","0"];
img = img + [""]; option = option + ["Dance3","dance3.sqf","1","0","0"];
img = img + [""]; option = option + ["Glue","gluetarget.sqf","1","0","0"];
img = img + [""]; option = option + ["Debug","showdebug.sqf","1","0","0"];
img = img + [""]; option = option + ["Admin Fucker","AdminFucker.sqf","1","0","0"];
img = img + [""]; option = option + ["Stats","Stats.sqf","1","0","0"];
img = img + [""]; option = option + ["Weather Lord","WeatherLord.sqf","1","0","0"];
img = img + [""]; option = option + ["Box","diebox.sqf","1","0","0"];
img = img + [""]; option = option + ["NamalskBox","Namalskbox.sqf","1","0","0"];
img = img + [""]; option = option + ["Remote Box","giveboxremote.sqf","1","0","0"];
img = img + [""]; option = option + ["3 Bandits Spawn","3bandits.sqf","1","0","0"];
img = img + [""]; option = option + ["Namalsk Stuff","namalsk.sqf","1","0","0"];
img = img + [""]; option = option + ["Morph","New1.sqf","1","0","0"];
img = img + [""]; option = option + ["Rainbow Smoke","sillyflares.sqf","1","0","0"];
img = img + [""]; option = option + ["Light","lich.sqf","1","0","0"];
img = img + [""]; option = option + ["Firework","fireworks.sqf","1","0","0"];
img = img + [""]; option = option + ["Remove Grass","nograss.sqf","1","0","0"];
img = img + [""]; option = option + ["Thunderdome","thunderdome.sqf","1","0","0"];
img = img + [""]; option = option + ["Spectate Player (Select)","playerspectate.sqf","1","0","0"];
img = img + [""]; option = option + ["create Player","createplayer.sqf","1","0","0"];
img = img + [""]; option = option + ["Fly","safeflying.sqf","1","0","0"];
img = img + [""]; option = option + ["Minigun and Artillery","gun.sqf","1","0","0"];
img = img + [""]; option = option + ["Kitty cannon","canon.sqf","1","0","0"];
img = img + [""]; option = option + ["Game Settings","envi.sqf","1","0","0"];
img = img + [""]; option = option + ["-------- Player Scripts --------","empty.sqf","0","0","0"];
img = img + [""]; option = option + ["God Mode","GodMode.sqf","1","0","0"];
img = img + [""]; option = option + ["Infinite Ammo","InfiniteAmmo.sqf","1","0","0"];
img = img + [""]; option = option + ["No Recoil","recoil.sqf","1","0","0"];
img = img + [""]; option = option + ["Invisible","Invisible.sqf","1","0","0"];
img = img + [""]; option = option + ["PlayerShield","playershield.sqf","1","0","0"];
img = img + [""]; option = option + ["-------- ESP+Wallhacks --------","empty.sqf","0","0","0"];
img = img + [""]; option = option + ["2D Map + Teleport Alpmaker","alpm_new","1","0","0"];
img = img + [""]; option = option + ["2D Map Alaska","alaskamap.sqf","1","0","0"];
img = img + [""]; option = option + ["2D Map SniperOfGod ","map.sqf","1","0","0"];
img = img + [""]; option = option + ["Full2D Radar","Full2dRadar.sqf","1","0","0"];
img = img + [""]; option = option + ["Spawn Weapons (Any) ","menu\weapondialog.sqf","0","0","0"];
img = img + [""]; option = option + ["Item Spawn","menu\itemdialog.sqf","0","0","0"];
execVM format['%1menu\menu_generate.sqf',HDIR];
// End file
Take into account when editing a menu, or script, sometimes it is NECESSARY to make a backup of the script file.
Here's a guide on how to create a script, to have inside whatever you desire. :)
Step 1: Open Notepad
Step 2: Type in the code/copy it in
Step 3: Click on the file button at the top left.
Step 4: Click save
Step 5: A prompt box will come up asking, what you want to save it as.
Step 6: If you're saving it as an .sqf file which I imagine is what you want, Click the save as type box, Choose all files
Step 7: Enter the name of what you want the script to be, Example Heal.sqf - Remember don't forget the .sqf part, It's what makes the file a script and not just another .txt document
Step 8: Save, and choose where you want to put it, Example - Your desktop or a folder.
You're now done and can import that script into a menu.
Here's how to import that script into a menu.
Step 1: Take the script file, Move it into your Arma2OA directory, into whichever folder contains your scripts, usually you'll know this off the top of your head.
Step 2: Open up the script shown above that is your menu, It can be different for whatever menu you're using but most of the time in the name it contains something along the lines of ----Menu.sqf
Step 3: Now, Find the lines where it shows scripts, and copy/paste one of them.
Step 4: You can now edit the line to say the name of your script, Where the menu will execute it from, and name it whatever you want which is what it will show up as in the menu.
Step 5: Save the new file to whatever you edited it as, but again, I recommend keeping backups just in-case you mess up.
Step 6: Profit and enjoy editing your menu as custom as you want it :)
Hope this guide helps some people and stops some of the threads on this forum asking for scripting help/how to's on how you create scripts.
The questions have been answered a lot and I felt someone needed to make a help thread about how to's.
Hopefully I didn't mess up on anything here and if anyone has anything to add it would be appreciated..!
And of course, No thread can be complete without bobo.