Recommended Posts

Darkbite98    0

im trying to make it where the item is only pick up by the character and no one else im also trying to make it where she can only make her crock pot recipe and no one else can make it but can eat it i look in to Lucy the axe but cant find anything that i understand that says only Woodie can use this or pick up and i also look in to Warly because i was told he has crock pot recipes that he can make but ever one else cant 

angel WIP.rar 

Share this post


Link to post
Share on other sites
Ultroman    657

Duplicating recipes and making the character-specific plus other stuff:

Make it so no one else can pick up a custom item:  

 

Share this post


Link to post
Share on other sites
Darkbite98    0

i read in this but there nothing here that tells me or shows me how to make a crock pot recipe only cookeable to the character i look in to warly and cant find anything that tells me or shows me what i need to do i sadly cant even see it in crockpot recipe if that even a thing @Ultroman

Edited by Darkbite98

Share this post


Link to post
Share on other sites
Ultroman    657

Ah, sorry. Crockpot recipe. I don't know how it works with character-specific crockpot recipes.

This is all I know about those:

 

Share this post


Link to post
Share on other sites
Desblat    640

You would need to study Warly as he is the only character with custom recipes. It's either Warly has some sort of Tag that allows him to cook or the dishes or his cookpot.

Share this post


Link to post
Share on other sites
Darkbite98    0

@Ultroman ok so i tried the code out to make it where the item cant be pick up by anyone else but it crash when i try to make the item for the character this is the cod i use 

local oldOnPickup = inst.components.inventoryitem.OnPickup
		inst.components.inventoryitem.OnPickup = function(self, pickupguy)
		if pickupguy.prefab == "angel" then
			if not self.inst.itemowner then
				self.inst.itemowner = pickupguy
			end
			if pickupguy == self.inst.itemowner then
				oldOnPickup(self, pickupguy)
			elseif pickupguy.components.talker then
				pickupguy.components.talker:Say("That item is not mine.")
			end
			elseif pickupguy.components.talker then
			pickupguy.components.talker:Say("I cannot wield that.")
		end
	end

it crash telling me that that line 14 (witch is the very first line here) has a inst that is not declared am i missing something here or how do i declare it?

Share this post


Link to post
Share on other sites
Darkbite98    0

@Ultromanok so i did not do the code above so i tryed this one 

		inst.components.inventoryitem.cangoincontainer = false
	inst.components.inventoryitem.onputininventoryfn = function(inst, player) 
	if player.prefab ~= "angel" then 
		inst:DoTaskInTime(0.1, function()
		
		
		player.components.inventory:DropItem(inst)
		player.components.talker:Say("It seems to slip right out of my hands!")
	end)
	end
	end

it works the way i want it to but it act like the back pack where it will not go into the players inv i tern the cangoincontainer to true but it crash my game when i put the item in to a back pack i just want the item to act like lucy the axe in a way 

Edited by Darkbite98

Share this post


Link to post
Share on other sites
Ultroman    657

Well, then you have to analyze the error you get, to see what's missing. I'd need your mod to test it for myself, but see if you can't figure it out. If you need help getting started, see my newcomer post.

On 30.1.2020 at 7:51 PM, Darkbite98 said:

@Ultroman ok so i tried the code out to make it where the item cant be pick up by anyone else but it crash when i try to make the item for the character this is the cod i use 

it crash telling me that that line 14 (witch is the very first line here) has a inst that is not declared am i missing something here or how do i declare it?

I'd need to see where you put the code. Share a zip of your mod with me.

Share this post


Link to post
Share on other sites
Darkbite98    0

Angel the Support.rar @Ultroman here what you where asking for the mod i also did a change to the code for it but it still would some times just go in the the hand of the player who dose not have the tag angel 

		inst.components.inventoryitem.cangoincontainer = true
	inst.components.inventoryitem.onputininventoryfn = function(inst, player) 
	if player.prefab ~= "angel" then 
		inst:DoTaskInTime(0.1, function()
		
		if player.components.inventory then
			player.components.inventory:DropItem(inst)
			player.components.talker:Say("ow! it bit me!")
		else
		end
		
	end)
	end
	end

this is in the chunkers prefab file 

Edited by Darkbite98

Share this post


Link to post
Share on other sites
Ultroman    657

When an item gets put into a container, instead of getting the player in the "player" parameter, you get the container, e.g., chest or backpack.

Share this post


Link to post
Share on other sites
Darkbite98    0
so what do i need to do? becuse im trying to make it act like lucy the axe 
Edited by Darkbite98

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