The RPG Maker Resource Kit

RMRK RPG Maker Creation => RPG Maker General => General Scripting => Topic started by: staticlove on February 20, 2009, 04:24:03 AM

Title: Actor.class_ID? ... howto show an actors class name
Post by: staticlove on February 20, 2009, 04:24:03 AM
Hi everybody  ;8

I could use some help with scripting.

I'm trying to make an actors class name be written in a menu, but I only seem to be able to find how to write down the class_id.

The script goes something like this:

    self.contents.draw_text(--, --, --, --, "Class: #{@actor.class_id}")

In game it now shows the text: "Class: 09", so at least I got it working that far.

I've looked through the help file and I think I can call the class's name with the class.name command. I just don't understand how exactly.

I've tried lots of things like actor.class.name... which gives nothing. I'm new to using the script, but I want to learn. I'm sure one of you could give me some help!

Thanks in advance!  ;)
Title: Re: Actor.class_ID? ... howto show an actors class name
Post by: modern algebra on February 20, 2009, 04:46:43 AM
Well, you're most of the way there. To get the name of a class, you need:


$data_classes[class_id].name


So put what you have now in for the class ID and go nuts.
Title: Re: Actor.class_ID? ... howto show an actors class name
Post by: staticlove on February 20, 2009, 06:23:18 AM
Thanks! I've made it work  :D

(https://rmrk.net/proxy.php?request=http%3A%2F%2Fwww.smh.com.au%2Fffximage%2F2006%2F12%2F12%2Fborat_thumbs_up_narrowweb__300x504%2C0.jpg&hash=17632a11ca126a6646772fbf40ee9c2edcf18a1c)