I've started from scratch five times, in case I'm glitching it with typos or something.
What I'm doing:
- Installed Companion_v3.1.esp in its own data dir, loaded it, and tested the sample companion it comes with, who is working flawlessly: PlaceAtPC->1gr_Comp2, 1, 100, 0
- Opened this mod in OpenMW-CS, and duplicated this NPC, and customized it, with a new ID.
- Gave it its own scripts, as copy-pastes of the originals, changed their names (in the mod and in their own Start lines); then changed the first script's references to the second script to reflect the name of my fork of the second script; then updated the second script internally for a self-referential StopScript command. The ReadMe says to do all of this, step by step. The only thing not applicable is the "click this, then that"-style noob instructions for navigating the GUI of Bethesda's CS app.
- Created a new Greeting 0 for my companion.
- Created a new Topic for follow/stay/guard commands that is the same as the original, just with its own name.
- Duplicated the Topicinfos for the original commands, also at new names, now referring to the new Topic, and set to my new NPC as Actor, and also customized the text a little.
- Did the same with the combat topic, and the "other" topic, and their Topicinfos.
- Quadruple-checked everything; ran Verify.
- Saved my mod-of-a-mod as a .omwaddon. Loaded it after the original mod. Both the original NPC and my new one (drq_Yenivaer) appear when added to the world via the console. Mine appears to work fine, until you try to do anything with her companion dialogue options; she will inventory-share, etc. The mod's original stock companion still works fine, followed me out of the room, and went and killed some hapless hostiles with me.
- Started over. Did clean-saving routines. Fixed a bug in the original (one dialogue response was mistakenly set for females only), propagated this fix to my version. Also added the script names to the End commands at the end of the scripts, in case that might matter.
- Exact same failure. Repeated several times, using different Topic names, same fail each time.
What on earth could I be doing wrong? I'm a scripter for a living (bash, perl, PHP, etc.) so this is really making me feel like I suddenly got dain bramage. Been trying to debug this for over 8 hours, and I get the feeling there's some "secret trick" I don't know about. If I understood Morrowind Scripting for Dummies correctly, all the variables declared and used in the scripts are local, so do not need to have unique names. Now I'm wondering if the order in which I created the resources makes a difference (e.g., do I need to do NPC, then scripts, then greeting, then Topic, then Topicinfos? Or scripts, then NPC, then ...? Does it matter?).
PS: What I would much rather do is duplicate the contents of the original .esp as a .omwaddon, and customize it as an all-new plugin with several added companions (each with own scripts, but some shared resources like waterbreathing ability spells), without having to load the original .esp in my game at all. But I can't yet figure out a way to do anything like that. And the problem might happen anyway if I try to do multiple companions in it, or even just one but also have the original .esp loaded (or any other companion mod that used some resources from it without renaming them). Even better would be a way to work with .esp files directly in MacOS, so if I can develop a usable companion mod I can realease it for everyone not just OpenMW users. But I'll take any help I can get to even have this work in my local game at this point!
OpenMW-CS is somewhat confusing and awkward to me (like, why can't I duplicate a Topicinfo and change the topic? I seem to have to create a blank one and manually do every single field in it, to mostly-duplicate an existing one). This is my first attempt to do anything with the app other than using Verify to debug problematic mods, fixing script typos, and nerfing excessive stats on mod-added gear.