# I need help making save states for an rpg

**URL:** <https://discourse.processing.org/t/i-need-help-making-save-states-for-an-rpg/6428>\
**Category:** Coding Questions\
**Created:** [December 8, 2018, 7:03pm UTC](https://discourse.processing.org/t/i-need-help-making-save-states-for-an-rpg/6428 "2018-12-08T19:03:22Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)\
**Post date:** [December 8, 2018, 7:16pm UTC](https://discourse.processing.org/t/i-need-help-making-save-states-for-an-rpg/6428/2 "2018-12-08T19:16:19Z")

</div>

> [@Save variable in a loop](https://discourse.processing.org/t/save-variable-in-a-loop/4654/4):
>
> /\*\* \* Load & Save Variable (v1.0.1) \* GoToLoop (2018/Oct/20) \* https://Discourse.Processing.org/t/save-variable-in-a-loop/4654/4 \*/ int a; void setup() { size(300, 200); noLoop(); fill(-1); textAlign(CENTER, CENTER); textSize(0100); final String[] aFile = loadStrings("a.txt"); if (aFile != null) a = int(aFile[0]); } void draw() { background((color) random(#000000)); text(a, width\>\>1, height\>\>1); } void mousePressed() { ++a; redraw = true; } @Override void exit()…

---

_[View the full topic](https://discourse.processing.org/t/i-need-help-making-save-states-for-an-rpg/6428)._
