Announcement

Collapse
No announcement yet.

Create buy system

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • replied
    There are hundreds of ways you can do this, maybe even thousands, I would use UMG Widgets for the UI and variables stored either in the game state or character blueprint. Anyways however you do it is up to you, good luck.

    Leave a comment:


  • replied
    Store currency as an integer on a custom game instance blueprint.
    Make sure to go into your project settings, and set your game instance to your custom one.
    When gathering currency, cast to your game instance, and set the currency.
    When buying, do the same, but subtract with checks.

    You want to use a game instance to store currency and inventory because it is persistent. This is all assuming this is a local game, and not networked.

    https://www.youtube.com/watch?v=K_4CWDxwufg

    Leave a comment:


  • replied
    I am working on this kinda thing.

    What I do is keep the money "INT" in the player Char.

    Then I use a 3D widget, press space and the mouse appears.

    Click on the widget I want, it the transfer the item to my player and removes the money.

    Very simple, it just depends on how you want to do it.

    You could have it set up that the shop is it's own level, so when you enter it, you load the level and then go back to the old level when you leave, or you could have a widget pop up on the screen and do it that way, or with a 3D widget like myself.

    Narg

    Leave a comment:


  • replied
    Well I know you can just use a variable for currency and certain items you pick up can increase this amount, then you make a hud system that pops up when you talk to a certain npc that allows you to select different buy options. Once you set up the buying options you just do a simple script that checks if the player has enough money to buy that item and if so then it gives you that item and subtracts the money.

    Idk if that helps or not. I could show you a C++ script I made in a doom mod of mine that does a text based shop gui system, that could help you visualize what you must do with blueprint.

    Leave a comment:


  • started a topic Create buy system

    Create buy system

    Hello,
    I was wondering if anyone knew of any tutorials or have any advice on making a player buy system. Kind of like GTA where you have money and go into Ammunation and buy guns. I can't seem to find anything like this on the internet. In my game players can collect money or some type of currency and then go into the store and buy food or ammo. Any information would be great!

    Thanks,
    Mike
Working...
X