Skip to content

Instantly share code, notes, and snippets.

View caligari87's full-sized avatar

Sterling Parker caligari87

View GitHub Profile
@caligari87
caligari87 / moveplayer.zsc
Created January 28, 2018 19:58
Rewrite of MovePlayer to account for input normalization while keeping original formulas
extend class TQPlayer {
override void MovePlayer() {
let player = self.player;
UserCmd cmd = player.cmd;
Angle += cmd.yaw * (360./65536.); //Why the hell is angle setting handled here while pitch is elsewhere?
player.onground = (pos.z <= floorz) || bOnMobj || bMBFBouncer || (player.cheats & CF_NOCLIP2);
Vector2 moveVec = NormalizedInput();
moveVec = MovementFactors(moveVec.y, moveVec.x);
vel.xy += rotateVector(moveVec, angle - 90);
@caligari87
caligari87 / zscript.zsc
Created June 24, 2018 00:46
HDScav event handler causing crash
class HDScav_Bootstrap : EventHandler {
//initialize additional player inventory
override void PlayerEntered(PlayerEvent e) {
PlayerInfo player = players[e.PlayerNumber];
if(!player.mo.countinv("AlreadyInitialized")) {
player.mo.giveinventory("HDScav_HungerTracker", 1);
player.mo.giveinventory("HDScav_MessKit", 1);
player.mo.giveinventory("HDScav_Ration", 3);
player.mo.giveinventory("AlreadyInitialized", 1);
}
@caligari87
caligari87 / hd-launcher.sh
Last active January 6, 2020 04:19
Launcher script for Hideous Destructor
#!/bin/bash
showhelp () {
echo "Usage: hd-launcher [OPTION]... [FILE]..."
echo "Launches GZDoom + Hideous Destructor, optionally with"
echo "additional mods or unstable test builds."
echo
echo "Note that all script options MUST be specified first."
echo "Anything not recognized by this script will be passed"
echo "through to GZDoom verbatim."
@caligari87
caligari87 / DampedSpring.zsc
Last active September 4, 2018 13:18
simple damped spring function in ZScript
double DampedSpring(double p, double r, double v, double k, double d) {
//p == current position
//r == rest position
//v == current velocity
//k == spring coefficient
//d == damping coefficient
//simple damped spring formula
return -(d * v) - (k * (p - r));
}
@caligari87
caligari87 / hail-rachael.md
Last active June 27, 2019 03:28
Some joke "prayers" to the ZDoom devs/staff, for fun

Ave Rachael (Hail Rachael)

by me (Caligari87)

Hail Rachael, full of grace,
Randi is with thee.
Blessed art thou amongst Doomers,
and blessed is the fruit of thy labors, QZDoom.
Holy Rachael, Admin of ZDoom,
pray for us trolls,
now and at the hour of our bans. Amen.

@caligari87
caligari87 / zscript.yaml
Last active September 11, 2018 15:41
ZScript syntax hilighting for the Micro text editor
filetype: zscript
# Loosely based on the csharp.yaml definition
# (?i) on everything because ZScript isn't case sensitive
detect:
filename: "(?i)\\.z(c|sc)$"
rules:
# ZScript only has one preprocessor directive and a required engine version declaration
@caligari87
caligari87 / zscript.zsc
Last active October 7, 2018 17:32
An example mutator for Ugly as Sin
// This class hooks into a player's UaS_Looting_Handler to add loot to an existing loot-list.
// NOTE: New loot lists for new/unsported actors are not possible at this time.
// WARNING: A mutator like this must be loaded AFTER Ugly as Sin or a crash will occur!
// Instructions:
// As this is only an example, it will not run automatically.
// (that part is left as an exercise for the modder)
// Once both UaS and this mutator are loaded, open the ingame console and type
// give UaS_Example_Loot_Extender
@caligari87
caligari87 / modlist.md
Last active May 24, 2021 19:43
List of the mods I commonly use with Hideous Destructor

List of the mods I commonly use with Hideous Destructor. Crossed-out mods are ones I don't use much anymore but might appear from time to time. Using some of these may require knowledge of GZDoom modding and/or packing pk3/wad files.

Gameplay

Visuals

@caligari87
caligari87 / NOT.md
Last active January 18, 2019 14:36
NOT (This OR That)

In the landscape of programming languages, Quick Basic resides upon a mountain, surrounded by mists, and insulated from the world beyond.

At a far extreme, on the other end of the world, should you travel that far, you will find the most intelectually eloquent language ever invented, LISP. In the realm of LISP, from the Basic programmers perspective, things look strange and soft. Symbols are tangled and twisted, and yet somehow slowly unfold under the light of reason. From the high refuge of Quick Basic, LISP doesn't even look like programming. Only the long journey down the mountain and across the wilds of deformed and crippled scripting languages can shape your eyes to see the beauty of a LISP proccessor as it slowly meditates upon itself, always looking inward upon its own mathematical truth. But that is a far way off.

Within view, upon a craggy spire of hard rock, many have seen C. Encrusted upon brittle rock, it is etched by the flow of magma, continually belching sulphur and cracking into new formatio

@caligari87
caligari87 / github.md
Created February 8, 2019 14:46
No idea what I'm doing with this

Hello GitHub my old friend I've come to push to you again Because an idea softly creeping Left it's seeds while I was sleeping And the function that was planted in my brain still remains within the lines of conflicts