Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python3
import re
import os
import fnmatch
def parse(filePath):
fileHandleInput = open(filePath, "r")
firstLine = fileHandleInput.readline().strip()
if firstLine == "/*":
//PROOF OF CONCEPT
//Just put this in the initPlayerLocal.sqf, for MP you probably need to do some changes.
//Needs to be in scheduled environment - feel free to convert it to unscheduled.
_safeZones = [];
_dangerZones = [];
fncLightning = {
_pos = _this;
private ["_bolt", "_light", "_class", "_lightning", "_time"];
fn_suicideBomber = {
params ["_unit"];
private ["_expl1", "_expl2", "_expl3"];
_unit addItem "ACE_DeadManSwitch";
// - Code from KK ---------------------------------------------------------
_expl1 = "DemoCharge_Remote_Ammo" createVehicle (position player);
_expl1 attachTo [_unit, [-0.1,0.1,0.15],"Pelvis"];
_expl1 setVectorDirAndUp [[0.5,0.5,0],[-0.5,0.5,0]];
@BaerMitUmlaut
BaerMitUmlaut / fn_findLoadableWeapon.sqf
Last active August 17, 2016 18:02
findLoadableWeapon draft
#include "..\script_component.hpp"
params ["_unit", "_magazine", ["_weapons", []], ["_magazines", []]];
if (_weapons isEqualTo []) then {
_weapons = [primaryWeapon _unit, handgunWeapon _unit, secondaryWeapon _unit];
_magazines = [primaryWeaponMagazine _unit, handgunMagazine _unit, secondaryWeaponMagazine _unit];
};
private _weapon = _weapons deleteAt 0;
private _loadedMagazines = _magazines deleteAt 0;
@BaerMitUmlaut
BaerMitUmlaut / fnc_onEdenDisplayLoad.sqf
Created October 19, 2016 21:27
Soil icon drawing test
/*
* Author: BaerMitUmlaut
* Adds 2D and 3D UI drawing.
*
* Arguments:
* 0: Eden Display <DISPLAY>
*
* Return Value:
* None
*/
# 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
@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];
@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
};
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 / 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>) {