Jump to content

Recommended Posts

Posted

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.

Posted (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 by FiftyTifty
Posted

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
Posted

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...