I am wondering how gold is created, that is - is it just stored into a attr_reader (attr_accessor) and then fed back? if so I could easily create new currencies by doing get/set/display.
RGSS 3 Creating new Currencies
Learning Ruby and RGSSxYes and yes, but you should understand a bit more about what you are doing first. attr_reader is just syntactic sugar for an instance level variable (backing field) and a get() method for it. Similarly, attr_accessor does the same while also providing a set() method for the backing field.
I figured it would. It makes sense when you have accessor and the reader, it should be obvious one is for getting and setting while the other is for getting only. Thanks. you can close this thread
Nevermind I'm bad at reading~
This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.
Original thread: https://forums.rpgmakerweb.com/threads/rgss-3-creating-new-currencies.15324/