Jump to content

Question about equippable items.


Recommended Posts

I have an issue with equippable items (weapons and tools).

 

 

Case 1: Axe

AddPrefabPostInit("axe",function(inst)	inst:AddComponent("fuel")	inst.components.fuel.fuelvalue = TUNING.SMALL_FUELend

​It works fine on host. But client can't use it as fuel. Client starts action, trying, trying, trying and then axe fall back in inventory.

 

 

​Case 2: Ham Bat 

AddPrefabPostInit("hambat",function(inst)	inst:AddComponent("edible")	inst.components.edible.hungervalue = 12end)

Same thing. Host can easily eat it (put on character). But client is trying for 2 seconds and then stops.

 

There are following steps:

1) Client takes item into cursor of the mouse.

2) Then put it on target. On himself or on firepit.

3) Then item auto equips.

4) Then character is keeping his hand in fire pit (or in mouth while eating) for 2-3 seconds.

5) Then nothing happens. Action fails and item is returned into inventory.

 

Probably it's action mechanics issue. Someone knows how to fix this?

 

 

Link to comment
Share on other sites

@rezecib, how and where can I do it?.. Should I do it as client or as a host?..

 

P.S. The mod is already on Steam. But only host can eat Ham Bat ("hambat" prefab) or cook it in campfire.

Edited by Maris
Link to comment
Share on other sites

@rezecib I did it for client but he still can't do custom actions with equippable items. Host even don't see that client is trying. It looks like he is staying and do nothing (just coming to and from campfire).

Link to comment
Share on other sites

Finally I fixed it. However it seems that is't a Klei bug.

3279257.jpg

 

And it's not accurate fix. Just before eat Ham Bat charater takes it to hands. Or just before cook it, he takes it into the hand. Looks strange.

2 actions in 1.

 

Also I added only 3 actions that I need. But there may be more actions wich conflict with equippable items.

 

Now I don't know what to do. I can easily replace whole function from my mod. But it's a bug! And it should be fixed officially. Right?

 

Ot it's not a bug? And I'm missing something? Probably there is another API way to add cookable, eatable and burnable items which are equippable?

Edited by Maris
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...