Skip to content

Add in-mod devtools: debug file log, debit verification, funeral.* cheats - #1

Merged
CommunityPoke merged 3 commits into
mainfrom
devin/1791038714-funeral-devtools
Oct 3, 2026
Merged

CommunityPoke merged 3 commits into
mainfrom
devin/1791038714-funeral-devtools

Conversation

@devin-ai-integration

Copy link
Copy Markdown
Contributor

Summary

Adds an in-mod debugging surface so Sam Crafts' in-game test can verify the two things that were unverifiable before: whether the Plan Funeral pie-menu entry actually registers, and whether the §764 host / §63 attendee debits actually leave the right households.

New pieces:

  • debug_log.py — appends funeral_mod_debug.log next to the .ts4script in the Mods folder (cwd → tempdir fallbacks, all IO guarded). Charges, injection results, picker outcomes, summons, buffs and eulogies are logged; funeral.debug on|info|off toggles it live.
  • dbg.py — pure-Python helpers: DebitRecord (funds before → after per charge, verified when the drop equals the fee), summarize_debits, describe_event, format_object_check, format_funds_row. No game imports, fully unit-tested.
  • devtools.py — game-facing collectors: verify_report() (injection report + a live re-scan of the OBJECT instance manager listing carriers and keyword-matched objects missing the interaction, fee check, mourning-buff check, active funeral + debit summary), plan_lines(), money_lines(), attendee_lines() (picker dry-run for the selected Sim), selected_sim_info().
  • funds.charge/refund now read the household balance before and after every debit and append a DebitRecord to a reload-protected DEBIT_LOG (event.py), so funeral.plan/funeral.verify/the log file can prove the money moved rather than trusting try_remove's return.
  • startup.py records an INJECTION_REPORT (per tuned object, per affordance, present/absent in _super_affordances).
  • New cheats: funeral.verify, funeral.plan, funeral.money, funeral.attendees, funeral.debug, funeral.log (existing funeral.prices|status|end kept; status now prints a debit summary).
  • tests/test_devtools.py — 21 new tests (36 total, all passing) covering the formatters, debit math and the log writer's tail/verbosity modes.
  • CI: adds a test-macos leg on macos-13 (the x64 image where setup-python still ships 3.7.17 darwin) and a release job that publishes the .ts4script to GitHub Releases on v* tags.

MOD_VERSION → 1.1.0. No behavioral change to the funeral flow itself — only added logging, bookkeeping, and read-only cheat commands.

Link to Devin session: https://app.devin.ai/sessions/bbdb41e8d6e0492cb7b59635711d6327
Open in Devin Desktop: https://app.devin.ai/desktop/session/bbdb41e8d6e0492cb7b59635711d6327?variant=devin
Requested by: @CommunityPoke

…eats

For Sam Crafts' in-game testing of menu visibility and fund debits:

- funeral_mod_debug.log written beside the .ts4script (cwd/temp
  fallback); funeral.debug on|info|off toggles it at runtime.
- Every household debit recorded with funds before->after
  (dbg.DebitRecord, kept in a reload-protected DEBIT_LOG) so
  §764/§63 charges are verifiable, not assumed.
- Injection now records a per-object/per-affordance report; the new
  funeral.verify cheat re-scans the OBJECT manager live and lists
  carriers vs keyword-matched objects missing the interaction.
- New cheats: funeral.verify, funeral.plan, funeral.money,
  funeral.attendees (picker dry-run), funeral.debug, funeral.log.
  funeral.status now includes the debit summary.
- 21 new unit tests (36 total) for the pure helpers + log writer.
- CI: macos-13 leg (setup-python 3.7) alongside the ubuntu container
  job; tag pushes (v*) publish the .ts4script to Releases.

Version bump to 1.1.0.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

CommunityPoke and others added 2 commits October 3, 2026 15:09
Two silent-failure paths found in the audit:

- attendees.py imported ui.ui_dialog_picker names at module top level;
  a name moved between patches would raise ImportError inside
  funeral_mod/__init__, disabling ALL interactions+commands with only a
  sims4.log whisper. Picker symbols are now imported defensively and
  build_picker() degrades to a private funeral (already supported).
- on_load_complete() registered a callback that never fires when the
  OBJECT instance manager already finished loading before the script
  ran; the callback now runs immediately if manager.types is populated.

Also:

- Import failures now also land in funeral_mod_debug.log, and a
  'package initialized' banner confirms the mod actually loaded.
- Sim affordances are additionally injected onto phone-ish objects
  (PHONE_OBJECT_NAME_KEYWORDS) for phone-menu reach.
- New funeral.objects [word] cheat scans tuned OBJECT names and marks
  carriers of Plan Funeral — answers 'is my urn covered?' in one line.
- funeral.verify now reports phone injections + manager type count.
- INJECTION_REPORT extended (phones, types_count); dbg.name_matches and
  dbg.filter_debits_for_zone extracted as pure helpers with tests.
- README: funeral.objects docs, missing-menu troubleshooting steps,
  MCCC compatibility section (no supported third-party integration).

42 tests passing.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@CommunityPoke
CommunityPoke merged commit 2f82730 into main Oct 3, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant