Jump to content

HELP with adding custom item to player inventory


Recommended Posts

Posted

 dint understand how it works, here are images of what im trying to do: Add custom letter to player inventory, and remove item from player too. 

 

https://imgur.com/a/KnJdvK4

 

If you could use my custom item as an example id appreciate it as I'm having problems understanding mod speak atm.

 

Thank you.

Posted
22 hours ago, GasMaskGhoul said:

 dint understand how it works, here are images of what im trying to do: Add custom letter to player inventory, and remove item from player too. 

 

https://imgur.com/a/KnJdvK4

 

If you could use my custom item as an example id appreciate it as I'm having problems understanding mod speak atm.

 

Thank you.

Your script fragment to add the item seems fine, but you need to declare "properties" for some of the things referenced in the script. Basically, this means to define. The error messages are telling you that you need to define playerREF and HuldaModEquipment. The CK is kinda dumb, so you have tell it what these references relate to, even if they have the exact same names as things you've created. Doing so also tells the script what kind of a thing it is.

 

You do this by clicking on the script name. That will make the Properties button light up, and then click on that. Next, you click on the Add Property button to add each property. For the Property Name, give it the exact name used in the script fragment. For the Type, playerREF is an Actor type, and HuldaModEquipment is a Book type. See the example below and note how references in the script fragment are assigned corresponding values using the Add Property button. 

 

CK Screenshot.png

 

The example below shows how to set up the playerREF (I called it PlayerRef in my script, which is what the reference is called when you find it on the right side, though these don't have to match). For the book, it will look more like the Gold object in the above pic -- meaning you'll just pick the book from the alphabetical list shown when you hit the pull down arrow.  

 

CK Screenshot2.png

 

Finally, to remove the item, the script fragment command would be playerREF.removeitem(HuldaModEquipment,1).

 

Last tip. I notice your script name starts with "TIF". That is the default and there's already lots of such files in your scripts folder. If you intend to package up your mod and post it you'll need to be able to find these files. Giving them a prefix unique to your mod will help you pick them out of your scripts folder. You can do this after the fact - there is a Rename Script command hiding under the Advanced tab.  Better still is to change the default prefix in the CK under File/Preferences/Scripts. Then you never have to think about this again and you can easily find your scripts.

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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