Changing already existing objects

Post » Mon Feb 03, 2014 8:30 pm

Hey, I'm a beginner in modding in general, but willing to learn. I've been looking into a lot of tutorials about the creation kit but there is one concept I still don't understand. Every tutorial asks me to use a cell, usually by duplicating an already existing one and deleting the old stuff. Then I can put an object there, change it, add scripts and so on. But that will change only that particular object in that particular cell, no? What if I want to change or add scripts to every object of that kind in the world? Let's say I want a script to run everytime you eat any food in the game, how can I do that?

User avatar
lucile
 
Posts: 3371
Joined: Thu Mar 22, 2007 4:37 pm

Post » Mon Feb 03, 2014 11:44 pm

In general you want to avoid changing things and you especially don't want to add scripts to things directly. In your specific example, the solution would be to attach a script to a ReferenceAlias on the player. That script could then monitor for the player eating. (I'm not sure exactly how to monitor for eating though. It's probably one of the Story Manager events, but if not there are always the inventory event functions.)
User avatar
Stephanie Kemp
 
Posts: 3329
Joined: Sun Jun 25, 2006 12:39 am


Return to V - Skyrim