Plugins from mods
A mod can carry Anvil plugins, on the Steam Workshop or in your mod folder. When you enable such a mod, Anvil finds its plugins at the next start, but loads none of them until you approve it.
The steps are on Install plugins. This page says
why Anvil asks, and covers the special cases. Plugins in anvil/plugins/ need no approval.
Why approval
Section titled “Why approval”A plugin is native code that runs inside the game, with the same rights as the game. A mod can be updated by its author at any time, so Anvil never loads plugin code you have not seen:
- An approval covers exactly the files you approved, by their SHA-256 hash.
- Anvil loads the plugin from its own copy of those files, and checks the hash again right before it loads the DLL. If the mod’s files change, Anvil keeps the copy you approved.
- A new version waits for your approval. The version you approved keeps running until then, also when the new one is broken.
The prompt shows the plugin’s name, authors, version, the mod it comes with, whether it changes gameplay, how many game addresses it uses, its hash and its repository. From Anvil 1.22 it also lists the plugin’s modules, what each does to the game and whether it is on by default: one approval covers all of them. The name, the authors and the repository are what the mod says, and Anvil cannot check them. From Anvil 1.12 the Manager warns when a mod uses the id, name or repository of a catalog plugin and is not its Workshop item; the panel in the game has no such warning. Only approve plugins from authors you trust.
Where to approve
Section titled “Where to approve”- In the game: in the Anvil panel (
Ctrl+Shift+F12), select the plugin under From mods on the Plugins tab, click Approve… and confirm. The game is never paused. - Before you play: under From mods on the Plugins page of
AnvilManager.exe. The Manager reads your playset again and approves the plugin only if the mod still has the version it showed you.
Either way the plugin loads at the next start.
Revoke an approval
Section titled “Revoke an approval”On the panel’s Plugins tab or the Manager’s Plugins page, select the plugin and click Revoke the approval. From the next start the plugin no longer loads, and Anvil removes its copy. Disabling the mod in the launcher also stops its plugins, but keeps the approval for when you enable the mod again.
Special cases
Section titled “Special cases”- The same plugin in two mods: neither loads until you approve one of them. That approval ties the id to that mod.
- A plugin you installed yourself wins: a plugin in
anvil/plugins/with the same id is used instead of every mod’s copy, andanvil/anvil.lognames the mods it hides. - Local mods (folders in
Documents/Paradox Interactive/Europa Universalis IV/mod, orEuropa Universalis IV GOG/modfor a GOG game) are approved the same way as Workshop mods. - The approved copy is missing: Anvil makes it again from the mod’s files at the next start
and checks it against the hash you approved. From Anvil 1.24, if it cannot make the copy, the
plugin fails at that start with the reason (
cannot make its approved copy: …in the log), and so do the plugins that need it. From Anvil 1.26 the same goes for a copy whose files changed, for example a damaged file on the drive: Anvil checks the copy against your approval at each start and makes it again while the mod still has the approved files. If the mod’s files changed too, the plugin waits for your approval again. - A Workshop update while the game starts: from Anvil 1.26, Anvil reads a plugin’s
plugin.toml, its symbols and its settings from the same bytes it hashed, with the files locked. An update in the middle of a start cannot pair the plugin you approved with files you did not. anvil/map_modes/in a mod holds map modes from files (Anvil 1.26), not a plugin: it needs no approval.- Safe mode loads no plugins from mods.
- Zipped mods cannot carry plugins.
Your approvals are listed in anvil/trust.toml. You do not need to edit it.
Writing a plugin? Publish your plugin on the Steam Workshop shows how it gets into a mod.