Attaching scripts to RootTemplates works as well! It's a bit different from adding treasure tables, I think.
A short description of what I did:
1) Created char script in my mod module with dependencies on Main and Shared; added it via Ressource Manager to my module.
2) Took the script ID and added an entry to the animals.lsb file (RootTemplates).
3) Copied the file into Data/Public/MyMod/RootTemplates/
Loaded my module in the editor and all rats - in that case - had the new script added.
But would be fine if it was easier.
The other method for custom roots could be:
1. Find the root in the Create and View templates tool
2. Right click on it and select Create new from selected
3.
https://monosnap.com/file/UYzYOe5AXB1Xye3S4jnlvm0astRGVj--Select your mod in drop down
--Insert the name for file your want to store it in (Name.lsb)
--Click Add
--Select that lsb in the drop down
--Enter the name for your root
(next time you just select lsb, don't need to create it)
The created root will be the full copy of the root from Shared, but you will be able to attach any scripts and change any parametres you want.
Still requires manual work, as you need to replace roots of your instances. This can be done in sidebar.
https://monosnap.com/file/YhkFkqcI8f2A78FKc2JVVg1FmycnSjYou select your new created root in the list and this replace most parametrs to your root params