[RESOLOVED][RGSS]Adding Extra Stats to Actors

Started by Shadow Eye31, November 08, 2012, 04:08:36 am

Previous topic - Next topic

Shadow Eye31

November 08, 2012, 04:08:36 am Last Edit: November 08, 2012, 04:51:00 am by Shadow Eye31
Hello there.

I have been tinkering with a script to add two new stats to the actors and have them effect Hp and Sp, as well as a new point-based level-up screen to use this feature. Everything works fine, except when I try to leave the level-up screen. If I confirm changes, it shoots this error each time:

Error Message: ShowHide


If I try to just exit without confirming changes, it shoots a similar error, just referencing the actor's variable that holds the amount of points they have. I am able to level the character up, as the variable seems to change correctly within the Game_Actor class, but if I try to spend a point to increase a stat, it throws the error, again, referencing the new variable. Same error, different line each time. The game reads the variables, utilizes them correctly, but can't alter them outside Game_Actor. I tried to follow the way the original stats were set up, but I seem to be missing something.

The link below is the download for my demo project for it, including the module, Game_Battler, Game_Actor, and Scene_LevelUP with all corresponding windows. Maybe someone more savvy with RGSS can see what I'm doing wrong.

http://www.mediafire.com/?chn6gch9u6agboh

Thank you for reading through this topic, and thanks in advance if you decide to help.

KK20

It's exactly what the message window says: You don't have a 'set' method for your variables. Easy way to do that would be to make your new stats be attr_writer
attr_writer :vit


I noticed you defined your 'get' methods, so I that's why I didn't suggest attr_accessor.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Shadow Eye31

That fix worked perfectly. Thank you!

And with that, this topic has been resolved.