Sign in to follow this  
Milllk

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

Recommended Posts

Milllk    59

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.

Share this post


Link to post
Share on other sites
Milllk    59

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

Share this post


Link to post
Share on other sites
Milllk    59

i dont want this any more..the book function can just be written in this item..if there really has a solution for this..maybe can be used for anywhere else.

Share this post


Link to post
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
Sign in to follow this