Crafting Recipe help
#3
Apparently the index starts at 0 despite the fact that lua indexes start at 1. I'm now getting an error:
Lua engine: attempting to push a plain pointer, pushing nil instead. This indicates an unimplemented part of MCS bindings
Stack trace:
Stack trace end

Looks like you can create a custom crafting recipe by filling the recipe with created items

Recipe:SetIngredient(0,0,E_ITEM_Iron, 1, 0)

Then after setting all of the ingredient slots you set the result:

Recipe:SetResult(88, 1, 0)

Then you use a for loop to compare the Grid items to the recipe items:
		local count = 0
		for x=0,2,1 do
			for y=0,2,1 do
				if Grid:GetItem(x,y):IsSameType(Recipe:GetIngredient(x,y)) then
					count = count + 1
				end
			end
		end

Then you just return true if it matches and false if it doesn't.
Reply
Thanks given by:


Messages In This Thread
Crafting Recipe help - by Lokiare - 10-22-2014, 12:16 PM
RE: Crafting Recipe help - by Lokiare - 10-22-2014, 02:16 PM
RE: Crafting Recipe help - by Lokiare - 10-22-2014, 02:39 PM
RE: Crafting Recipe help - by xoft - 10-22-2014, 06:11 PM
RE: Crafting Recipe help - by xoft - 10-22-2014, 11:18 PM



Users browsing this thread: 1 Guest(s)