malthol Posted April 6, 2013 Posted April 6, 2013 Anyone had any success doing this? I've added the appropriate dialogue to the npc who otherwise works this mill, but it's apparently not setting the player as the mill operator properly. I'm a bit stumped and can't find what I'm missing, and starting to wonder if I wouldn't be better off writing a separate script for the mod's mill (but Papyrus still confuses me, so that's a ongoing learning process as it is). Any help appreciated.
FiftyTifty Posted April 6, 2013 Posted April 6, 2013 (edited) Property Actor PlayerRef Auto EventOnActivate(ObjectRefence akActivator) if akActivator == PlayerRef PlayerRef.Additem("SawnLogRef") endif EndEvent Reason for using a "PlayerRef" instead of Game.GetPlayer(), is that using a property for the player character is less taxing on the scripting system. Probably not noticeable on it's own, but throw in a bazillion other scripts made by other mod creators, the difference can be noticeable. Do take note that the above script I just made was not tested in the CK, and I have not done papyrus for a month or two, so there may be a few compiler errors. Send 'em my way, and I'll see what I can do. Edited April 6, 2013 by FiftyTifty
malthol Posted April 9, 2013 Author Posted April 9, 2013 Thanks for getting me started. Here's what I ended up with, and it compiles fine, but it is not adding the logs to the player. I have set attached to the object reference and set the Property values on it. Not sure what I'm missing, but I am sure this much more complicated than FO3 scripting. Scriptname AAAAResourceObjectSawMillBCScript Actor Property PlayerRef Auto MiscObject Property MaterialBC auto Event OnActivate(ObjectReference akActivator) if akActivator == PlayerRef PlayerRef.Additem(MaterialBC, 15, true) endif EndEvent
IsharaMeradin Posted April 9, 2013 Posted April 9, 2013 How do you know it is not working?The Hearthfire scripts will auto-transfer the wood to the wood pile for your use at the home. You won't get any to appear in the player inventory at all.
malthol Posted April 9, 2013 Author Posted April 9, 2013 Oh nevermind, I figured it out! I needed an "extends ObjectReference" after the name
Recommended Posts