Skip to content

Instantly share code, notes, and snippets.

@Suor
Suor / devlog.md
Last active November 23, 2025 23:04
DEVLOG prompt

How to write a Devlog Entry

  1. Group First: Before anything else, group related items from the raw change list into a single, high-level feature. For example, added popup on actor hover and added popup bgs become one item: a popup with actor info.
    • Use colon and list for details: When a feature has multiple specific implementations, list those to preserve granular information. For example:
      - навыки для ящеров: травят оружие ядом, последний получает эффект Last Stand
      - огромный рефакторинг системы навыков: контейнер, умный базовый класс, много фиксов
    • Don't over-consolidate: The goal is clarity, not minimalism. Preserve important details within grouped items.
@Suor
Suor / devlog-prompt.md
Created November 12, 2025 03:47
DEVLOG Entry AI prompt

How to write a Devlog Entry

  1. Group First: Before anything else, group related items from the raw change list into a single, high-level feature. For example, added popup on actor hover and added popup bgs become one item: a popup with actor info.
    • Use colon and list for details: When a feature has multiple specific implementations, use list those to preserve granular information. For example:
      - навыки для ящеров: травят оружие ядом, последний получает эффект Last Stand
      - огромный рефакторинг системы навыков: контейнер, умный базовый класс, много фиксов
    • Don't over-consolidate: The goal is clarity, not minimalism. Preserve important details within grouped items.
@Suor
Suor / item_flags.nut
Last active January 23, 2025 16:04
Item Flags for Battle Brothers
local index, index2item;
mod.hook("scripts/states/world_state", function (q) {
q.onBeforeSerialize = @(__original) function (_out) {
index = 0;
__original(_out);
}
q.onBeforeDeserialize = @(__original) function (_in) {
index = 0;
index2item = {}
__original(_in);
@Suor
Suor / rosetta_ru.nut
Created October 16, 2024 15:33
Battle Brothers mod translation example
local rosetta = {
mod = "mod_necro"
// source_lang = "en"
lang = "ru"
version = "0.3.0"
// minVersion = "0.2.1"
}
local function green(text) {
return ::Const.UI.getColorized(text + "", ::Const.UI.Color.PositiveValue)
@Suor
Suor / cantok_wrap.py
Last active January 19, 2024 16:19
A way to enforce cantok on any coroutine
import asyncio
class AbstractToken:
async def wait(self, is_async=True): # A placeholder for the real thing
await asyncio.sleep(0.2)
return
async def wrap(self, task):
future = asyncio.ensure_future(task)
@Suor
Suor / console.nut
Created September 27, 2023 05:17
Dev Console Cheatsheat
// Cycle bros
local bros = World.getPlayerRoster().getAll();
foreach (bro in bros) {
logInfo(bro.getName());
// ...
}
// Add skill to a bro
local bro = ::getBro("Hubert")
local trait = this.new("scripts/skills/traits/master_trait");
@Suor
Suor / mod_hackfix.nut
Created September 14, 2023 09:50
Cook and Blacksmith fix
// Cook and Blacksmith fix
::mods_queue(hx.ID, null, function () {
logInfo("load hitpoints debug and fix");
local inAssetManagerUpdate = false;
local gen = ::rng_new();
::mods_hookNewObjectOnce("states/world/asset_manager", function (o) {
this.logInfo("hx: hook asset_manager");
local update = o.update;
Script Error
the index 'getID' does not exist
Function:
onUse -> scripts/skills/actives/cascade_skill.nut : 90
Variables:
ret = True, target = Table, _targetTile = Instance, _user = Instance, this = Table
Function:
-> msu/hooks/skills/skill.nut : 334
Variables:
use = Function, targetEntity = Table, container = Instance, _forFree = True, _targetTile = Instance, this = Table
@Suor
Suor / fix-ranged-ai.nut
Created August 30, 2023 10:34
Fix ranged AI evaluation on a dead target in Battle Brothers
::mods_hookExactClass("ai/tactical/behaviors/ai_engage_ranged", function (o) {
local function isRelevant(_actor) {
return !_actor.isNull() && !_actor.m.IsDying && _actor.m.IsAlive;
}
local function cleanup(_b) {
_b.m.ValidTargets = _b.m.ValidTargets.filter(@(_, t) isRelevant(t.Actor));
_b.m.PotentialDanger = _b.m.PotentialDanger.filter(@(_, a) isRelevant(a));
}
@Suor
Suor / 1-plus-n.md
Created March 22, 2023 11:11
Trying to make ChatGPT to write a blog post

> Write a blog post about this code trick:

import logging
import os

from funcy import monkey

from django.db.models.query_utils import DeferredAttribute