LemonCamel 6 Share Posted December 27, 2017 Such as using a knife on the closest chocolate bar in inventory. How do that Link to comment Share on other sites More sharing options...
Pseudo 179 Share Posted December 27, 2017 I won't spoon feed you the code, but rather give you a simple explanation of all you need to do. It's pretty simple, you grab the inventory slot of the initial item (your knife?), then do a relative comparison to the nearest chocolate using a simple iteration, For example: Inventory slots range 0 through 27 (0-27). If your knife is in slot 11 then by using a simple for each you can determine what slots have an item matching the criteria for chocolate, then from there simply store the slots they're housed in and interact with the nearest. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.