Tweak existing content, without breaking other mods?

Post » Tue Oct 27, 2015 2:57 am

So, in the past few days of research (I'm completely new at this!) I have learned that modding Skyrim is a lot like the sneaking game mechanic. Sure, you could just walk right in and put your scripts and changes in all of the most logical places for them to go, easy! ...But then your mod would be incompatible with any other mod that touches those same parts of the game. It's probably inevitable in some cases, but on the other hand, with a little bit of finesse and sheer determination, you might be able to sneak your content in through some crazy loophole of a back door.

Example:

Spoiler
To force myself to learn things I thought I needed to know, I decided to make a simple mod called "Immersive Chef Hat" that would do one thing: Make the player auto-equip a Chef Hat when cooking, if one is present in their inventory. I didn't want my mod to be incompatible with the numerous crafting/cooking/food/needs mods out there, so after banging my head against the wall for a couple days, here's what I did: I made a quest with a script attached that creates an MCM menu to turn Immersive Chef Hat Mode on and off. Next, I realized that any helpful events that might normally do the trick, such as OnActivate, would have to be placed in the proper context (ObjectReference or Actor, probably) and that would potentially break those other mods. So, I resigned myself to find something in Form that would work. And then I found OnAnimationEvent, which would allow me to reference any actor--in this case, my PlayerRef--and any "animation event." I didn't know what an animation event was but I soon found out it was not simply the name of the Idle animation being performed. But after reading [post='1423396-onanimationevent']this entire thread[/post], I found Verteiron's excellent Animation Catcher and used it to identify all of the exact animation events that were happening when my character started and ended cooking. The ones that looked promising were FireSpitCookingStir (at start) and idleChairGetUp (at end). So I wrote my script to fire when these events happened in order. On FireSpitCookingStir, it equips the chef hat, and if that is followed by idleChairGetUp, it unequips. Tested it in game and it worked perfectly. (Probably won't work for the DLC cooking furniture, as I don't have the DLC to find the animation events, and I haven't tested it on Cooking Pots yet).

TL;DR, I made a mod to equip a chef hat when cooking for practice, did it using OnAnimationEvent so it would be compatible with other mods. Modders, how did I do? Is there an obvious solution I overlooked?

My question is this: There are a lot of other areas of the game where Animation Events won't help. If I wanted to, say, add one dialogue option to an NPC, but not conflict with other mods that edit that same NPC, is there a way to do this? Or if I wanted to add a craftable item to a list, could I make sure other mod-added items stayed on that list too? What do you do to avoid jumping through crazy compatibility hoops like patching for 9,000 other mods?

I wish I could just find the answer on my own, by dissecting other mods and learning from them. But so far I can't get the Creator Kit or TES5Edit to let me look inside their scripts. If you could tell me how to do that, you'd be teaching me to fish! (instead of giving me a fish for today).

Thank you for taking the time to read this, I'm a total newb, but I have tremendous respect for the modders that have made this game so much more fun, and I really appreciate your help.

User avatar
Andres Lechuga
 
Posts: 3406
Joined: Sun Aug 12, 2007 8:47 pm

Post » Mon Oct 26, 2015 11:39 pm

dialogue: put that dialogue line on a new quest, generally, player dialogue will be added to dialogue choices, hellos etc. can be used to override (use topic and quest priority, conditions to determine when your line should override vanilla ones)

item to list: just use http://www.creationkit.com/AddForm_-_LeveledItem (or it's form list counterpart), it won't cause problems for items already on that list

nothing useful i can tell you about patching 9000 mods (why'd i want to? :-)

User avatar
matt oneil
 
Posts: 3383
Joined: Tue Oct 09, 2007 12:54 am

Post » Tue Oct 27, 2015 6:44 am

Thank you, s7o. :smile:

I'm gonna go look for an example of a hidden quest that adds dialogue to an NPC right now.

I just hate that there's all these nice ObjectReference functions and Actor functions that I can't use because I don't want to attach a script to an object or NPC in the game that might overwrite another mod. I wish I could use them from a quest or spell, but for now I guess I'm stuck with this short list of Form functions and a handful of ObjectReference functions that don't require a different context. :tongue:

User avatar
Alberto Aguilera
 
Posts: 3472
Joined: Wed Aug 29, 2007 12:42 am

Post » Mon Oct 26, 2015 4:06 pm

for an actor that's already in the game, put him into an alias (if you added dialogue, you've already made a quest anyway :-) and add your script to that. you can script this pretty much like an actor script (with the exception that "self" isn't the actor, but the alias in this case, use GetRef () to get the ref).

...and make that alias a forced alias to his ref in the editor, not unique actor, this causes various kinds of trouble

and for objects, you can either do the same or make your own copy of them. just rename the existing editor object and press enter, you'll be prompted if you want to create a new item (click yes :-)

User avatar
Charlotte X
 
Posts: 3318
Joined: Thu Dec 07, 2006 2:53 am

Post » Tue Oct 27, 2015 12:29 am

THANK YOU!!!!!!!!! That is exactly what I needed to know. I had no idea you could do that. And I was sifting through animation events and everything, jeez!

And if it's an alias of an object, I assume it needs to be forced as well? This is perfect.

What's that, you say? Your mod already edited this object? Doesn't matter, I can too! haha, Thank you again!!!

User avatar
Lauren Denman
 
Posts: 3382
Joined: Fri Jun 16, 2006 10:29 am

Post » Tue Oct 27, 2015 5:27 am

speaking of it, ceck optional and allow reserved / disabled / dead etc.

optional keeps your quest from bugging out in case the alias can't be filled,

and the others to still have it fill if that ref's reserved by an other quest, disabled etc

User avatar
chloe hampson
 
Posts: 3493
Joined: Sun Jun 25, 2006 12:15 pm


Return to V - Skyrim