Forum rules - please read before posting.

Creating a simple equipment system?

edited November 2021 in Technical Q&A

Hi, I'd like to create a very simple equipment system that allows the player to equip something from their inventory.

Like, if you pick up a gun then you can equip it, if you pick up a knife you can equip it etc. Changing the equipment will change the dialogue options or variables.

What's the best way to do it?

Comments

  • If you want the equipped item to affect things like dialogue options, etc, then its best to rely on a Global PopUp variable to keep track of what's equipped.

    A PopUp variable can store a pre-defined set of text values (e.g. "Nothing", "Gun" "Knife" etc) of which one is made "active" when the variable is set.

    In terms of how it affects dialogue options and other logic, you can use the Variable: Set Action to update this variable at the time you want to equip an item, and then use the Variable: PopUp switch Action whenever you want to run different Actions based on its value.

    How/when exactly you update the variable's value will depend on how you want the equipping feature to work. If you want such an item to be equipped any time the Player clicks on it in their Inventory menu, you can place your Variable: Set Action inside that item's "Use" interaction ActionList asset.

    Other options, such as moving an item into an equipment slot, or clicking an item only within a certain menu, can be handled with a bit of custom scripting. I can advise further, but would need to know more about what behaviour you have in mind exactly.

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.