Skip to content

Instantly share code, notes, and snippets.

@nosoop
nosoop / makesig.idc
Created February 5, 2019 23:00
makesig.idc with fixes for IDA 7.0
#include <idc.idc>
/* makesig.idc: IDA script to automatically create and wildcard a function signature.
* Copyright 2014, Asher Baker
*
* This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
*
* Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.

TF2's player damage process

note: documentation is released as-is and reports of any inaccuracies will be ignored

Call tree:

  • CTFPlayer::ModifyDamageInfo
  • CTFPlayer::OnTakeDamage
    • If attacker is carrying RUNE_STRENGTH, scale damage by 2.0f.
    • CTFGameRules::ApplyOnDamageModifyRules
/**
* dhooks_gameconf_shim
* (c) 2023 nosoop
*
* DHooks stores the hook definitions in-extension. Because it's keyed globally, it has the
* side effect of conflicting if multiple game config files use the same name for different
* hook definitions, no matter which plugin is loading them.
*
* This issue is tracked here: https://github.com/alliedmodders/sourcemod/issues/1879
*
#!/usr/bin/python3
# BSD Zero Clause License
#
# Copyright (C) 2023 by nosoop
#
# Permission to use, copy, modify, and/or distribute this software for any purpose with or
# without fee is hereby granted.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS

This patch is a fix for the bug observed in this video.

Requires Source Scramble and its manager plugin.

tf2.fix_ammo_gain_windows.patch.txt goes into addons/sourcemod/configs/sourcescramble and tf2.fix_ammo_gain_windows.txt goes into addons/sourcemod/gamedata.

/**
* Prevents birds from spawning near players in water.
*/
#pragma semicolon 1
#include <sourcemod>
#pragma newdecls required
#define DOVE_SQUARED_TOLERANCE 2500.0 // 50.0 HU^2
@nosoop
nosoop / config.ini
Last active September 2, 2022 07:38
[DEFAULT]
basedir = gamefiles/%(appid)s
info_file = %(basedir)s/%(gamedir)s/steam.inf
[Team Fortress 2]
gamedir = tf
appid = 232250
files = server_srv.so
engine_srv.so
server.dll
@nosoop
nosoop / localization_to_sourcemod.py
Last active February 10, 2022 02:54
A script that imports game translation strings into a SourceMod phrase file.
import vdf, itertools, os
# imports choice game translation strings into a SourceMod-usable format.
valid_languages = {
'brazilian': 'pt', 'bulgarian': 'bg', 'czech': 'cze', 'danish': 'da', 'dutch': 'nl',
'english': 'en', 'finnish': 'fi', 'french': 'fr', 'german': 'de', 'greek': 'el',
'hungarian': 'hu', 'italian': 'it', 'japanese': 'ja', 'korean': 'ko',
'norwegian': 'no', 'polish': 'pl', 'portuguese': 'pt_p', 'romanian': 'ro', 'russian': 'ru',
'schinese': 'chi', 'spanish': 'es', 'swedish': 'sv', 'tchinese': 'zho', 'thai': 'th',
/**
* [TF2] Jungle Inferno Equipment
*/
#pragma semicolon 1
#include <sourcemod>
#include <tf2_stocks>
#include <clientprefs>
#include <sdkhooks>
@nosoop
nosoop / extract_particles.sh
Last active September 6, 2021 02:40
dump effect names from OB games (might have to modify for other versions of the PCF format)
#!/bin/bash
# extract particles from vpk
PACKAGE_FILE=/path/to/tf2_misc_dir.vpk
mkdir particles
vpk x ${PACKAGE_FILE} `vpk l ${PACKAGE_FILE} | grep '\.pcf'`