Skip to content

Instantly share code, notes, and snippets.

View FreeSlave's full-sized avatar

Roman Chistokhodov FreeSlave

View GitHub Profile
@FreeSlave
FreeSlave / inithud.md
Last active July 17, 2024 12:26
ResetHUD and InitHUD
ResetHUD is sent InitHUD is sent
Loading a new map / Restarting a map Yes Yes
On the level transition No No
When loading the save Yes Yes
On 'fullupdate' command Yes No
@FreeSlave
FreeSlave / sc_limits.md
Last active December 30, 2023 02:36
Sven Co-op lacking features and limitations

These notes were written in the process of porting the Field Intensity campaign to Sven Co-op. The list describes issues I encountered while I was working on the port as well as some other thoughts on improving the game.

  • There's no way to make func_train respect its origin instead of the geometrical center when moving on pack_tracks (I had to manually move the path_tracks to align with the center of the brush model). Look up Origin on paths spawnflag in SoHL.
  • It would be extremely useful to have something like "Fire at the animation start" on scripted_sequences (e.g. scientist playing the retina animation and triggering the retina sequence at the start of the animation).
  • There should be a way to configure whether a button can be pressed through walls or not.
  • It's impossible to configure whether sniper shots ignore the player's armor or not. Should make it a skill cvar or regular cvar.
  • It seems like there's no way to implement a master entity in AngelScript. I tried to make one with `FCAR_MASTER
@FreeSlave
FreeSlave / findspawnflags.d
Created December 17, 2022 05:24
Find 2048 spawnflag in .map file
import std.regex;
import std.stdio;
import std.file;
import std.conv;
void main(string[] args)
{
auto paramRegex = regex(`"(\w+)"\s+"(\w+)"`);
for (ulong i=1; i<args.length; ++i)
@FreeSlave
FreeSlave / trigger_random.cpp
Created December 2, 2022 12:51
trigger_random (Sven Co-op like)
#define TRIGGER_RANDOM_MAX_COUNT 16
#define SF_TRIGGER_RANDOM_START_ON 1
#define SF_TRIGGER_RANDOM_ONCE 2
#define SF_TRIGGER_RANDOM_REUSABLE 4
#define SF_TRIGGER_RANDOM_TIMED 8
#define SF_TRIGGER_RANDOM_UNIQUE 16
#define SF_TRIGGER_RANDOM_DONT_REPEAT 32
class CTriggerRandom : public CPointEntity

Prerequisites

Install and run Visual Studio Installer. The installer allows you to choose specific components. Select Desktop development with C++. You can untick everything you don't need in Installation details, but you must keep MSVC and C++ CMake tools for Windows ticked.

Building

Run Developer command prompt for VS via Windows Start menu. Inside the prompt navigate to the hlsdk directory, using cd command, e.g.

cd C:\Users\username\projects\hlsdk-xash3d
#!/bin/sh
# Generate icons for twitch rewards using imagemagick's or graphicsmagick's convert.
# Quantify the image file if it does not fit in 25kb limits.
if [ -z "$1" ]
then
echo "Usage: $0 path-to-image-file"
exit 1
fi
// cl /EHsc Ole32.lib Shell32.lib Shlwapi.lib eraseitem.cpp
#include <iostream>
#include <windows.h>
#include <Ole2.h>
#include <shlobj.h>
#include <shlwapi.h>
#include <string>
int main()
{
@FreeSlave
FreeSlave / systeminformation.txt
Last active March 31, 2020 12:26
System information
Computer Information:
Manufacturer: Unknown
Model: Unknown
Form Factor: Desktop
No Touch Input Detected
Processor Information:
CPU Vendor: GenuineIntel
CPU Brand: Intel(R) Core(TM) i5-4590 CPU @ 3.30GHz
CPU Family: 0x6
@FreeSlave
FreeSlave / clementine_gettrack.py
Created November 2, 2018 17:58
Writing currently playing clementine track to file
#!/usr/bin/python
import dbus
import dbus.mainloop.glib
import glib
dbus.mainloop.glib.DBusGMainLoop (set_as_default = True)
session_bus = dbus.SessionBus()
def write_track(track):
@FreeSlave
FreeSlave / droprst.sh
Created January 24, 2018 16:21
Dropping RST packages for https
iptables -I INPUT -p tcp --sport 443 --tcp-flags RST RST -j DROP