Skip to content

Instantly share code, notes, and snippets.

@BaerMitUmlaut
BaerMitUmlaut / initPlayerLocal.sqf
Created March 14, 2023 22:00
Global Mobilization T-55 IR Searchlight
addUserActionEventHandler ["headlights", "Activate", {
private _vehicle = vehicle ACE_player;
if !(_vehicle isKindOf "gm_t55_base" && { ACE_player == gunner _vehicle }) exitWith {};
private _light = _vehicle getVariable ["bb_irlight", objNull];
if (!isNull _light) then {
_vehicle animate ["mainturret_searchlight_cover_unhide", 1, true];
deleteVehicle _light;
} else {
_vehicle animate ["mainturret_searchlight_cover_unhide", 0, true];
@BaerMitUmlaut
BaerMitUmlaut / MapOverlay.sqf
Created April 5, 2020 15:06
Overlays a picture over the whole map with the map still being usable
mission_fnc_mapOverlayCache = [] call CBA_fnc_createNamespace;
mission_fnc_mapOverlay = {
params ["_map"];
_map drawIcon [
getMissionPath "map.paa",
[1, 1, 1, 1],
[worldSize / 2, worldSize / 2, 0],
640 / ctrlMapScale _map,
640 / ctrlMapScale _map,
@BaerMitUmlaut
BaerMitUmlaut / ZeroGravity.sqf
Created May 24, 2019 08:30
Zero Gravity in Arma
private _vehicle = "B_MBT_01_cannon_F" createVehicle [0, 0, 0];
_vehicle setPosASL ((getPosASL player) vectorAdd [0, 10, 3]);
[{
params ["_args"];
_args params ["_vehicle", "_lastRun"];
private _delta = cba_missionTime - _lastRun;
private _force = [0, 0, getMass _vehicle * _delta * 9.8];
_vehicle addForce [_force, getCenterOfMass _vehicle];
@BaerMitUmlaut
BaerMitUmlaut / footprints.sqf
Created May 1, 2019 19:07
Permanent footprints
blue_footprints = [];
[{
private _footprints = player nearObjects ["#mark", 2];
{
private _p3d = (getModelInfo _x) select 1;
private _dir = direction _x;
private _pos = getPosASL _x;
_pos set [2, 0];
gm_fc_BU
gm_fc_BU_bgs
gm_fc_BU_civ
gm_fc_CS
gm_fc_CS_bgs
gm_fc_CS_civ
gm_fc_GC
gm_fc_GC_bgs
gm_fc_GC_civ
gm_fc_HU
@BaerMitUmlaut
BaerMitUmlaut / SocketExample.kt
Created December 6, 2018 12:33
Simple client server communication with object streams in Kotlin.
import java.io.ObjectInputStream
import java.io.ObjectOutputStream
import java.io.Serializable
import java.net.ServerSocket
import java.net.Socket
import java.util.*
data class Question(val question: String, val answers: List<String>): Serializable
fun main(args: Array<String>) {
numberMapping = [];
// 0 - 9 -> 0 - 9
for "_i" from 0 to 9 do {
numberMapping pushBack str _i;
};
// 10 - 24 -> 33 - 47
for "_i" from 33 to 47 do {
numberMapping pushBack (toString [_i]);
};
// 24 - 92 -> 58 - 126
@BaerMitUmlaut
BaerMitUmlaut / ropeRenderer.sqf
Created November 1, 2018 20:39
Render 3D objects with ropes
private _lineCache = createLocation ["NameVillage", [-1000, -1000, 0], 0, 0];
private _fn_renderVertex = {
private _vertex = "ace_fastroping_helper" createVehicle [0, 0, 0];
_vertex hideObject true;
_vertex setPosWorld _this;
_vertex
};
@BaerMitUmlaut
BaerMitUmlaut / fps.sqf
Created October 14, 2018 21:38
In game live FPS graph with ropes
player setPos [15, 15, 0];
meme_history = [];
meme_indicators = [];
meme_ropes = [];
comment "x axis";
for "_i" from 0 to 9 do {
private _b = "Sign_Sphere100cm_F" createVehicle [0, 0, 0];
_b setPosATL [10, 10 + _i * 2, 0];
# Username and e-mail for commits
git config --global user.name "<username>"
git config --global user.email <username>@users.noreply.github.com
# Preferred text editor for small stuff like commit messages, default is vim
# I'd recommend nano since it's easier to use but also runs in the terminal
git config --global core.editor <command>
# Always push current branch, create on remote if not existing yet
git config --global push.default current