How do I make a combination system?

Not favoritedFavorited Favorited 0 favourites
  • 4 posts
From the Asset Store
Over 2700 files with all the colour combinations from a 15 colours palette!
  • I'm trying to have it so if you're in your inventory, selecting one item and then another certain one would craft them both into a new item. Like say... Let's use a donut, some super spicy pepper jam and a lovely blue crayon.

    Donut + Pepper Jam = Super Spicy Donut

    But anything else, say...

    Donut + Blue Crayon = won't combine, will instead give you something like "That won't work."

  • I made this with an array where each row is a new recipe that contains the 2 items required and the result. Then you can select your items by whatever method and you set their names to 2 global variables.

    Then when you confirm the crafting you run through the recipe array at Y=1 checking if GV 1 matches anything in Y=1, if it does then grab that X and compare the same item in Y=2 at that X if it matches GV 2, if so then you craft the named item in Y=3

    Of course sometimes the first craft item is in Y=2 and not Y=1, so if it's not in 1 then check 2.

  • I made a tutorial explaining pretty much what Lionz has suggested - though it's much more long-winded! It might not 100% be what you're after, but could be a good starting point.

    Drag and Drop 'Crafting' System

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I made a tutorial doing pretty much explaining what Lionz has suggested - though it's much more long-winded! It might not 100% be what you're after, but could be a good starting point.

    Drag and Drop 'Crafting' System

    Nice I like it and it's almost a tutorial in how to use JSON as well :)

Jump to:
Active Users
There are 0 visitors browsing this topic (0 users and 0 guests)