Skip to content

manually invoking scripts in a scripts_modactive directory is failing #5591

Closed

Activity

  1. SilasD commented on Oct 4, 2025

    @SilasD
    Contributor

    The issue is that you can't explicitly invoke a mod's script from the console or the launcher. Autoload of modules does work. Autoload of modules did not work. (Autoload of scripts_modinstalled appeared to be working for another reason, see below.)

    (Modules are scripts with --@module=true, per the docs.)

    This applies to scripts in all mods' scripts_modactive subdirectories, but not to scripts in all mods' scripts_modinstalled subdirectories. It also applied to scripts_modactive subdirectories in the installed copy of mods.

    Fallback code made it appear that scripts_modinstalled was working, but actually pre-install mods' scripts_modinstalled was being searched.

  2. SilasD commented on Oct 4, 2025

    @SilasD
    Contributor

    diagnostic: load a game that has at least one mod that has a scripts_modactive subdirectory:
    run this command at the console:
    :lua @ dfhack.internal.getScriptPaths()
    check if there are any lines ending in scripts_modactive, near or at the end of the output.

    failing in 52.05
    failing in 52.04
    working in 51.08
    failing in 52.03
    failing worse in 52.02-r2 AppData vs portable.txt issue
    working in 52.01 failing in 52.01 (AppData vs portable issue? need to explore further) typo?
    failing in 52.02-r2
    working in 52.01

  3. SilasD commented on Oct 4, 2025

    @SilasD
    Contributor

    Testing in 0.52.05-r1

    Maybe traced to script-manager.lua line 156

    if not path:startswith(INSTALLED_MODS_PATH) then goto continue end

    which is comparing a relative path with an absolute path, so is always failing.

    e.g. for the vanilla_text mod:
    data/vanilla/vanilla_text/ is compared with C:/GAMES/DWARF FORTRESS/Z5205/data/installed_mods/

    (Note: this particular installation of Dwarf Fortress is in C:\Games\Dwarf Fortress\z5205.)

    (tested in portable mode, which probably matters.) (Portable mode does not matter. Still relative path compared with absolute path.)

  4. added a commit that references this issue on Oct 5, 2025
  5. added a commit that references this issue on Oct 6, 2025
    c44e111
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions