Every ingredient gets assigned a unique ID
Then create a Map variable with String as the key, and Actor Class as the second value. Lets call it RecipeMap.
Then populate your RecipeMap by creating keys using the various ID combinations
Example:
Batter, ID=0
Egg, ID=1
Cinnamon, ID=2
Create RecipeMap entry with key "0,1,2" and then assign the actor class to "BP_Cake."
There are several problems with this though - first, you will have to hand-create all possible permutations based on ingredients, so the more ingredients, the more entries on that table. Second, you will have to come up with a ruleset to create the keys. For example, there is a key for "0,1,2" but not one for "1,0,2" (even though they have the same ingredients). So perhaps you order your IDs from smallest to largest to get around this problem.
Another approach would be more procedural - this gives you more flexibility, but it takes a lot more thinking to design right. Perhaps your pot can contain an array where all ingredients are added (still add IDs to the array). Then using some ruleset use "Contains" to look for ingredients in the array (pot) and decide what to spawn from that.
When you figure it out post in this thread and let us know how you solved it

Leave a comment: