Jump to content

HELP with adding custom item to player inventory (images included)


Recommended Posts

Let's assume that the item you want added to player inventory is a Weapon (say, a bow) and a Weapon form entry for it has already been added, and its EditorID is 'CustomHuntingBow'

 

First, you need to comment out the 'additem' line (prepend with a semicolon), cause game needs to be able to compile the script before you can edit the properties.

Then I STRONGLY recommend you rename your fragment script. Above your script code, click 'Advanced', click 'Rename' and change the name to something like TIF_HuldaMarriage_02001D97. Leaving that name as is could cause a conflict.

Once that is done: click the script name in Scripts window and click 'Properties'

Click 'Add Property'

In the popup, select 'Actor' as type, and type in 'PlayerRef' in name. Click OK.

Click 'Add Property' again, select 'Weapon' as type, and name 'CustomHuntingBow', OK.

Now, you should have 2 properties in your properties window. Click on each, and click 'Auto-Fill'. If you name those properties exactly as their EditorIDs, they should auto-fill fine. In fact, they might get auto-filled as you add them.

Click OK to close Properties Window.

You will see now that the '+' icon next to script name changed to '+ with pencil' to indicate that it has filled properties.

 

Now, the line in your script (be sure to uncomment it) should be: PlayerRef.AddItem(CustomHuntingBow, 1)

Change, click 'Compile', click OK to save your changes.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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