Jump to content

Recommended Posts

http://forums.kleientertainment.com/topic/27341-tutorial-the-artists-guide-to-characteritem-modding/ has the answer of your problem.

 

We should now be able to debug spawn it. But we want our character to start with it! So let's add a little bit of code to our character's prefab .lua file. Just above the line "local fn = function(inst)" we need to add a new section, like so: ? 1 2 3 4 5 6 local start_inv = { "YOUR_ITEM", } local fn = function(inst) So it's now added to our start inventory. (We found out how to do this with some detective work, looking at how other characters add start inventories.) We must also change the last line, so the game knows to check the start inventory: ? 1 return MakePlayerCharacter("YOU", prefabs, assets, fn) Becomes: ? 1 return MakePlayerCharacter("YOU", prefabs, assets, fn, start_inv) And finally, we are done!

If you want to just use the default boomerang, you can add to your character's prefab. (I hope this comes out right, I'm not sure how to post code, but it's not too much.):

local start_inv = {"boomerang"-- Custom starting items}

It would go under local prefabs = {}. You can just copy and paste it over your current local start_inv.

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
×
  • Create New...