x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

How can I make an efficient currency system with multiple blueprints adding to and taking away from a variable?

As the title says I am looking to make an efficient currency system. I have a variable in a blueprint HudInfo called currency. Within the world the the player is able to spawn actors that add to the currency over and over on a timer. The player is required to pay for those actors through a menu blueprint that subtracts from the variable currency. I have not found anything in this answer hub that really addresses this question. I am able to do this with one blueprint but not multiple. Any suggestions for an efficient system to do this would be greatly appreciated.

Product Version: Not Selected
Tags:
more ▼

asked Oct 21 '14 at 11:06 PM in Blueprint Scripting

avatar image

Grixis
1 2 3 6

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

Well, to start with, you really want to consider where you're storing information and logic. For instance, the currency information, should it be in the HUD? Or should it be in a class for keeping track of player state?

The currency generators you describe - they all have commonality with each other in access, correct? So you'd want a blueprint interface on them - for example, GetCost could be a method on each of these blueprints. Then, you could keep them in an array, and when someone wants to buy one, you call GetCost, which gives you how much the generator costs. Then you can decrement that amount from currency or return an error that there isn't enough.

Make sense?

more ▼

answered Oct 21 '14 at 11:38 PM

avatar image

apollyonbob
53 2 70 12

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question