Forum rules - please read before posting.

Crafting a Shotgun

Hello all,
Sorry if this a repeat of another post, but I've tried multiple things and I can't really figure out how to do this.
I'm fairly new to AC, I've gotten most of the basics down, but I couldn't find a video of the step-by-step process for creating. I was hoping that if I describe what I want to do, perhaps someone can help me out.

this is my idea:
I want to have two items: a shotgun and bullets. My plan was to implement a rudimentary (similar to the old alone in the dark games). Once I combine the two, I'd like a 3rd item to appear, a crosshair, which, when selected form inventory will allow me to click with in onto an enemy/object and then trigger a shooting animation (on the character), and a death animation/destruction on the enemy/item respectively.

My question is: what are the steps to do something like this? I've gone into crafting, and I've made the recipe, but I can't figure out how to add the logic to the two items.

Also, is it possible to assign an integer to the ammo item for multiple uses?

Thank you in advance, please let me know if you need any additional info.

Comments

  • I will update in the comment, it seems that there were some typos that I had not noticed, I apologize. Please disregard the post and pay attention only this comment (as I can't delete or edit this post).

    I would like to know if there are any videos or step-by-step tutorials for the crafting system in AC. I'd like to have two items, a shotgun and bullets, and I'd like to merge them into a crosshair (via crafting). When I click the crosshair on an item/enemy I'd like to trigger a player animation and enemy/object destruction animation (respectively). Thank you in advance, and sorry again for the initial post.

  • Welcome to the community, @Alex877.

    A tutorial on AC's crafting system can be found here.

    However, be aware that in AC's terminology, "crafting" refers to a special inventory-combining system that's available in the default Crafting menu. This is for cases where you want to place multiple items onto a "crafting grid" and then get a resulting item if the items are correctly arranged.

    For the case of simply dropping another item onto another to create a third, the crafting system isn't necessary - instead, you'll want to make use of Inventory interactions.

    Information on this can be found in the Manual's "Inventory interactions" chapter. Essentially, it's a case of creating two separate items in the Inventory Manager ("Shotgun" and "Bullets") and then scrolling down to the bottom of one of the item's properties to the "Combine interactions" panel.

    From there, you can define a new Combine interaction, and assign both the item it's being used with, and an ActionList asset to run when this interaction occurs.

    To have this Interaction result in a new item (e.g. Crosshait), create this as a third item in your Inventory Manager, and then have the ActionList asset assigned above include a pair of Inventory: Add or remove Actions - one to remove the Bullets item, and another to replace the Shotgun item with the Crosshair.

    How you run this interaction will be based on your Interaction settings in the Settings Manager, but the standard way is to click the first item (to select it), and then click the second item (to use the first item on it).

    To use an item on an object in the scene (i.e. the Crosshair with the enemy), you can make use of a Hotspot on the object and define an "Inventory interaction" there as well. A tutorial on this topic can be found here.

    To play character animation as part of this interaction, you can use the Character: Animate Action.

  • Hi there! Thank you very much for the quick reply. I’ve managed to do the “crafting”, now I only need to assign animations for the shooter and the target. You rock, and AC is awesome. Have a great day ahead.

  • @ChrisIceBox I've managed to do the first part. I've successfully managed to combine the shotgun with the shells and to transform that into a crosshair. Problem is I can't seem to make the crosshair interact with a glass jar I've added for testing purposes. Here's a video of the successful combination, as well as issue with the jar: https://letsbuild.d.pr/EsKGDm

    Here's what the crosshair looks like in the inventory: https://letsbuild.d.pr/x6TTlf

    Here's the jar: https://letsbuild.d.pr/FaBhEL

    And this is a screencap of the action list between the two, I set a random destruction of the jar when the crosshair goes into contact. - https://letsbuild.d.pr/IiUssS

    Am I missing some step? I've been trying for 2 days; I can't figure out what's going on.

    as always, thank you in advance.

  • edited May 2022

    The Inventory interaction for using the Crosshair and the Jar needs to be defined within the Hotspot for the Jar in the scene. The Jar does not need to be defined as an Inventory item, unless you want to be able to carry it.

    See the way the "Red button" Hotspot is updated with an Inventory interaction here.

    This topic is also covered in video form in the 2D Primer tutorial here.

    The "Linked prefab" field you've assigned your Hotspot to is unrelated to this topic - that's to aid the spawning of items within the scene, and isn't necessary for this.

  • @ChrisIceBox I was overcomplicating a simple thing. Thank you again for your help.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.