So I'm trying to set up this familiar system and can't seem to figure out how-

I would like the player to be able to optionally equip a specific ammo (e.g. fire arrow, exploding arrow etc) and the equipped ammo will give bonus stats, effects etc. By default, the framework is currently designed to be able to assign a required ammo, which is an Item, for an ability to consume. This is different from what I would like to do, which is to make ammo optional and equipped.

I am able to go so far as to enable/disable an equipment slot when a specific type of weapon is equipped. For example, when the character equips a bow type weapon, it opens up the [Arrow] equipment slot. By this system however, Arrows needs to be categorized as an Equipment and not an Item.

I am not sure if arrows as Equipment will be able to stack like it is as an Item, and if this is the correct way to do this. Unfortunately, I am not able to test this out as I have also encountered another problem - for some reason, the [Arrow] Equipment slot does not show the equipment (arrows) which I have set up as supposed to be able to be equippable in that slot lol (I have checked everything)

Anyway, please advise on what is the correct/best way to do this system.

If the topic has been raised before and there are already answers, kindly point me to the discussion.

Thanks in advance!
  • There's currently no ammo system available out of the box, but there are different ways to set one up.

    One way would be to use both equipment and items for the ammo. The equipment for which type of ammo and the items for the actual ammo.
    E.g. you'd have fire arrow, exploding arrow, etc. as equipment for the player to select which is used, and additionally as item for the ammo that's available.

    Your abilities that require ammo can use Use Settings > Use Conditions to check for ammo. I'd recommend setting up a reusable status condition template (Templates > Status Condition Templates) and use that on your ability use conditions.

    Individual status conditions can also check for multiple things using the Conditions
    condition type, i.e. you can group together ammo type and ammo quantity checks to check if the equipped ammo has any ammo left in the inventory.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • edited May 12
    I have a couple of questions with regards to this:

    1. If the ammo is set up as equipment (e.g. Fire Arrow is an equipment equipabble in the [Arrow] slot), can it stack like an Item ammo would?

    2. How would I set it up so that using an ability or basic attack would consume 1 or X of whichever ammo is currently equipped (NOT a pre-specified item or equipment)?

    Side note:

    I still cant figure out why an equipment I have set up as an ammo and equipabble in my [Ammo] slot does not show as an equippable equipment in-game. The [Ammo] slot just shows up greyed out. I've checked out everything - I have no conditions on both the slot and the ammo equipment.

    Scenario:

    I've set up [Fire Arrow] as an Equipment equippable in the [Ammo- Arrow] equipment slot. No conditions.

    [Ammo - Arrow] equipment slot is unblocked only when the character equips a [Bow] type weapon. No other conditions. This works.

    I gave my test character 1 [Bow] and 50x [Fire Arrows] in starting inventory.

    Test:
    I am able to switch the starting equipped [Dagger] to [Bow] and unlock the [Ammo-Arrow] slot. But it is greyed out and does not allow the option to (by right) choose [Fire Arrow]

    I have tried setting [Bow] and [Fire Arrow] as starting equipment and it works, but once again does not allow me to change/unequip the [Fire Arrow] to another arrow ([Steel Arrow])

    Been driving me nuts all week lol.

    Any ideas on possible causes?

    Thanks again, love all your work!
    Post edited by Leidustraum on
  • 1) Generally, yes - equipment can also stack, but you can only have 1 equipped at a time.
    You can either set up all equipment to stack in Inventory > Inventory Settings via the Equipment Stack Type setting, or have individual equipment override it in it's Item Settings > Inventory Settings.

    My suggestion I detailed above would separate the ammo type and quantity into equipment (type) and item (quantity). With such a setup, the ammo type would stay equipped, even if the last ammo was used up.

    2) With such a setup, consuming the correct ammo has to be done in the schematic animating your ability. I.e. check which type is equipped and remove one from the user's inventory accordingly.


    As for the equipment slot being greyed out, how did you set up blocking/unblocking the slot?
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • edited May 12
    1.) For the setup you described, does that mean that every time the character obtains a [Fire Arrow] item , he will also automatically obtain a [Fire Arrow] equipment which he can equip?

    But then when consuming ammo based on what is equipped, I will have to think of a logic to check which ammo equipment that is equipped and remove the equivalent ammo item in the inventory, which has a different item ID?

    It feels like a...very complicated way to implement such system? Or am I thinking it wrongly?

    3.) Current [Fire Arrow] equipment setup:
    Item Settings > Inventory Settings
    Own Stack Type - checked
    Stack Type - Auto Stack


    I believe this means that all the [Fire Arrow] will auto stack, and as you were saying, only one will be equipped? But do you mean to say that I can set up in schematics to consume the other ones in stack (that are not equipped)? If so, I wouldn't need to create a separate Ammo (Item) actually, would I?

    4.) On blocking/unblocking-

    Firstly, I created a [Ammo-Arrow] Equipment Slot. By default, I made this slot blocked for all characters. (On test: it works. [Ammo-Arrow] does not show up on equipment list by default)

    I created a Status Effect "Unlock Ammo Slot_Arrow", which has the Equipment Slot Changes>Additional Equipment Slot bonus. It is specified to unlock the [Ammo-Arrow] slot, which is blocked by default, for so long as the character has this status effect. (Note, I did it this way because for some reason I find that only Status Effects allow Equipment Slot Changes)

    Then in the actual [Bow] Item, Bonus Settings>Auto Status Effects> Status Effect Change> Add>"Unlock Ammo Slot_Arrow"

    I believe (correct me if I'm wrong) that it works at least up to this step, because when I switch weapon from [Dagger] to [Bow], the [Ammo-Arrow] Equipment Slot shows up, just that it's greyed out and does not allow me to choose the [Fire Arrow] which was supposed to be in the inventory.

    In addition, the [Fire Arrow] CAN be equipped in the [Ammo-Arrow] Equipment Slot, because when I set it as the character's Starting Equipment, it appears equipped in the correct slot, except once again it is greyed out and doesn't allow me to switch to another arrow type equipment ([Steel Arrow])

    Thanks!
    Post edited by Leidustraum on
  • edited May 13
    1) No, you just need to have that equipment once, e.g. adding all at the start of the game.
    Consuming the correct item is pretty simple:
    - use an Equipment Fork node to check for the different ammo equipment
    - use Remove From Inventory nodes to remove the correct ammo, linked to the fork's according slots

    3) They'll be stacked on other fire arrows when added to the inventory. You can still only equip one of them at a time.
    Yeah, you can also use ammo equipment and consume that from the inventory (like #1).

    My suggestion was to separate them into equipment (for ammo type) and item (for quantity) to be able to still have fire arrows equipped after having shot the last one. Once you get more arrows they'd be useable again without having to equip them again (unless you equipped something else).

    4) There's a difference between additional slots and blocked slots.
    Adding a slot (e.g. via an equipment) will only add a slot if it's not already available to the combatant.
    Blocking a slot will block it from use until it's unblocked. So, if you've blocked the slot, it's blocked. Adding it as an additional slot will still have it blocked :)

    I did a quick test with simply the combatants not having the ammo slot and a bow adding that slot. Equipping the bow adds the slot and I can equip stuff on it.


    Btw, this discussion gave me some ideas for a built-in ammo system - so something might be coming in one of the next updates.
    Post edited by gamingislove on
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • 4.) YES it works perfectly, yay! (With the minor snag that once I've unequipped the bow and equipped it back, the [Ammo] slot does not remember the last chosen ammo and is blank again).
    That makes a lot of sense now though

    1.) I will try this later, will let you know how it goes :)
    Btw, this discussion gave me some ideas for a built-in ammo system - so something might be coming in one of the next updates.
    That would be amazing, thank you! Also glad that this helps to generate ideas for development.
Sign In or Register to comment.