SakuraMahal Posted August 29, 2014 Share Posted August 29, 2014 I am very new to Papyrus. I am trying to figure out how to simply give an item, like gold, to any NPC in Skyrim. I have decent experience with the Creation Kit and have made followers and such. I am stuck on the script aspect of my new spell, which is, for the most part complete, all I need to do is attach this new Papyrus script. I've already tried my hand at it, and even though it didn't throw it back at me with fails, it doesn't work. Here's what I have. Scriptname AAAPurseFill extends activemagiceffect ObjectReference property Gold AutoEvent OnEffextStart(Actor Target) Target.AddItem(Gold, 10000)EndEvent I am attaching this script to my new spell, which I have tested and all that stuff, it will cast and has the animations and sounds I want. However it doesn't give the NPC money. I know it's probably silly, but I really want to learn how to do this. Thanks in advance to anyone who can help! <3 Link to comment Share on other sites More sharing options...
Ghaunadaur Posted August 29, 2014 Share Posted August 29, 2014 To avoid typos (and since scripters are lazy people :rolleyes: ) it's good practice to copy/paste code from the wiki whenever possible. Scriptname AAAPurseFill extends activemagiceffect ObjectReference property Gold Auto Event OnEffectStart(Actor akTarget, Actor akCaster) akTarget.AddItem(Gold, 10000) EndEvent Link to comment Share on other sites More sharing options...
SakuraMahal Posted August 29, 2014 Author Share Posted August 29, 2014 I copied and pasted that into the script. It compiles successfully but when I click the properties buttons, it throws an error that it has trouble re-loading it. Still doesn't seem to work in game. I tried throwing this FF which is aimed, at Lydia, and it doesn't work. I feel this should be working but it's not. I will keep trying. I saw somewhere that someone used "Gold001" and "GoldBase" instead of just "Gold" like I have. I'll see if that works. I have also noticed some scripts use MiscObject" instead of "ObjectReference" Link to comment Share on other sites More sharing options...
Ghaunadaur Posted August 29, 2014 Share Posted August 29, 2014 Yeah, that needs to be an MiscObject Property, sorry. If you name it 'gold001' it can be auto-filled. Link to comment Share on other sites More sharing options...
SakuraMahal Posted August 30, 2014 Author Share Posted August 30, 2014 What do you mean by "auto-filled"? All I really want is for the gold to be added to an NPC. Equivelant to using the console "Click, then additem f 10000" and I know that's easy enough, but I thought it would be fun to make a simple spell to do it and help myself learn more about Papyrus. Well, I will keep trying! Thanks for the input! First time posting here or at any forum in a long time. A relief to see friendly people. When i'm not so pre-occupied with this gold thing, I will definitely look over your MODs. :) Link to comment Share on other sites More sharing options...
SakuraMahal Posted August 30, 2014 Author Share Posted August 30, 2014 Okay, in the property window, I added a new property and called it "Gold" then in the list to the right I chose "Gold001". Then I used the event you mentioned and it works just as iwanted it too. :) I knew I would learn something today! :D <3 Link to comment Share on other sites More sharing options...
Ghaunadaur Posted August 30, 2014 Share Posted August 30, 2014 Glad to help. :smile:If a property name matches the name of an Editor ID, you can just hit the auto-fill button at the bottom of the property window, instead of choosing an object from the dropdown. That's just for convenience. Link to comment Share on other sites More sharing options...
SakuraMahal Posted August 30, 2014 Author Share Posted August 30, 2014 So, this spell works perfectly on my pc, when i copied the ESP file to my fiance's computer, however, everything about the spell works, including effects, sounds, and even the tome. However, the script aspect of my spell, that adds the money, doesnt work. I cant figure out why. Aren't scripts saved into the esp file? Really would like to understand and fix this. Link to comment Share on other sites More sharing options...
IsharaMeradin Posted August 30, 2014 Share Posted August 30, 2014 Skyrim's papyrus scripts are not saved into the ESP file. You either need to create a BSA file that is named the same as the ESP and share both ESP & BSA or provide the loose PEX & PSC files complete with directory structure along with the ESP. The following (provides additional links) will help you to understand how to create a BSA file...http://www.creationkit.com/Archive Link to comment Share on other sites More sharing options...
SakuraMahal Posted August 30, 2014 Author Share Posted August 30, 2014 I moved the loose pex and psc files. pex to data/scripts and psc to data/scripts/source. It still does not work. I really was hoping to understand this and have fun making some simple mods but it seems nothing i do works. am i missing something? thanks for your response though! Link to comment Share on other sites More sharing options...
Recommended Posts