Initial Commit

This commit is contained in:
DazedAnon 2026-07-14 12:58:19 -05:00
commit 0ba55d7c8c
6 changed files with 179 additions and 0 deletions

11
.gitattributes vendored Normal file
View file

@ -0,0 +1,11 @@
* text=auto eol=lf
*.cs text eol=lf
*.json text eol=lf
*.md text eol=lf
*.sh text eol=lf
*.mdc text eol=lf
*.png binary
*.dll binary
*.pdb binary

47
.gitignore vendored Normal file
View file

@ -0,0 +1,47 @@
# Cursor / local agent config (machine-specific; do not publish)
.cursor/
# Build / IDE
bin/
obj/
out/
[Bb]uild/
[Dd]ebug/
[Rr]elease/
*.userconfig
*.user
*.suo
*.userosscache
*.sln.docstates
.vs/
.idea/
*.DotSettings.user
*.rsuser
# Compiled artifacts (NML compiles from source; keep repo source-only)
*.dll
*.pdb
*.mdb
*.exe
*.cache
*.ilk
*.ncb
*.opendb
*.ipch
# OS junk
.DS_Store
Thumbs.db
desktop.ini
*~
# Logs / temp
*.log
*.tmp
*.temp
/tmp/
# Local tooling (portable SDKs, decomp dumps, etc.)
.dotnet/
.local/
*.decompiled.cs

38
IdleSpectator/Main.cs Normal file
View file

@ -0,0 +1,38 @@
using UnityEngine;
using NeoModLoader.api;
using NeoModLoader.services;
namespace IdleSpectator;
/// <summary>
/// Phase 1 entry point: prove NeoModLoader loads this mod.
/// Camera / WorldLog / MoveCamera work belongs in a later phase.
/// </summary>
public class ModClass : MonoBehaviour, IMod
{
private ModDeclare _declare;
private GameObject _gameObject;
public ModDeclare GetDeclaration()
{
return _declare;
}
public GameObject GetGameObject()
{
return _gameObject;
}
public string GetUrl()
{
return "";
}
public void OnLoad(ModDeclare pModDecl, GameObject pGameObject)
{
_declare = pModDecl;
_gameObject = pGameObject;
// OnLoad -> Awake -> OnEnable -> Start -> Update
LogService.LogInfo($"[{pModDecl.Name}]: Hello World!");
}
}

7
IdleSpectator/mod.json Normal file
View file

@ -0,0 +1,7 @@
{
"name": "IdleSpectator",
"author": "dazed",
"version": "0.1.0",
"description": "Phase 1 Hello World - AFK camera spectator coming later.",
"GUID": "com.dazed.idlespectator"
}

31
README.md Normal file
View file

@ -0,0 +1,31 @@
# IdleSpectator
WorldBox NeoModLoader mod: AFK camera spectator (Phase 1 Hello World is working).
## Layout
- `IdleSpectator/` - mod source (`mod.json`, `Main.cs`) loaded by NML
- `scripts/verify-nml.sh` - checks that the Hello World line appears in Player.log
## Game API notes (for later spectator work)
Useful real types (not placeholders): `MoveCamera`, `WorldLog` / `WorldLogMessage`, `WarManager`, `BattleKeeperManager`, `Actor`, `MapBox` (`locatePosition`, `locateAndFollow`).
## Deploy
Symlink the mod into the game Mods folder (already done on this machine):
```bash
ln -sfn "$(pwd)/IdleSpectator" \
"$HOME/.local/share/Steam/steamapps/common/worldbox/Mods/IdleSpectator"
```
Requires NeoModLoader in `worldbox_Data/StreamingAssets/mods/` and **Experimental Mode** enabled in Settings.
## Verify
```bash
./scripts/verify-nml.sh
```
Look for: `[NML]: [IdleSpectator]: Hello World!`

45
scripts/verify-nml.sh Executable file
View file

@ -0,0 +1,45 @@
#!/usr/bin/env bash
# Verify IdleSpectator Phase 1 load after Experimental Mode is enabled.
set -euo pipefail
GAME="/home/dazed/.local/share/Steam/steamapps/common/worldbox"
LOG="/home/dazed/.config/unity3d/mkarpenko/WorldBox/Player.log"
NML="$GAME/worldbox_Data/StreamingAssets/mods/NeoModLoader.dll"
MOD="$GAME/Mods/IdleSpectator"
echo "== Preflight =="
[[ -f "$NML" ]] && echo "OK NeoModLoader.dll" || { echo "MISSING NML"; exit 1; }
[[ -e "$MOD/mod.json" ]] && echo "OK IdleSpectator mod.json" || { echo "MISSING mod"; exit 1; }
[[ -e "$MOD/Main.cs" ]] && echo "OK IdleSpectator Main.cs" || { echo "MISSING Main.cs"; exit 1; }
echo
echo "Enable Experimental Mode in WorldBox Settings (bottom of the list),"
echo "then fully restart the game. This script waits for the Hello World log."
echo
if [[ ! -f "$LOG" ]]; then
echo "Waiting for Player.log (launch the game)..."
fi
deadline=$((SECONDS + 300))
while (( SECONDS < deadline )); do
if [[ -f "$LOG" ]] && rg -q "IdleSpectator.*Hello World|\\[IdleSpectator\\]: Hello World" "$LOG"; then
echo
echo "SUCCESS: Hello World found in Player.log"
rg -i "IdleSpectator|NeoModLoader|Experimental mode is enabled|Hello World" "$LOG" | tail -40
exit 0
fi
if [[ -f "$LOG" ]] && rg -q "Experimental mode is enabled|Attempting to load.*NeoModLoader" "$LOG"; then
echo "NML activity detected; still waiting for IdleSpectator Hello World..."
rg -i "NeoModLoader|IdleSpectator|Experimental|Attempting to load|error|exception" "$LOG" | tail -20
fi
sleep 2
done
echo "TIMEOUT: no Hello World within 5 minutes."
echo "Check: Experimental Mode on, then full restart."
if [[ -f "$LOG" ]]; then
echo "--- recent log matches ---"
rg -i "mod|experimental|NML|IdleSpectator|error" "$LOG" | tail -40 || true
fi
exit 1