SenL Posted January 27, 2015 Share Posted January 27, 2015 Let's say I want a char that would ignore any ingredient of "cutgrass" from any recipe (since he's made of grass, lol) -- this includes any recipes (original or mod) -- is this possible? How (hints)? Example:Grass bomb (I just made that up). Ingredients:Cut grass = 10Flint = 1Nitre = 2 Recipe then becomesFlint = 1Nitre = 2(can still show Cut grass = 10 but won't use any cut grass) Thanks. Link to comment https://forums.kleientertainment.com/forums/topic/49830-ignore-an-ingredient-in-any-recipe-how/ Share on other sites More sharing options...
rezecib Posted January 27, 2015 Share Posted January 27, 2015 grass = 10 but won't use any cut grass) Hmm... Well, I think it uses the inventory:Has function to check that, so maybe you could override that function to always return true if it's asking for cutgrass? Link to comment https://forums.kleientertainment.com/forums/topic/49830-ignore-an-ingredient-in-any-recipe-how/#findComment-606642 Share on other sites More sharing options...
SenL Posted January 27, 2015 Author Share Posted January 27, 2015 (edited) I think it uses the inventory:Has function to check that, Sorry, which component/prefab/widget should I look? I looked at widgets\crafting.lua but it looks like that's only for UI.Thanks! Edit:How about this?function Inventory:ConsumeByName(item, amount)in components\inventory.lua Edited January 27, 2015 by SenL Link to comment https://forums.kleientertainment.com/forums/topic/49830-ignore-an-ingredient-in-any-recipe-how/#findComment-606649 Share on other sites More sharing options...
rezecib Posted January 27, 2015 Share Posted January 27, 2015 @SenL, No, that won't work because it will still be like "welp, don't got any grass, can't make it". So it won't ever get to consumebyname. But you will probably have to modify that too, so it doesn't eat what grass you do have. Link to comment https://forums.kleientertainment.com/forums/topic/49830-ignore-an-ingredient-in-any-recipe-how/#findComment-606671 Share on other sites More sharing options...
Maris Posted January 28, 2015 Share Posted January 28, 2015 I'm not sure but maybe take a look on metatables. You could add you own behaviour to AllRecipes variable. Link to comment https://forums.kleientertainment.com/forums/topic/49830-ignore-an-ingredient-in-any-recipe-how/#findComment-607199 Share on other sites More sharing options...
outseeker Posted January 29, 2015 Share Posted January 29, 2015 I guess you could maybe do something like give him a stack of grass and replenish that stack whenever any is used? idk if that's really of any use, just an idea if it happens to be easier to implement XD Link to comment https://forums.kleientertainment.com/forums/topic/49830-ignore-an-ingredient-in-any-recipe-how/#findComment-607365 Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now