Skip to content

Instantly share code, notes, and snippets.

@playday3008
Last active September 10, 2025 20:21
Show Gist options
  • Select an option

  • Save playday3008/d6c6522a3b4f44984a1ba5ef736d3043 to your computer and use it in GitHub Desktop.

Select an option

Save playday3008/d6c6522a3b4f44984a1ba5ef736d3043 to your computer and use it in GitHub Desktop.
UE4SS Scripts for Stray Game

Stray Mod Scripts

Those are UE4SS (Unreal Engine 4 Scripting System) Lua Mod scripts for the Stray Game.

File tree

Mods
├── Stray
│   └── Scripts
│       ├── _README.md
│       ├── main.lua
│       └── deadcity_disable_zurgs.lua

Overview

  • main.lua - Setups logging and calls other scripts
  • deadcity_disable_zurgs.lua - Disables Zurg enemies in the Pursuit section of Dead City level

Usage

  1. Install UE4SS for Stray
  2. Place Lua script files (.lua) in the Mods/Stray/Scripts directory
  3. Enable scripts in the UE4SS configuration
    • In Mods/mods.txt, add Stray : 1 as the last entry (before the Keybinds entry!)

    • In Mods/mods.json, add:

      {
          "mod_name": "Stray",
          "mod_enabled": true
      }

      as the last entry (before the Keybinds entry!)

  4. Done! Launch Stray and enjoy the mods

Requirements

Notes

  • Back up your save files before using mods
-- This script disables all zurg leaders in the DeadCity Pursuit level.
-- Which allows to easily get an achievement "Can't Cat-ch Me"
---Duplicate of `LogFns` from main.lua
---@class logFns
---@field err fun(...: any)
---@field warn fun(...: any)
---@field info fun(...: any)
---@field verbose fun(...: any)
---Disable all zurg leaders in the level.
---@param log logFns
local function disableZurgs(log)
local ZurgLeaders = FindAllOf("BP_ZurgPawn_Leader_C") --[=[@as ABP_ZurgPawn_Leader_C[]?]=]
if not ZurgLeaders then
log.warn("No zurg leaders found")
else
for _, ZurgLeader in pairs(ZurgLeaders) do
if ZurgLeader and ZurgLeader:IsValid() then
ZurgLeader.m_initialSwarmState = 14 -- EZurgState::ZurgState_None
ZurgLeader.LockedOnThisTarget = nil -- AActor*
log.verbose(string.format("Disabled zurg leader %s", ZurgLeader:GetFName():ToString()))
else
log.warn("Found invalid zurg leader")
end
end
end
end
---@param log logFns
local function setup(log)
---@param Actor RemoteUnrealParam<AActor>
RegisterBeginPlayPostHook(function(Actor)
local actor = Actor:get() --[[@as AActor]]
local actorName = actor:GetFName():ToString()
-- Disable zurgs in DeadCity Pursuit level
if actorName == "DeadCity_Zurg_2" then
log.info("Disabling zurgs...")
disableZurgs(log)
log.info("Zurgs are disabled!")
end
end)
log.info("Loaded 'Disable Zurgs in DeadCity Pursuit' module")
end
return setup
local modName = "Stray"
---@enum LogFns
local logFns = {
err = function(...) warn(string.format("[%s][E] %s\n", modName, ...)) end,
warn = function(...) warn(string.format("[%s][W] %s\n", modName, ...)) end,
info = function(...) print(string.format("[%s][I] %s\n", modName, ...)) end,
verbose = function(...) print(string.format("[%s][V] %s\n", modName, ...)) end,
}
---@type function
local log = logFns.info
log("Loading mod modules...")
require("deadcity_disable_zurgs")(logFns)
log("All mod modules loaded!")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment