Jump to content

is there any possible for setting character book builder and reader dynamically?


Recommended Posts

like this

 

give him an item,then he become book builder and reader now.

 

i try add the bookbuilder and reader in the item

 

it doesnt work.

 

 

local function item()

 

local inst = createentity()

 

...

 

inst:AddTag("bookbuilder")

 

   
 
    inst:AddComponent("reader")
 
 
even like this
 
 local owner = inst.components.inventoryitem ~= nil and inst.components.inventoryitem.owner or nil
 
if owner then
owner:AddTag("bookbuilder")
 
owner:AddComponent("reader")
end
 
but it doesnt work unless i set the book builder and reader in the character's original define file.
Link to comment
Share on other sites

also i have tried this 

 

 

add in the modmain.lua

 

Recipe("book_gardening", {Ingredient("papyrus", 2), Ingredient("seeds", 1), Ingredient("poop", 1)}, CUSTOM_RECIPETABS.BOOKS, {SCIENCE = 0}, nil, nil, nil, nil, "booksupport")

 

then the item

 

local function equip(inst,owner)

...

 

owner:AddTag("booksupport")

end

 

doesnt work

Link to comment
Share on other sites

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
 Share

×
  • Create New...