Chaos Project

RPG Maker => RPG Maker Scripts => Script Troubleshooting => Topic started by: Shadow Eye31 on November 08, 2012, 04:08:36 am

Title: [RESOLOVED][RGSS]Adding Extra Stats to Actors
Post by: Shadow Eye31 on November 08, 2012, 04:08:36 am
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
(http://i1152.photobucket.com/albums/p484/shadow_eye31/CustomStatError.png)


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.
Title: Re: [RGSS]Adding Extra Stats to Actors
Post by: KK20 on November 08, 2012, 04:30:06 am
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.
Title: Re: [RGSS]Adding Extra Stats to Actors
Post by: Shadow Eye31 on November 08, 2012, 04:50:39 am
That fix worked perfectly. Thank you!

And with that, this topic has been resolved.