Skip to content

Instantly share code, notes, and snippets.

@duncathan
duncathan / tsc_util.py
Last active September 4, 2021 05:37
TSC utility scripts
import math
# converts a tsc value (e.g. "1234" or "000/") to a number (1234 or -1)
# can handle input values of any length, for niche use cases such as custom TSC commands
def tsc_value_to_num(a, input_length=4):
b = 0
for i in range(input_length):
b += (ord(a[i]) - ord('0')) * 10**((input_length-1)-i)
return b
@duncathan
duncathan / atmos.md
Last active December 20, 2021 08:50
work in progress

Atmospherics

1. Preamble

Dunc's avatar

Figure 1.1: My avatar on github, the /tg/station forums, and BYOND

Hi friends! My name is Dunc. As some background, I have been contributing to /tg/ atmos in various ways since 2015. I was tutored by Aranclanos and eventually followed in his footsteps in writing several major refactors of the atmos system. I am a maintainer for the /tg/ codebase and any atmos issues or PRs are my concern. Most importantly, however, is the fact that as of the time of writing I am the only person who understands each component of the current atmos system. That fact is by far the most important reason for the existence of this document; it is my responsibility to share what I know.

Atmospherics is a very complicated and intimidating system of SS13, and as such very few contributors have ever made changes to it. Even fewer is the number of contributors who have made changes to the more fundamental aspects of atmos, such as Environmental Atmos or

@duncathan
duncathan / hell.dm
Created December 3, 2017 08:31
output: still bad but ok
/obj
var/const/foo = 0
/client/verb/make_the_sign_of_the_cross_as_you_read_this_code()
var/obj/o = new
o.vars["foo"] = 1
if(o.foo)
world << "oh no"
else if(o.vars["foo"])
world << "still bad but ok"