0

So to make my question as easy to understand as possible, I am in the process of writing what will start out as a table-top/text based style RPG game. I already have formulas for all my battle mechanics worked out except one. Essentially what I am trying to do is as follows:

Let's say I'm simulating a battle. During this battle, 2 values will start at a certain number, and based on decisions/calculations throughout the battle, these 2 values will decrease.

More plainly - Character Health Points. Say a character starts with 150 HP, and based on calculations, an enemy does 10 damage, taking the characters HP to 140 HP. What I would like to happen is, say I always calculate the value of enemy damage done in cell D10, and I put the character's starting HP in E10, and every time D10 is recalculated for a new attack, I want to recalculate E10 to reflect this, so if the next enemy attack calculated in D10 was 15, E10 would be recalculated to reflect 140-15= 125hp, basically keeping E10's value in realtime based on D10's calculated value.

Is this possible, and if so, how? Thanks in advance for any assistance.
- Greg

1 Answer 1

0

Generally, you can program most anything with sophisticated macros, so yes, it is possible.

But it is not a natural application of Excel - it is designed to be a statically laid-out sheet with data, references and formulas; the concept of continuously changing content in a cell does not go well with that. There is little support for an iterative approach as you describe, but as said, if you're willing to learn macro programming, you can make it happen.

I hope you did not expect someone here to write free macros for you?

2
  • Thanks so much for the information, I'm definitely not looking for anyone to write any complicated macros for me, though if someone did they would be a godsend - I was really more looking for the answer you provided me, so now I know I need to either research Macro programming or seek another option. (I'm working on looking into doing this in PHP w/ an SQL database, but using excel was an easy starting point to rough out the basics. Thanks again for your help!
    – Greg C
    Jun 24, 2016 at 21:35
  • There's nothing to stop you from creating two rows where you record each player's starting health and each column records their attack. Another row could easily calculate the total damage and interaction between the two. You don't need a macro for that. This way, you also have a record of attack history so you can balance weapons and spells for balanced play.
    – Sun
    Jun 27, 2016 at 15:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .