Skip to content

Instantly share code, notes, and snippets.

@pfirsich
pfirsich / _hybrid.lua
Last active August 23, 2018 21:39
Sketches for high-level library for kaun (chu)
-- resources (kaun)
local paddleMesh = kaun.newMesh("paddle.obj")
local paddleTexture = kaun.newTexture("paddle.png")
local ballMesh = kaun.newSphereMesh(1.0, 12, 12)
local ballTexture = kaun.newTexture("ball.png")
local level = kaun.newMesh("level.obj")
local skyboxMesh = kaun.newBoxMesh(1, 1, 1)
@pfirsich
pfirsich / controlconfigscripts.md
Last active July 16, 2018 10:02
Documentation for Controll Config Scripts in Spectacular Shatter Buddies (http://shatterbuddies.net/)

Control Config Scripts (*.sbcs)

Notes

For syntax highlighting you can usually use JavaScript or C syntax highlighting.

The configs you find in the save directory in control_configs will be overwritten every time you restart the game. If you want to make a custom control script, you need to create a copy with a different name.

Sadly if there is a syntax error in these scripts, the script will be parsed up until that error without notifying you, so that you will have only partially working controls!

General Syntax

@pfirsich
pfirsich / main.lua
Created July 6, 2018 22:15
Trace blobs in images to approximate polygons around them. Done for @MaChue on the löve Discord server. Images are here: https://imgur.com/a/sFQl7ax
local trace = require("trace")
local imageIndex = 1
local image
local outline
local boundingBox
function updateBoundingBox(padding)
-- minX, minY, maxX, maxY
boundingBox = {math.huge, math.huge, 0, 0}
import os
import sys
cmd = 'ffmpeg -r 60 -i "{dirName}/%d.png" -y -c:v libx264 -vf "format=yuv420p" -r 60 "{dirName}.mp4"'
for dirName in os.listdir("."):
if os.path.isdir(dirName) and (len(sys.argv) <= 1 or dirName in sys.argv[1:]):
os.system(cmd.format(dirName=dirName))
@pfirsich
pfirsich / Signal.hpp
Created August 22, 2016 10:23
Signals/Slots
#ifndef __SIGNAL_HPP_INCLUDED__
#define __SIGNAL_HPP_INCLUDED__
#include <cstdio>
#include <vector>
#include <functional>
// eraz on ##c++@freenode helped me with this, by pointing me to std::function!
// Here we use std::function like template syntax, by defining a generic Signal and
@pfirsich
pfirsich / spacewalk.lua
Created November 5, 2015 23:02
Simple example of an entity type description file for Screwdriver (shown in my blog). The beginning for a hypothetical full remake of Spacewalk.
entityTypes["levelGeometry"] = {
label = "Level geometry",
components = {
{
id = "core",
componentType = "Core", -- every entity type has to have a core component
},
{
id = "transforms",
componentType = "Transforms",
@pfirsich
pfirsich / radiopanel.txt
Created September 13, 2015 13:22
Custom radio panels (used in conjunction with my autoexec) for CS:GO. Found in csgo/resource/ui. It's a little messy, since toggle, incrementvar, exec and some other commands are prohibited from being executed from a radio command.
"RadioPanel.txt"
{
//"SFUI_StandardRadio"
//"SFUI_GroupRadio"
//"SFUI_ReportRadio"
"Groups"
{
"standard"
{
@pfirsich
pfirsich / entry_mirage_A_ramp.cfg
Created August 29, 2015 13:17
Helper script/config to make entry fragging practice configs (placing bots in common spots to practice clearing a site). Included example output config for de_mirage A site from ramp.
mp_respawn_on_death_ct 1
bot_stop 1
say Please execute bot_kick before executing this file. 10 bots will be placed
bot_add_ct
bot_add_ct
bot_add_ct
bot_add_ct
bot_add_ct
@pfirsich
pfirsich / practice.cfg
Last active October 22, 2015 22:32
CS:GO practice config
sv_cheats 1
bot_kick
bot_stop 1
mp_autokick 0
mp_freezetime 0
mp_roundtime 60
mp_roundtime_defuse 60
mp_roundtime_hostage 60
mp_limitteams 0
@pfirsich
pfirsich / autoexec.cfg
Last active January 15, 2021 07:53
CS:GO autoexec.cfg
// Launch options: -console -novid -threads 4 -high -nojoy
echo " ___ _ _ ___ _
echo " |_ | | |( ) / _ \ | | "
echo " | | ___ ___ | ||/ ___ / /_\ \ _ _ | |_ ___ ___ __ __ ___ ___ "
echo " | | / _ \ / _ \| | / __| | _ || | | || __| / _ \ / _ \\ \/ / / _ \ / __|"
echo "/\__/ /| (_) || __/| | \__ \ | | | || |_| || |_ | (_) || __/ > < | __/| (__ "
echo "\____/ \___/ \___||_| |___/ \_| |_/ \__,_| \__| \___/ \___|/_/\_\ \___| \___|"
echo ""
echo "Saved in <Steam Library>\SteamApps\common\Counter-Strike Global Offensive\csgo\cfg"