Skip to content

Instantly share code, notes, and snippets.

@LambdaSix
LambdaSix / EventBus.Example.cs
Last active June 21, 2024 21:48
Generic EventBus for Godot, allow generic registration and emitting of event data while remaining nicely typed.
// The EventBus is arranged by 'channels', which are an EventRecord, this encourages/forces
// usage of proper objects for passing events, it's not compatable with
// Godot's Signal system out of the box though.
// Declare your data container, I prefer using Records but EventArgs work as well (with modifying EventBus)
public record EntityUpdateEventArgs(Node Entity, Vector2 Position) : EventRecord;
public class EventBusExample
{
void Example()
/// <summary>
/// A first in last out queue
/// </summary>
/// <typeparam name="T"></typeparam>
public class RollingQueue<T> : IEnumerable<T>
{
private T[] _stack;
private int _stackReadIdx = 0;
private int _stackWriteIdx = 0;
@LambdaSix
LambdaSix / EventManager.cs
Created January 24, 2024 00:56
Unity EventManager
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using UnityEngine;
public abstract class GameEvent
{
}
public FormContentType getFormContentType(Stream dataStream)
{
if (IsTiff(dataStream))
{
return FormContentType.Tiff;
}
else if (IsPDF(dataStream))
{
return FormContentType.Pdf;
}
// Crew Modules
// Andromeda = Vostok
// 7 days from the seat is more than enough.
// Alnair = VA Crew Capsule / TKS
// TKS is mostly a ferry like Soyuz, so 30 days is more than enough
// Auriga = Chelomei LK-1
// 30 days for a moon transfer is very generous
// Tantares = Soyuz
// 30 days as a ferry
// Virgo = Soyuz 7K-L3 LOK
// Soyuz Crew Modules
// - tantares_crew_s1_1 (All Soyuz)
// Soyuz Service Modules
// - tantares_basic_fuel_tank_s1_1 (7K-OK, 7K-T, 7K-TM, 7K-LM)
// - tantares_fuel_tank_s1_1 (7K-T)
// Soyuz Orbital Modules
// tantares_orbital_module_s1_1 (7K-T)
// tantares_orbital_module_s1_2 (7K-OK)
@CUSTOMBARNKIT:FOR[NataliePatches]:NEEDS[CustomBarnKit]
{
@VAB
{
@upgrades = 19000, 75000, 282000
}
@SPH
{
@upgrades = 19000, 75000, 282000
}

ModList

(Nearly?) All of the mods below are available on CKAN for verison 1.9.1. 1.10.1 is still a bit too new for mods to support.

  • Part Trimming For parts packs I tend to trim down the parts myself where possible because Procedural Parts covers most of my needs for fuel tanks and generally it's awkward having 300+ kinds of fuel tank that mostly only differ in aesthetics?
@LambdaSix
LambdaSix / output.log
Created March 10, 2020 13:10
SpaceEngineers XML defs
Type: MyObjectBuilder_SavedGridDetails
Ancestor: VRage.ObjectBuilders.MyObjectBuilder_Base
Members:
PcuCount : Int32& value
AABB_min : VRage.SerializableVector3& value
AABB_max : VRage.SerializableVector3& value
SubtypeName : System.String& value
---------------
Type: MyObjectBuilder_SafeZoneBlock
@LambdaSix
LambdaSix / Context.md
Last active March 1, 2020 20:37
EFM Log

Encountered issues after disabling the defenses on a ground base (nearest one to weapons research center) and taking out one assistance drone.

After disabling the Antenna, issue resolved.