Formula

ingenious.applicationsingenious.applications Member Posts: 102
edited July 2012 in Working with GS (Mac)
Hello everyone. I am currently trying to fix a display for the player that shows them their current "funds." I have three integers in the formula and I thought I had it correctly, but something must be wrong because nothing ever adds up.

game.World Bank +( game.Income - game.Expenses )

game.World Bank is the integer that should always show in the display and I need it to update based upon the information at the time from the other two integers.

Comments

  • AfterBurnettAfterBurnett Member Posts: 3,474
    Should it be "game.World Bank = ( game.Income - game.Expenses )"? That works with code... I can't remember how GS does math... I never used it as I suck at math. LOL.
  • AfterBurnettAfterBurnett Member Posts: 3,474
    edited July 2012
    Or, if you need it to keep its current value and add the others on top of that: "game.World Bank += ( game.Income - game.Expenses )"
  • ingenious.applicationsingenious.applications Member Posts: 102
    edited July 2012
    Hello POLYGAMe. Yes, I need to keep the current value and just add (or subtract) modifiers to/from it. I'll try that segment of code in a little while and see if it works. Thanks.
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    edited July 2012
    Hi @ingeniousapplications

    Or what about:

    game.World Bank = game.World Bank +( game.Income - game.Expenses )

    Edit: hang on, i see now, that's what you've got already; personally I've no idea why that shouldn't work..

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

Sign In or Register to comment.