Skip to main content

User login

What is OpenID?
  • Log in using OpenID
  • Cancel OpenID login
  • Create new account
  • Request new password
Register
  • Home
  • Browse
    • 2D Art
    • 3D Art
    • Concept Art
    • Textures
    • Music
    • Sound Effects
    • Documents
    • Featured Tutorials
  • Submit Art
  • Collect
    • My Collections
    • Art Collections
  • Forums
  • FAQ
  • Leaderboards
    • All Time
      • Total Points
      • Comments
      • Favorites (All)
      • Favorites (2D)
      • Favorites (3D)
      • Favorites (Concept Art)
      • Favorites (Music)
      • Favorites (Sound)
      • Favorites (Textures)
    • Weekly
      • Total Points
      • Comments
      • Favorites (All)
      • Favorites (2D)
      • Favorites (3D)
      • Favorites (Concept Art)
      • Favorites (Music)
      • Favorites (Sound)
      • Favorites (Textures)
  • ❤ Donate
FLARE [ARCHIVED]

Questions about the currency "Gold"

Diablo IV
Sunday, April 14, 2013 - 11:06

I have some questions when calling the "currency" (Gold Value) of a character, I was watching and the currency that I have with a character in the text file, but when loading the data file (SaveLoad.cpp) does not load or save the currency with (pc-> stats.currency;) works with (menu-> inv-> currency). As shows no value (stats->currency;)  called with a variable MenuInventory (currency)

 

I have also looked to (stats->currency = currency;) (same)

 

From MenuStash with a button (test) I want to add gold to currency:

 

if (TestGold-> checkClick ()) {

LootManager :: getInstance () -> playCurrencySound ();

stats-> currency + = 100;

}

 

when I press the button, the sound it makes, but the currency did not increase, I tried adding (class MenuManager) and try calling him MenuManager

 

menu-> inv-> currency + = 100;

menu->inv->addCurrency(100);

 

But just when I press the button, the game break, I tried to change everything that contained "menu-> inv-> currency" by "stats.currency" in MenuInventory, SaveLoad etc... and it worked. (I can see that every time I hit the button, the currency of the inventory up 100)

 

I think the change is not caused by not updating the currency of inventory when enter a value from (stats->currency;)

 

The question I have is how I can call the currency without having to change all currency called from the MenuInventory and SaveLoad

 

Sorry for my english, i,m use Google translator

  • Log in or register to post comments
Clint Bellanger
joined 15 years 10 months ago
Monday, April 15, 2013 - 01:51
Clint Bellanger's picture

menu->inv->currency is the actual amount of gold that the hero has.

You should ignore stats->currency, it is only used in unusual situations and will probably be refactored.

  • Log in or register to post comments
Diablo IV
joined 12 years 10 months ago
Monday, April 15, 2013 - 08:38

how I can increase the value of menu-> inv-> currency MenuStash from a button? In MenuStash.h i put class MenuManager and in private 

 

I put in the header (MenuStash.h) and the necessary classes and corresponding header in MenuStash.cpp.

 

It gives me error or warning in the compilation, but when I press the button to increase the value of the game breaks, it must be because you lack something yet to add to MenuStash or so it seems.

  • Log in or register to post comments
Clint Bellanger
joined 15 years 10 months ago
Monday, April 15, 2013 - 09:07
Clint Bellanger's picture

Are you trying to add gold storage to the Stash?

If so I'd suggest skipping this feature for now.

We have a temporary solution with Gems: gems retain 100% of their price when selling, so players should buy gems and store those in their stash.

Long term we are considering converting gold to a stackable item that goes in a regular item slot. If we do that, moving gold to the stash will automatically work.

  • Log in or register to post comments
Diablo IV
joined 12 years 10 months ago
Monday, April 15, 2013 - 10:28

Yes, i,m trying add gold storage in stash, only for test new adds to source, here i have one ss

 

 

Works this way:

- Add "currency" to stash.txt

- 2 WidgetButton, X Green Withdraw gold storage and add gold to inventory currency and X Blue Deposit gold of inventory to stash

- 1 WidgetInput (Here i need one to get integers and set integers)

 

But it is only a test, I want to see how they would work these things, I like to "touch" in the code and see what new things come out xD

 

P.D: Good idea saved money into form of gems

  • Log in or register to post comments
Stefan Beller
joined 13 years 4 months ago
Monday, April 15, 2013 - 14:38

Mind the discussion at

https://github.com/clintbellanger/flare-game/issues/282 and

https://github.com/clintbellanger/flare-engine/issues/546

The general agreement seemed to me as if treating gold as item instead of making even more exceptions for gold was the concensus.

  • Log in or register to post comments
Diablo IV
joined 12 years 10 months ago
Wednesday, April 24, 2013 - 10:28

i can add this "patch", you can close the thread :)

  • Log in or register to post comments