winteriphone Posted April 26, 2018 Share Posted April 26, 2018 (edited) I am writing a simple Papyrus Script that adds a weapon and armor to the game after pressing a button (Like a button in Cheatroom). The script runs because it brings up the debug message however, the gear I try to add never gives it to the player. Is there something I'm missing?- Skyrim Special Edition, Latest Version with all DLC, PC Function AllStartGear() Player.AddItem(Lockpick, 20, true) Player.AddItem(HealthPotion, 5, true) Game.GetPlayer().AddItem(Lockpick, 12) Game.GetPlayer().AddItem(Longbow, 1) Game.GetPlayer().AddItem(IronArrow, 12) debug.MessageBox("All Starting Gear Added") ;END FRAGMENT CODE - Do not edit anything between this and the begin comment Actor Property Player Auto Potion Property HealthPotion Auto MiscObject Property Lockpick Auto Weapon Property Longbow Auto Ammo Property IronArrow Auto EndFunction Edited April 26, 2018 by winteriphone Link to comment Share on other sites More sharing options...
Deleted3897072User Posted April 26, 2018 Share Posted April 26, 2018 I assume you have set the script properties to the items you want to be given? Link to comment Share on other sites More sharing options...
winteriphone Posted April 26, 2018 Author Share Posted April 26, 2018 Do you mean these? Actor Property Player Auto Potion Property HealthPotion Auto MiscObject Property Lockpick Auto Weapon Property Longbow Auto Ammo Property IronArrow Auto Link to comment Share on other sites More sharing options...
Deleted3897072User Posted April 26, 2018 Share Posted April 26, 2018 You have to tell the button what those properties mean by attaching each property to a specific thing in the game. Edit the button, select the script where you see it in the Papyrus Scripts panel and click on [ Properties ]. This will bring up a form where your five properties are listed. Click on each one in turn and select its value from the pull-down. You can try clicking on [ Auto Fill All ] first; if the name of a property is the same as the name of the object it will fill it in for you. For example IronArrow will get filled in with the 0001397D Iron Arrow form, which is probably what you want. Link to comment Share on other sites More sharing options...
IsharaMeradin Posted April 27, 2018 Share Posted April 27, 2018 You've written your properties inside the function. They cannot go there. Properties can only go within the empty state. They cannot be inside functions or events. My other thought:You can put this script on your pre-placed instance of the button activator. Not the base object mind you but the instance placed in the render window.  Scriptname MyButtonScript Extends ObjectReference Actor Property PlayerRef Auto ;PlayerRef will allow the CK to autofill the property Potion Property HealthPotion Auto MiscObject Property Lockpick Auto Weapon Property Longbow Auto Ammo Property IronArrow Auto Bool doOnce = false Event OnActivate(ObjectReference akActivator) If akActivator == PlayerRef If doOnce == false doOnce = true akActivator.AddItem(Lockpick, 20, true) akActivator.AddItem(HealthPotion, 5, true) akActivator.AddItem(Lockpick, 12) akActivator.AddItem(Longbow, 1) akActivator.AddItem(IronArrow, 12) debug.MessageBox("All Starting Gear Added") Else debug.MessageBox("Can only receive starting gear once") EndIf EndIf EndEvent   If it is part of a quest, that same script can go on an alias which points to the button activator. Now, since what you posted is not a full script... Let us leave room for misunderstanding in what you are wanting to accomplish. Link to comment Share on other sites More sharing options...
winteriphone Posted April 27, 2018 Author Share Posted April 27, 2018 Thanks. How would I specify the "PlayerRef" in SSEEdit? Thanks Link to comment Share on other sites More sharing options...
IsharaMeradin Posted April 28, 2018 Share Posted April 28, 2018 Use the Creation Kit instead? I never used xEdit for filling in properties. Link to comment Share on other sites More sharing options...
winteriphone Posted May 1, 2018 Author Share Posted May 1, 2018 Thanks for your help. I found that using "PlayerRef" to get the name only works if you have SKSE. Link to comment Share on other sites More sharing options...
Evangela Posted May 2, 2018 Share Posted May 2, 2018 PlayerRef is the Player Reference that is filled automatically when you name an actor property PlayerRef. Link to comment Share on other sites More sharing options...
winteriphone Posted May 2, 2018 Author Share Posted May 2, 2018 PlayerRef is the Player Reference that is filled automatically when you name an actor property PlayerRef.Okay, thanks. I found the setting for it in case someone is wondering. It is Player [00000014] . Link to comment Share on other sites More sharing options...
Recommended Posts