Jump to content
haothehare

a problem with Yanfly's Class System

Recommended Posts

For the second problem, you're changing the actor graphic, not the face graphic. Try changing the face graphic as well.

Actually you're doing that right. I'll look into the script more incase it's doing something else wrong.

EDIT: I did what you did, and it worked for me. Are you changing the right actor?

EDIT 2: Change the Trigger on your common event to Parallel Process.

 

Have you checked the class script to see if you can set a max class level? I couldn't imagine there not being an option for that.

Actor level is far different from something like class level.

 

EDIT: Found this, which points to this line.

 

# This script adds the ability for your player to freely change the classes of
# actors outside of battle from a menu. When changing classes, this script
# gives the option for the developer to choose whether or not classes have
# their own levels (causing the actor's level to reset back to the class's
# level) or to maintain the current level. In addition to providing the ability
# to change classes, equipping a subclass is also doable, and the mechanics of
# having a subclass can also be defined within this script.

 

    MAINTAIN_LEVELS = false    # Maintain through all classes. Default: false.

Would this help you or do you need a class level and actor level to be separate? If so, you may have to ask someone to help you implement that.

Edited by Titanhex

Share this post


Link to post
Share on other sites
For the second problem, you're changing the actor graphic, not the face graphic. Try changing the face graphic as well.

 

Have you checked the class script to see if you can set a max class level? I couldn't imagine there not being an option for that.

Actor level is far different from something like class level.

 

EDIT: Found this, which problem points to this line.

 

# This script adds the ability for your player to freely change the classes of
# actors outside of battle from a menu. When changing classes, this script
# gives the option for the developer to choose whether or not classes have
# their own levels (causing the actor's level to reset back to the class's
# level) or to maintain the current level. In addition to providing the ability
# to change classes, equipping a subclass is also doable, and the mechanics of
# having a subclass can also be defined within this script.

 

    MAINTAIN_LEVELS = false    # Maintain through all classes. Default: false.

Would this help you or do you need a class level and actor level to be separate? If so, you may have to ask someone to help you implement that.

 

 

thanks for the response i'm going to try to change face graphic as well (the change actor graphic asks for 2 graphics, one is actor and one is face soo I'm not sure if there is a separate function to change face but I'll go look for it right now.)

 

I looked through the script, and there are no # green texts explaining how to change class level max...  I don't feel comfortable changing the actual ruby script itself as I don't know ruby.

Share this post


Link to post
Share on other sites

<a href="http://s461.beta.photobucket.com/user/haothehare/media/classsystem7_zps5624fc7a.png.html" target="_blank"><img src="http://i461.photobucket.com/albums/qq331/haothehare/classsystem7_zps5624fc7a.png" border="0" alt="Photobucket"/></a>

 

I think change actor graphic changes both the sprite and the face since I couldn't find anything in the Common events' Event commands that say Change actor face.

 

As for the changing it to maintain Levels = true... if I did that then say I have a character who levels up normally...

class commoner level 20 unlocks rogue

rogue lvel 20 unlocks mercenary and also thief

 

If I make maintain levels = true then that means once I have rogue unlocked my character will have to choose between Mercenary and thief, and then I'll have to use a call script to remove the option he didn't choose to make it into a permanent class change choice. But that is not what I want. I want to be able for the character to level up as a mercenary AND as a thief so that he can unlock further classes that require both of those classes to be level 20. The other reason maintain level won't work is if my character is level 40 (making him a level 20 mercenary in a sense) he won't be able to learn any of the skills between level 20 and 40 for the thief class because he is alreayd level 40 as a mercenary.

 

Edit: why can't I use Image code here? I keep getting a weird error telling me "we don't accept this image extension on this community" ... but my first post was able to go through...

 

classsystem7_zps5624fc7a.png

 

see I did it... wtf? lol

Edited by haothehare

Share this post


Link to post
Share on other sites

You're right, there are none.  This script does not allow a class maximum. I will look through the script to see what I can do for you.

 

Also, for now, try setting the common event you made to parallel process and restore the graphics you had in the screenshot. I think I found a more efficient way though, so this is just a temporary fix.

Edited by Titanhex

Share this post


Link to post
Share on other sites

You know what? I'll change

 MAINTAIN_LEVELS = false 

into

 MAINTAIN_LEVELS = true 

 

and test it out.

 


Edit: it didn't work but then I should have known since the script Class Unlock Level did say that it requires MAINTAIN_LEVELS = false in order for it to work. What ended up happening when I tested it was commoner level was maxed out at 20 because I made the actor level cap be 20. And that's it... no classes were unlocked.

 

 

Edit: I'm hoping someone can solve this problem, because if not I'll have to disable the Class System scripts by Yanfly and do all my class changes via Common Events... which would require probably more Common Events than the max 999, and unfortunately Yanfly's Change Limits don't allow me to change the limits of Common Events.... hmmm actually maybe I can jumble every class change into one super long Common Event? hmmm... maybe that will work. That'll be my back up plan if Yanfly's script can't be modified into allowing class max level caps... But that will take a ton of work since each start class i.e. rogue, will have branches every 20 levels. My max level cap will be 80, so that means approximately 15 classes per starting class, and I plan on having maybe 5 or 6 starting classes and a few races ...

 

Edit: Also I've had problems with reducing the stats down to say level 1 characters having maybe only 40 or 50 Hp and starting stats like atk = to maybe 6 or 10... That would be idea and for stat growth to be around 2-5 per level for non HP parameters... my guess is the errors I keep getting is somehow due to a Yanfly script or because of Skills' damage formulas not accomodating low numbers for stats, but I'll look into that later, after the class and class change issues are fixed. One problem at a time :D I'm of the philosophy of taking a minimalist approach to adding functions... the less I add the better, but the more player choice, and player strategies I can introduce with minimal change the better. things like raising level cap beyond 99 and raising parameter caps is kinda silly since it adds no strategy to the game. i don't know why I'm ranting.

 

 

Ok I'm going to test it with Maintain Levels = false

and try running the common event in parallel process

Edit: Test result = failure... lol I tested it in parallel process but Common event Change Actor graphic was unable to run parallel process with Yanfly's Class System script such that the image would change when you change class. I think it would also be interesting to note that BOTH actor sprite and actor face remained unchanged.

Edited by haothehare

Share this post


Link to post
Share on other sites

Sounds good.

 

On the other hand, this:

 

			@exp[class_id] = 0 if @exp[class_id].nil?
			#declare a max level (using EXP)
			#If you can’t find it, go to the class database and select exp curve
			#then switch view to total at the top
			@exp[max_level] = 2547133 #This is the value to change. It declares a max level
			#You need to calculate how much exp for max level
			#Do it manually if using Yanfly-Adjusting Limits
			#To calculate max level exp if using Yanfly-adjusting limits is all math!!

			# Level 99 = 2547133
			# to calculate past there…. have to add on multiples of 50744
			# Level 110 = 3156061
			# To go from 99 -> 110 have to add on 12 multiples of 50744.

While I don't fully understand it, tinker with it and see what you can't do.

 

If I'm not mistaken, try this:

 

Find that line:

@exp[max_level] = 2547133

Then change it to :

@exp[max_level] = 40899

Should be your lvl 20 max.

Share this post


Link to post
Share on other sites
Sounds good.

 

On the other hand, this:

 

			@exp[class_id] = 0 if @exp[class_id].nil?
			#declare a max level (using EXP)
			#If you can’t find it, go to the class database and select exp curve
			#then switch view to total at the top
			@exp[max_level] = 2547133 #This is the value to change. It declares a max level
			#You need to calculate how much exp for max level
			#Do it manually if using Yanfly-Adjusting Limits
			#To calculate max level exp if using Yanfly-adjusting limits is all math!!

			# Level 99 = 2547133
			# to calculate past there…. have to add on multiples of 50744
			# Level 110 = 3156061
			# To go from 99 -> 110 have to add on 12 multiples of 50744.

While I don't fully understand it, tinker with it and see what you can't do.

 

If I'm not mistaken, try this:

 

Find that line:

@exp[max_level] = 2547133

Then change it to :

@exp[max_level] = 40899

Should be your lvl 20 max.

Ok nice job and thank you for the find.

 

However, how do I specify for more than one class? I'll probably have to make a lot of these one for each class I make since higher tier classes will start at level 1 but will require way more exp to level up than your lower tier classes. So what do I need to type into the script in order to make multiple class max?

 

Also: Do I have to set the Maintain Levels to true or keep it as false?  I see this line of code here and I'm not sure if that's a condition

 

return @level if YEA::CLASS_SYSTEM::MAINTAIN_LEVELS

 

which should I do ultimately? maintain levels = true and then give each class a max level?  or Maintain level = false and then remove actor level max, and give each class a level max? I'm confused @_@

 

also here's my Hello RPG Maker World post in the forums if you wanna say hi to me lol:

http://www.rpgmakervxace.net/topic/9597-new-to-rpg-maker-vx-ace-project-description-and-questions/

 

 

 

Edit:

 

Since I don't know how to code. I'm not sure what to do with the following.

 

def class_level(class_id)

        return @level if YEA::CLASS_SYSTEM::MAINTAIN_LEVELS

            temp_class = $data_classes[class_id]

            @exp[class_id] = 0 if @exp[class_id].nil?

            #declare a max level (using EXP)

            #If you can’t find it, go to the class database and select exp curve

            #then switch view to total at the top

            @exp[max_level] = 2547133 #This is the value to change. It declares a max level

            #You need to calculate how much exp for max level

            #Do it manually if using Yanfly-Adjusting Limits

            #To calculate max level exp if using Yanfly-adjusting limits is all math!!

 

            # Level 99 = 2547133

            # to calculate past there…. have to add on multiples of 50744

            # Level 110 = 3156061

            # To go from 99 -> 110 have to add on 12 multiples of 50744.

            n = 1            

            loop do

                break if temp_class.exp_for_level(n+1) > @exp[class_id]

                n += 1

                #add a restriction to “kick out†of loop if exp exceeds max level exp

                break if temp_class.exp_for_level(n+1) > @exp[max_level]

            end

        return n

    end

What I mean specifically is this:

 

do I do this?

 

# insert the following code into that section of the script and make more of the same for the other classes in my game?

 

 

@exp[class_id] = 1 if @exp[class_id].nil?

@exp[max_level] = 40899

@exp[class_id] = 2 if @exp[class_id].nil?

@exp[max_level] = 252052 # this is the total exp for level 40 minus the total exp for level 20 for my higher tier class that class 1 unlocks at level 20 so that levels 1-20 of class 2 is effectively the levels 21-40 for my character in terms of how much exp it takes to level.

 

or do I have to do this?

 

 

def class_level(class_id)

        return @level if YEA::CLASS_SYSTEM::MAINTAIN_LEVELS

            temp_class = $data_classes[class_id]

            @exp[class_id] = 1 if @exp[class_id].nil?

@exp[max_level] = 40899

   n = 1            

            loop do

                break if temp_class.exp_for_level(n+1) > @exp[class_id]

                n += 1

                #add a restriction to “kick out†of loop if exp exceeds max level exp

                break if temp_class.exp_for_level(n+1) > @exp[max_level]

            end

        return n

    end # this is the end of class 1's designation for class max level cap

def class_level(class_id)

        return @level if YEA::CLASS_SYSTEM::MAINTAIN_LEVELS

            temp_class = $data_classes[class_id]

            @exp[class_id] = 2 if @exp[class_id].nil?

@exp[max_level] = 252052 # this is the total exp for level 40 minus the total exp for level 20 for my higher tier class that class 1 unlocks at level 20 so that levels 1-20 of class 2 is effectively the levels 21-40 for my character in terms of how much exp it takes to level.

   n = 1            

            loop do

                break if temp_class.exp_for_level(n+1) > @exp[class_id]

                n += 1

                #add a restriction to “kick out†of loop if exp exceeds max level exp

                break if temp_class.exp_for_level(n+1) > @exp[max_level]

            end

        return n

    end # this is end of the code for max level cap for class 2

# copy/paste the whole code for that section over completely for each individual class?

 

which will I have to do? I dont' code so I don't know what will work and I'd rather not mess the script up.

 

This is also assuming that I want to use the exp curve generated by the default values of [30, 20, 30, 30]

 

Edit: I think I'm done for today, I'll come back tomorrow and check for replies and test the above scenarios with the script. I'm going offline to actually write out my classes and design their skills on paper. :)

Edited by haothehare

Share this post


Link to post
Share on other sites

That'd require an edit.

 

This is all theory and hasn't been tested but give it a shot:

 

			if class_id == 1
				extra = 529492 - @exp[max_level]
			else class_id == 2
				extra = 131711 - @exp[max_level]
			end
			loop do
				break if temp_class.exp_for_level(n+1) > @exp[class_id]
				n += 1
				#add a restriction to “kick out†of loop if exp exceeds max level exp
				break if temp_class.exp_for_level(n+1) > @exp[max_level]+extra
			end

Add that over this:

			loop do
				break if temp_class.exp_for_level(n+1) > @exp[class_id]
				n += 1
				#add a restriction to “kick out†of loop if exp exceeds max level exp
				break if temp_class.exp_for_level(n+1) > @exp[max_level]
			end

Right now it should set class 1 to have max level 50 and class 2 to have max level 30.

 

I'm not sure if you're skilled enough in ruby to understand how to edit this. I hope you are.

 

basically if you add an

			else class_id == #
				extra = ###### - @exp[max_level]

 

Just before the first "end", you'll be able to set the class id and the new max level for that class. Like so:

 

			if class_id == 1
				extra = 529492 - @exp[max_level] #50
			else class_id == 2
				extra = 131711 - @exp[max_level] #30
			else class_id == 3
				extra = 292951 - @exp[max_level] #40
			end
			loop do
				break if temp_class.exp_for_level(n+1) > @exp[class_id]
				n += 1
				#add a restriction to “kick out†of loop if exp exceeds max level exp
				break if temp_class.exp_for_level(n+1) > @exp[max_level]+extra
			end

 

Edited by Titanhex

Share this post


Link to post
Share on other sites

I'm not sure I'm understanding what you said...

 

so if I write

 

if class_id == 1

does this mean I just wrote in ruby to define the class ID to class 1?

I'm guessing

 

extra = 529492-@exp[max_level] #50

is supposed to set the new max level for class id 1?? But if so I'm not sure what the new max level is? I'm confused because I'm nto sure what @exp[max_level] is referring to, and I'm also not sure what 529492 means or where you got this number from.

 

what does else do?

Why can't I do

 

if class_id == 2

 

Or does if not work?

 I'm confused by what you meant by just before the first "end"

 

 

if class_id == 1 extra = 529492 - @exp[max_level] #50 else class_id == 2 extra = 131711 - @exp[max_level] #30 else class_id == 3 extra = 292951 - @exp[max_level] #40

 

This is what I see before the first "end"... I'm entirely not sure what all this means. I'm guessing it's changing class 1's max level to 50, class 2's max level to 30 and class 3's max level to 40 based on your #? Is that what you did there? And should I go by this format?

 

Where do I insert what you wrote into this script?

 

def class_level(class_id)
        return @level if YEA::CLASS_SYSTEM::MAINTAIN_LEVELS
            temp_class = $data_classes[class_id]
            @exp[class_id] = 0 if @exp[class_id].nil?
            #declare a max level (using EXP)
            #If you can’t find it, go to the class database and select exp curve
            #then switch view to total at the top
            @exp[max_level] = 2547133 #This is the value to change. It declares a max level
            #You need to calculate how much exp for max level
            #Do it manually if using Yanfly-Adjusting Limits
            #To calculate max level exp if using Yanfly-adjusting limits is all math!!

            # Level 99 = 2547133
            # to calculate past there…. have to add on multiples of 50744
            # Level 110 = 3156061
            # To go from 99 -> 110 have to add on 12 multiples of 50744.
            n = 1            
            loop do
                break if temp_class.exp_for_level(n+1) > @exp[class_id]
                n += 1
                #add a restriction to “kick out†of loop if exp exceeds max level exp
                break if temp_class.exp_for_level(n+1) > @exp[max_level]
            end
        return n
    end

 

sorry but I dont' know how to code in ANY language, so this is all very much like looking at gibberish and trying to figure out what said gibberish stands for.

 

 

EDIT:

 

I think I figured out WHERE you want me to put the script you wrote:

 

def class_level(class_id)
        return @level if YEA::CLASS_SYSTEM::MAINTAIN_LEVELS
            temp_class = $data_classes[class_id]
            @exp[class_id] = 0 if @exp[class_id].nil?
            #declare a max level (using EXP)
            #If you can’t find it, go to the class database and select exp curve
            #then switch view to total at the top
            @exp[max_level] = 2547133 #This is the value to change. It declares a max level
            #You need to calculate how much exp for max level
            #Do it manually if using Yanfly-Adjusting Limits
            #To calculate max level exp if using Yanfly-adjusting limits is all math!!

            # Level 99 = 2547133
            # to calculate past there…. have to add on multiples of 50744
            # Level 110 = 3156061
            # To go from 99 -> 110 have to add on 12 multiples of 50744.
if class_id == 1  extra = 529492 - @exp[max_level] #50 else class_id == 2  extra = 131711 - @exp[max_level] #30else class_id == 3  extra = 292951 - @exp[max_level] #40 end
            n = 1            
            loop do
                break if temp_class.exp_for_level(n+1) > @exp[class_id]
                n += 1
                #add a restriction to “kick out†of loop if exp exceeds max level exp
                break if temp_class.exp_for_level(n+1) > @exp[max_level]
            end
        return n
    end

Now all I need to know is what this section does:

 

if class_id == 1 extra = 529492 - @exp[max_level] #50 else class_id == 2 extra = 131711 - @exp[max_level] #30 else class_id == 3 extra = 292951 - @exp[max_level] #40 end

I need to know what the equation   extra = 529492 - @exp[max_level]  means and what it is solving for, so that I know what values to replace to give my classes in the game the correct level caps.

 

 

Edit 2: I do feel like we're getting close to the answer tho. Maybe your next response will help me figure it out. in the meantime I'll go look in the Database to try to understand how you got those numbers, then I'll go get food, and when I'm back I'll try to see if I can put what you wrote into the script and play test it.

 

Edit 3: I just found 529492 as the value of the total exp needed to get to level 50... IF I were to change a class's exp curve I should simply get the new total exp for the level cap, right? So I'm guessing that...

 

extra = 529492 - @exp[max_level]

 

is saying "Let 529492 be the new exp max level for class Id = 1... sooo  the minus sign isn't really a subtraction symbol... which is why I was confused

 

Edit 4: ok I'm going to put that into the script and do a play test right now, if it work I'll thank you and have the mod close this thread, if it doesn't then at least i can post that it doesn't so that you can look at it again.

 

Edit 5: I get an error that says it expects me to do end after

 

else class_id == 2 extra = 131711 - @exp[max_level] #30

classsystem8_zpsad342d7f.png

 

classsystem9_zpsad42f60e.png

Edited by haothehare

Share this post


Link to post
Share on other sites

Well it seems you understand what the number signifies now, which is good.

 

Anything after a # is a comment and is disregarded by the system. So #50 is just telling someone looking at the script what all that means.

 

if is a conditional branch starter.

 

It's just like saying if something is something then that means this.

 

If a dog is brown, then we call him chocolate.

 

If class_id (This is a variable, it is pointing to the class ID in the database) equals 1...

 

Then we do the stuff on the next line.

extra = 529492 - @exp[max_level] #50

"extra" is a variable as well.

 

It's important to note, in coding Ruby, that == is an evaluation and = is more a statement, like "set" as in "set something to this value."

 

So we're setting the variable extra to equal 529492 minus this variable. @ is an indicator of a special variable that only works inside a thing called a class.

 

EDIT: Adding that @exp[max_level] is the number of the default max level.  We're using it so you don't have to do manual math to figure out what the extra exp would have to be.

 

It gets pretty complex, really.

 

Else is part of the if conditional branch just like in eventing.

 

If something is something then this, else, that.

 

If class_id doesn't == 1 then we're checking to see if class_id == 2.

 

Finally, end says our if statement is ending.

 

If we were to do

 

If class_id == 2

 

we need to end it with an end.

 

So that's why we're not doing if two times. It would need another "end."

 

EDIT: To fix that problem, try replacing the "else"s in that code with "elsif".

Edited by Titanhex

Share this post


Link to post
Share on other sites

Ok I dodged a problem by looking it up... it really is "elsif" not "else if" ... I thought it was a typo.

 

so, basically I need to do that with a long long chain of elsif's for every class in the game? Will this slow down the game at all or is this a noob programming question?

 

I will try the elsif to see if it fixes the problem. If it does then i'll have successfully been able to fix my party issue, and the only problem that remains is the changing actor graphics and changing actor face problem (I think it's one problem not two separate problems because in the eventing commands the "change actor graphics" is supposed to change both the sprite and the face at the same time. Somehow I think Yanfly's script or scripts for the class system is preventing me from changing the appearance of the actor using common event commands.

 

Edit: I know this might seem like trying to pick a needle out of a haystack while blindfolded and not knowing what that needle even is... but is this the code in the script that is responsible for the problem of not being able to change the actor's appearance when class change occurs?

 

 

 #--------------------------------------------------------------------------
  # actor=
  #--------------------------------------------------------------------------
  def actor=(actor)
    return if @actor == actor
    @actor = actor
    refresh
  end
 
  #--------------------------------------------------------------------------
  # refresh
  #--------------------------------------------------------------------------
  def refresh
    contents.clear
    8.times {|i| draw_item(0, line_height * i, i) }
  end
 
  #--------------------------------------------------------------------------
  # set_temp_actor
  #--------------------------------------------------------------------------
  def set_temp_actor(temp_actor)
    return if @temp_actor == temp_actor
    @temp_actor = temp_actor
    refresh
  end
 
 
def refresh
    contents.clear
    return if @actor.nil?
    draw_actor_face(@actor, 0, 0)
    draw_actor_simple_status(@actor, 108, line_height / 2)
  end
 
 
 
 

 

 

 

EDIT: OK so I tested it with the elsif's and it didn't work... the problem of leveling up the class level beyond actor's max level persists. I tried setting Maintain_Level = true but when I did that then Yanfly's Class Unlock Level script stops working and I end up not being able to unlock the next class.

 

 

EDIT 3: I wanted this problem solved so badly that I decided to do something and experiment with Yanfly's original code. I copy pasted the entire thing, not the green # text... and then subtituted in the variables for both class 1 and class 2. This looks like this:

classsystem11_zpsb2db2f55.png

Then I went on and tried to test it such that if class 1 successfully caps at level 20... and stops leveling even after I reach level 20 commoner and still beat the crap outta the rat that I made that gives 21000 exp per pop, then I should proceed to verify that this problem is fixed by trying to level class 2 (which is thief) to level 20 and see if it also works... and magic happened:

classsystem10_zps91fd9b76.png

 

so now the only problem that remains is being able to change the image of the actors based on their class changes. I think it has something to do with Yanfly's script/s that is causing this issue.

 

 

 

EDIT: It seems Yanfly's adjust Limits does not allow for me to adjust the limits to the first variable in the EXP curve (I'm referring to the variables [30,20,30,30] since I'll need to change the first variable to 40899 + 30 = 40929 as the starting Exp for class 2 if I want to follow the normal EXP curve, but then I realized that maybe I can simply solve this issue by making the classes be relatively similar in stats and have level 20 truly be the level limit by making the game more reliant on strategy and tactics during battles rather than brute force stats... something I intended to begin with... so with this in mind I'll just make my enemies give less Exp to slow the growth to level 20, and make the higher tier classes only slightly stronger in parameters than the lower tier classes unlocks...

 

So yeah the only problem that remains is the change of actor image/sprite/face... I insist that this is the only problem left, lol cuz I'm tired of fixing problems relating to class and want to move on... and this image problem to me is actually something that I will not move on until it is solved because it is important to me that the actor looks like the class that he or she is after a class change.

Edited by haothehare

Share this post


Link to post
Share on other sites
Edit: Test result = failure... lol I tested it in parallel process but Common event Change Actor graphic was unable to run parallel process with Yanfly's Class System script such that the image would change when you change class. I think it would also be interesting to note that BOTH actor sprite and actor face remained unchanged.

here's my reply from post 7

 

EDIT: Ok I went back and realized that it required a Switch. So I made a switch that's called Always ON, and turned it on with an event at the start of the game. It now works... BUT the change in image only occurs AFTER I exit the change class and menus... so that only when I'm not in the menu mode the class image and sprite changes. How can I try to fix this? It's a small issue, but maybe there's a better way.

Edited by haothehare

Share this post


Link to post
Share on other sites

Well we know it sort-of works. If I knew how to call a common event via script I could tell you what to insert into Yanfly to make it work instantly. Unfortunately I don't know how to call common events via script.

Edited by Titanhex

Share this post


Link to post
Share on other sites

Hmmm, nevermind. I tested it and apparently Common Event calls in menus don't happen automatically.

 

Well I know where to insert the code you're looking for, but I'm afraid I don't know how to extend the system code in this case.

 

I'll give you the info you need and you can provide it in a Script Request forum thread, which should allow any scripter at even an intermediate level to fix the problem. Just give me some time to write the info out, compile it and do other things.

Share this post


Link to post
Share on other sites

This is the snippet that executes when you change your class to a new one:
 

  #--------------------------------------------------------------------------
  # on_class_ok
  #--------------------------------------------------------------------------
  def on_class_ok
    Sound.play_equip
    class_id = @item_window.item.id
    maintain = YEA::CLASS_SYSTEM::MAINTAIN_LEVELS
    hp = @actor.hp * 1.0 / @actor.mhp
    mp = @actor.mp * 1.0 / [@actor.mmp, 1].max
    case @command_window.current_symbol
    when :primary
      @actor.change_class(class_id, maintain)
    when :subclass
      @actor.change_subclass(class_id)
    else
      @item_window.activate
      return
    end
    $game_temp.reserve_common_event(10)
    @actor.hp = (@actor.mhp * hp).to_i
    @actor.mp = (@actor.mmp * mp).to_i
    @status_window.refresh
    @item_window.update_class
  end


Now in here you'll want someone to put a piece of script that will change your actor graphics.

$game_actors[@actor.id].set_graphic("facepath", index, "charpath", index)

My suggestion to make it easy use is do it with a note-tag.  So all you have to do is put the picture name and index number.  Like:

 

<faceset: "Actor 5", 3>

<charset: "Actor 5", 3>

 

or even just

 

<graphic: "Actor 5", 3, "Actor 5", 3>

 

As long as the person knows how to use notetags and whatnot, they should be able to do this for you.  I've tested it as far as I could and it should work perfectly. I only ask that you supply this on Yanfly's blog so other people may use it.

Share this post


Link to post
Share on other sites

Okay, I think I've found something here that could help.

 

This requires you to do a complete overhaul, and can take several hours of your time. It might also break a lot of stuff, and has the potential of overheating your PC.

 

HAHAHAHAHAHAHAHA, just kidding. It only takes five minutes.

 

First, at the module YEA::CLASS_SYSTEM, add somewhere something like:

 

DEFAULT_MAX_LEV

 

I always use DEFAULT as a prefix, as I often like to add the ability to never mind, I'll just carry on.

 

So, put a constant somewhere in that module. Let's just say our code looks like this now:

module YEA
  module CLASS_SYSTEM
    
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    # - General Class Settings -
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    # These are the general settings regarding the whole script. They control
    # various rules and regulations that this script undergoes. These settings
    # will also determine what a subclass can do for a player.
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    CLASS_MENU_TEXT = "Class"  # Text that appears in the Main Menu.
    MAINTAIN_LEVELS = false    # Maintain through all classes. Default: false.
    DEFAULT_UNLOCKS = [ 1, 11, 21, 31]   # Classes unlocked by default.
    DEFAULT_MAX_LEV = 20       # Default max. class level.

Now, you have two options. One is the backwards method, one is the very easy method which might have the possibility of breaking stuff, but I don't know.

 

First, the backwards method. We know that there is a method in the RPG::Class module that allows you to see the minimum required experience on a certain level. So, let's just exploit that. Let's search for this line:

 

			@exp[max_level] = 2547133 #This is the value to change. It declares a max level

Ugh, tabs...

 

And replace it with this line:

 

 

			@exp[max_level] = temp_class.exp_for_level(YEA::CLASS_SYSTEM::DEFAULT_MAX_LEV) #This is the value to change. It declares a max level

Now what it does is it tries to take the minimum experience required and uses it as the maximum experience that can be obtained here.

 

Yeah, that didn't sound all too clever.

 

So, instead of that, let's just take a look at the loop. Let's just add a new line there:

 

 

			loop do
				break if temp_class.exp_for_level(n+1) > @exp[class_id]
				n += 1
				#add a restriction to “kick out†of loop if exp exceeds max level exp
				break if n >= YEA::CLASS_SYSTEM::DEFAULT_MAX_LEV
				break if temp_class.exp_for_level(n+1) > @exp[max_level]
			end

As you can see, it always returns n, which is the level where the required experience exceeds that of the maximum.

 

EDIT: I might try and make an addon for it, if you people would like that.

 

EDIT2:

 

Aaaaaand done.

 

It's not documented yet, but here's the short version.

<max level: x>

Either that or you could just change the base settings.

 

CXJ::CLASS_LEVEL_LIMITER::STOP_GAINING_EXP_AFTER_MAX means the class stops getting experience after the maximum has been reached. This also means that the character's level stops increasing. I'm honestly not sure if that's a good thing.

 

CXJ::CLASS_LEVEL_LIMITER::STOP_LEVELING_AFTER_CLASS_MAX means the character stops leveling after the experience cap has been reached, but the class will still gain experience. Might be good, might be bad. This gets skipped if the previous is true.

 

Otherwise it just uses the normal method. Main character keeps leveling, but due to a small change I made the level of the class stops increasing.

 

This does assume that YEA::CLASS_SYSTEM::MAINTAIN_LEVELS is set to false. I haven't tried it with true, but I guess it wouldn't get any desireable effects.

 

 

#==============================================================================
# 
# GaryCXJk - Class Level Limiter v1.00
# * Last Updated: 2012.12.31
# * Level: Normal
# * Requires: Yanfly Engine Ace - Class System v1.10+
# 
#==============================================================================
#
# The code below defines the settings of this script, and are there to be
# modified.
#
#==============================================================================

$imported = {} if $imported.nil?
$imported["CXJ-ClassLevelLimiter"] = true

module CXJ
  module CLASS_LEVEL_LIMITER
    #------------------------------------------------------------------------
    # The default maximum level
    #------------------------------------------------------------------------
    DEFAULT_MAX_LEV = 3
    STOP_GAINING_EXP_AFTER_MAX = true
    STOP_LEVELING_AFTER_CLASS_MAX = true
  end
end

#==============================================================================
#
# The code below should not be altered unless you know what you're doing.
#
#==============================================================================

if $imported["YEA-ClassSystem"]
  module CXJ
    module REGEXP
      module CLASS
        
        MAX_LEVEL = /<(?:MAX_LEVEL|max level):[ ](\d+)>/i
        
      end # CLASS
    end
  end

  #============================================================================
  # ** DataManager
  #----------------------------------------------------------------------------
  #  This module manages the database and game objects. Almost all of the 
  # global variables used by the game are initialized by this module.
  #============================================================================

  module DataManager
    
    #------------------------------------------------------------------------
    # alias method: load_database
    #------------------------------------------------------------------------
    class <<self; alias load_database_cxj_ll load_database; end
    def self.load_database
      load_database_cxj_ll
      load_notetags_cxj_ll
    end
    
    #------------------------------------------------------------------------
    # new method: load_notetags_cul
    #------------------------------------------------------------------------
    def self.load_notetags_cxj_ll
      for obj in $data_classes
        next if obj.nil?
        obj.load_notetags_cxj_ll
      end
    end
  end

  #============================================================================
  # ** RPG::Class
  #============================================================================

  class RPG::Class < RPG::BaseItem
    
    #------------------------------------------------------------------------
    # common cache: load_notetags_cxj_ll
    #------------------------------------------------------------------------
    def load_notetags_cxj_ll
      @max_level = -1
      self.note.split(/[\r\n]+/).each { |line|
        case line
        when CXJ::REGEXP::CLASS::MAX_LEVEL
          @max_level = $1
        end
      }
    end
    
    def max_level
      @max_level
    end
  end

  #============================================================================
  # ** Game_Actor
  #----------------------------------------------------------------------------
  #  This class handles actors. It is used within the Game_Actors class
  # ($game_actors) and is also referenced from the Game_Party class ($game_party).
  #============================================================================

  class Game_Actor < Game_Battler
    #------------------------------------------------------------------------
    # * Alias: Change Experience
    #     show : Level up display flag
    #------------------------------------------------------------------------
    alias game_actor_change_exp_cxj_ll change_exp
    def change_exp(exp, show)
      maxLevel = CXJ::CLASS_LEVEL_LIMITER::DEFAULT_MAX_LEV
      maxLevel = self.class.max_level if self.class.max_level > -1
      maxExp = self.class.exp_for_level(maxLevel)
      if CXJ::CLASS_LEVEL_LIMITER::STOP_GAINING_EXP_AFTER_MAX
        game_actor_change_exp_cxj_ll([exp, maxExp].min, show)
      elsif CXJ::CLASS_LEVEL_LIMITER::STOP_LEVELING_AFTER_CLASS_MAX
        @exp[@class_id] = [exp, 0].max
        last_level = @level
        last_skills = skills
        level_up while !max_level? && self.exp >= next_level_exp && self.exp <= maxExp
        level_down while self.exp < current_level_exp
        display_level_up(skills - last_skills) if show && @level > last_level
        refresh
      else
        game_actor_change_exp_cxj_ll(exp, show)
      end
    end
    #————————————————————————–
    # new method: class_level Edited by DisturbedInside
    #————————————————————————–
    def class_level(class_id)
      return @level if YEA::CLASS_SYSTEM::MAINTAIN_LEVELS
      maxLevel = CXJ::CLASS_LEVEL_LIMITER::DEFAULT_MAX_LEV
      maxLevel = self.class.max_level if self.class.max_level > -1
      maxExp = self.class.exp_for_level(maxLevel)
      @exp[class_id] = 0 if @exp[class_id].nil?
      n = 1
      loop do
        break if maxExp <= temp_class.exp_for_level(n)
        break if @exp[class_id] < temp_class.exp_for_level(n)
        n+= 1
      end
      return n
    end
  end
end

 

Edited by GaryCXJk

Share this post


Link to post
Share on other sites

Well, how about this:

 

 

#==============================================================================
# 
# GaryCXJk - Class Extensions v1.01
# * Last Updated: 2012.12.31
# * Level: Normal
# * Requires: Yanfly Engine Ace - Class System v1.10+
# 

#==============================================================================
#
# Changelog:
#
#------------------------------------------------------------------------------
# 2012.12.31 - v1.01
#
# * Added: Ability to hide classes that are unavailable for primary or subclass
#          (requires Class Specifics)
# * Fixed: Some errors
#
#------------------------------------------------------------------------------
# 2012.12.31 - v1.00
#
# * Initial release
#
#==============================================================================
#
# Yanfly's Class System is a very solid script, but it is missing a few small
# things. This scripts adds just the little things it is missing.
#
#==============================================================================
#
# Installation:
#
# Make sure to put this below Materials, but above Main Process.
#
# This script adds aliases for several methods. If you are sure no method that
# is used by other scripts get overridden, you can place it anywhere,
# otherwise, make sure this script is loaded after any other script overriding
# these methods, otherwise this script stops working.
#
# This is an addon for a mod. Make sure you put this script after the original
# script it is made for.
#
#------------------------------------------------------------------------------
# Aliased methods:
#
# * module DataManager
#   - load_database
# * class Game_Actor
#   - change_exp(exp, show)
#   - class_level(class_id) (from Class System)
#
#==============================================================================
#
# Usage:
#
# There are various functionalities in this script. You can enable and disable
# them by specifying it in the script. I'll go through them one at a time.
#
#------------------------------------------------------------------------------
# Class Level Limiter:
#
# This allows you to limit the class level cap. This means that classes will
# never go over the level cap you specified. You can also specify a limit
# for a specific class using notetags.
#
# <max level: x>
#
#------------------------------------------------------------------------------
# Class Graphics
#
# If you want classes to have generic appearances, or if you want an actor to
# have a specific graphics set when using a certain class.
#
# You can set a generic class graphics set, which is a set of data which
# specifies the default class graphic. You can specify multiple sets here. It
# defaults to the "DEFAULT" set, but you can use a notetag on the actor to
# specify a specific graphics set.
#
# <generic set: x>
#
# Where x is the string defining the graphics set.
#
# By default, you can set all classes to either opt in or opt out. What this
# means is that you can specify if actor uses the generic set or not, depending
# on the settings. If an actor opts in, it means that it will use the generic
# set, otherwise it doesn't. You can set the default settings in the script,
# but using notetags you can also specify it per actor.
#
# <graphics opt in>
# <graphics opt out>
#
# You can also set a class specific graphic for the actor itself.
#
# <character set: x, y, z>
# <face set: x, y, z>
#
# x: the class id.
# y: the character / face image.
# z: the index.
#
# Finally, on the classes themselves you can specify a default graphic.
# Depending on the script settings, these will have priority over the default
# settings.
#
# <character set: x, y>
# <face set: x, y>
#
# x: the character / face image.
# y: the index.
#
#==============================================================================
#
# License:
#
# Creative Commons Attribution 3.0 Unported
#
# The complete license can be read here:
# http://creativecommons.org/licenses/by/3.0/legalcode
#
# The license as it is described below can be read here:
# http://creativecommons.org/licenses/by/3.0/deed
#
# You are free:
#
# to Share — to copy, distribute and transmit the work
# to Remix — to adapt the work
# to make commercial use of the work
#
# Under the following conditions:
#
# Attribution — You must attribute the work in the manner specified by the
# author or licensor (but not in any way that suggests that they endorse you or
# your use of the work).
#
# With the understanding that:
#
# Waiver — Any of the above conditions can be waived if you get permission from
# the copyright holder.
#
# Public Domain — Where the work or any of its elements is in the public domain
# under applicable law, that status is in no way affected by the license.
#
# Other Rights — In no way are any of the following rights affected by the
# license:
#
# * Your fair dealing or fair use rights, or other applicable copyright
#   exceptions and limitations;
# * The author's moral rights;
# * Rights other persons may have either in the work itself or in how the work
#   is used, such as publicity or privacy rights.
#
# Notice — For any reuse or distribution, you must make clear to others the
# license terms of this work. The best way to do this is with a link to this
# web page.
#
#------------------------------------------------------------------------------
# Extra notes:
#
# Despite what the license tells you, I will not hunt down anybody who doesn't
# follow the license in regards to giving credits. However, as it is common
# courtesy to actually do give credits, it is recommended that you do.
#
# As I picked this license, you are free to share this script through any
# means, which includes hosting it on your own website, selling it on eBay and
# hang it in the bathroom as toilet paper. Well, not selling it on eBay, that's
# a dick move, but you are still free to redistribute the work.
#
# Yes, this license means that you can use it for both non-commercial as well
# as commercial software.
#
# You are free to pick the following names when you give credit:
#
# * GaryCXJk
# * Gary A.M. Kertopermono
# * G.A.M. Kertopermono
# * GARYCXJK
#
# Personally, when used in commercial games, I prefer you would use the second
# option. Not only will it actually give me more name recognition in real
# life, which also works well for my portfolio, it will also look more
# professional. Also, do note that I actually care about capitalization if you
# decide to use my username, meaning, capital C, capital X, capital J, lower
# case k. Yes, it might seem stupid, but it's one thing I absolutely care
# about.
#
# Finally, if you want my endorsement for your product, if it's good enough
# and I have the game in my posession, I might endorse it. Do note that if you
# give me the game for free, it will not affect my opinion of the game. It
# would be nice, but if I really did care for the game I'd actually purchase
# it. Remember, the best way to get any satisfaction is if you get people to
# purchase the game, so in a way, I prefer it if you don't actually give me
# a free copy.
#
# This script was originally hosted on:
# http://area91.multiverseworks.com
#
# Don't forget to include the credits of the original script as well.
#
#==============================================================================
#
# The code below defines the settings of this script, and are there to be
# modified.
#
#==============================================================================

$imported = {} if $imported.nil?
$imported["CXJ-ClassExtensions"] = true

module CXJ
  module CLASS_EXTENSIONS
    #------------------------------------------------------------------------
    # Class Level Limiter
    #------------------------------------------------------------------------
    ENABLE_CLASS_LEVEL_LIMITER = true       # Defines if you want to limit
                                            # class levels
    DEFAULT_MAX_LEV = 99                    # Defines the max level
    STOP_GAINING_EXP_AFTER_MAX = true       # Stops experience gain after
                                            # hitting the level cap
    STOP_LEVELING_AFTER_CLASS_MAX = true    # Stops leveling main character
                                            # after hitting the experience
                                            # cap.
    
    #------------------------------------------------------------------------
    # Generic Class Graphics
    #------------------------------------------------------------------------
    # When you set these, all characters will use this list as their initial
    # graphics. You can pick between an opt-in or opt-out. When you pick
    # opt-in, characters won't use these generic class graphics unless they
    # chose to, otherwise they will always use these generic class graphics
    # unless either the character has set their custom graphics or they opt
    # out.
    #
    # Also, notetags specified in the database have priority over this list,
    # meaning that any class that has a custom class graphic set in the
    # notetags will have that as the generic class graphic. You can however
    # change it below to have generic class graphics have priority instead.
    #
    # Finally, when the graphics for a certain class isn't set here, it will
    # always default to the default character graphics.
    #------------------------------------------------------------------------
    
    ENABLE_CLASS_SPECIFIC_GRAPHICS = true   # Defines whether to use class
                                            # specific graphics.
    OPT_IN_CLASS_GRAPHICS = false           # Defines if you want to opt in.
    CLASS_SPECIFIED_HAS_PRIORITY = true     # Graphics defined in class
                                            # notetags have priority.
    
    GENERIC_CLASS_GRAPHICS = {}
    GENERIC_CLASS_GRAPHICS["DEFAULT"] = {
    # ClassID => [  CharacterName,  CharacterIndex, FaceName,   FaceIndex ],
      1       => [  "Actor1",       1,              "Actor1",   1 ],
    }
    
    #------------------------------------------------------------------------
    # Miscellaneous
    #------------------------------------------------------------------------
    CLASS_HIDE_MODE = 2       # Set the class hiding mode for the class list
                              # window. Requires the Class Specifics addon.
                              # 0: Original
                              # 1: Hide unavailable
                              # 2: Grey out selected in other type
  end
end

#==============================================================================
#
# The code below should not be altered unless you know what you're doing.
#
#==============================================================================

if $imported["YEA-ClassSystem"]
  module CXJ
    module REGEXP
      module CLASS
        
        MAX_LEVEL = /<(?:MAX_LEVEL|max level):\s*(\d+)>/i
        CHARSET   = /<(?:CHARACTER_SET|CHARSET|character set|charset):\s*(.+?)\s*,\s*(\d+)>/i
        FACESET   = /<(?:FACE_SET|FACESET|face set|faceset):\s*(.+?)\s*,\s*(\d+)>/i
        
      end
      module ACTOR
        
        OPT_IN    = /<(?:GRAPHICS_OPT_IN|graphics opt) (in|out)>/i
        GENERICSET = /<(?:GENERIC_SET|generic set):\s*(.+?)>/i
        CHARSET   = /<(?:CHARACTER_SET|CHARSET|character set|charset):\s*(\d+)\s*,\s*(.+?)\s*,\s*(\d+)>/i
        FACESET   = /<(?:FACE_SET|FACESET|face set|faceset):\s*(\d+)\s*,\s*(.+?)\s*,\s*(\d+)>/i
        
      end
    end
  end

  #============================================================================
  # ** DataManager
  #----------------------------------------------------------------------------
  #  This module manages the database and game objects. Almost all of the 
  # global variables used by the game are initialized by this module.
  #============================================================================

  module DataManager
    
    #------------------------------------------------------------------------
    # Alias: load_database
    #------------------------------------------------------------------------
    class <<self; alias load_database_cxj_ce load_database; end
    def self.load_database
      load_database_cxj_ce
      load_notetags_cxj_ce
    end
    
    #------------------------------------------------------------------------
    # New: load_notetags_cul
    #------------------------------------------------------------------------
    def self.load_notetags_cxj_ce
      groups = [$data_classes, $data_actors]
      for group in groups
        for obj in group
          next if obj.nil?
          obj.load_notetags_cxj_ce
        end
      end
    end
  end

  #============================================================================
  # ** RPG::Class
  #============================================================================

  class RPG::Class < RPG::BaseItem

    attr_accessor :max_level
    attr_accessor :character_name
    attr_accessor :character_index
    attr_accessor :face_name
    attr_accessor :face_index
    
    #------------------------------------------------------------------------
    # common cache: load_notetags_cxj_ll
    #------------------------------------------------------------------------
    def load_notetags_cxj_ce
      @max_level = -1
      @character_name = ''
      @character_index = 0
      @face_name = ''
      @face_index = 0
      self.note.split(/[\r\n]+/).each { |line|
        case line
        when CXJ::REGEXP::CLASS::MAX_LEVEL
          @max_level = $1
        when CXJ::REGEXP::CLASS::CHARSET
          @character_name = $1
          @character_index = $2
        when CXJ::REGEXP::CLASS::FACESET
          @face_name = $1
          @face_index = $2
        end
      }
    end
  end
  
  #============================================================================
  # ** RPG::Actor
  #============================================================================

  class RPG::Actor < RPG::BaseItem
    
    attr_accessor :class_graphics
    attr_accessor :graphics_opt_in
    attr_accessor :generic_set
    
    #------------------------------------------------------------------------
    # common cache: load_notetags_cxj_ll
    #------------------------------------------------------------------------
    def load_notetags_cxj_ce
      @class_graphics = {}
      @graphics_opt_in = !CXJ::CLASS_EXTENSIONS::OPT_IN_CLASS_GRAPHICS
      @generic_set = "DEFAULT"
      self.note.split(/[\r\n]+/).each { |line|
        case line
        when CXJ::REGEXP::ACTOR::OPT_IN
          @graphics_opt_in = false
          @graphics_opt_in = true if $1.downcase == "in"
        when CXJ::REGEXP::ACTOR::GENERICSET
          @generic_set = $1 if !CXJ::CLASS_EXTENSIONS::GENERIC_CLASS_GRAPHICS[$i].nil?
        when CXJ::REGEXP::ACTOR::CHARSET
          @class_graphics[$1] = {} if @class_graphics[$1].nil?
          @class_graphics[$1][:character_name] = $2
          @class_graphics[$1][:character_index] = $3
        when CXJ::REGEXP::ACTOR::FACESET
          @class_graphics[$1] = {} if @class_graphics[$1].nil?
          @class_graphics[$1][:face_name] = $2
          @class_graphics[$1][:face_index] = $3
        end
      }
    end
  end

  #============================================================================
  # ** Game_Actor
  #----------------------------------------------------------------------------
  #  This class handles actors. It is used within the Game_Actors class
  # ($game_actors) and is also referenced from the Game_Party class ($game_party).
  #============================================================================

  class Game_Actor < Game_Battler
    #------------------------------------------------------------------------
    # New: graphics_opt_in
    #------------------------------------------------------------------------
    def graphics_opt_in
      actor.graphics_opt_in
    end
    #------------------------------------------------------------------------
    # New: class_graphics
    #------------------------------------------------------------------------
    def class_graphics
      actor.class_graphics
    end
    #------------------------------------------------------------------------
    # New: generic_class_graphics
    #------------------------------------------------------------------------
    def generic_class_graphics
      CXJ::CLASS_EXTENSIONS::GENERIC_CLASS_GRAPHICS[@generic_set]
    end
    #------------------------------------------------------------------------
    # New: default_generic_class_graphics
    #------------------------------------------------------------------------
    def generic_class_graphics
      CXJ::CLASS_EXTENSIONS::GENERIC_CLASS_GRAPHICS["DEFAULT"]
    end
    #------------------------------------------------------------------------
    # New: character_name
    #------------------------------------------------------------------------
    def character_name
      if CXJ::CLASS_EXTENSIONS::ENABLE_CLASS_SPECIFIC_GRAPHICS
        if !actor.class_graphics[@class_id].nil?
          return class_graphics[@class_id][:character_name] if !class_graphics[@class_id][:character_name].nil?
        end
        if graphics_opt_in
          return self.class.character_name if !self.class.character_name.empty? && CXJ::CLASS_EXTENSIONS::CLASS_SPECIFIED_HAS_PRIORITY
          return generic_class_graphics[@class_id][0] if !generic_class_graphics[@class_id].nil? && !generic_class_graphics[@class_id][0].empty?
          return default_generic_class_graphics[0] if !default_generic_class_graphics.nil? && !default_generic_class_graphics[0].empty?
          return self.class.character_name if !self.class.character_name.empty?
        end
      end
      @character_name
    end
    #------------------------------------------------------------------------
    # New: character_index
    #------------------------------------------------------------------------
    def character_index
      if CXJ::CLASS_EXTENSIONS::ENABLE_CLASS_SPECIFIC_GRAPHICS
        if !actor.class_graphics[@class_id].nil?
          return class_graphics[@class_id][:character_index] if !class_graphics[@class_id][:character_index].nil?
        end
        if graphics_opt_in
          return self.class.character_index if !self.class.character_name.empty? && CXJ::CLASS_EXTENSIONS::CLASS_SPECIFIED_HAS_PRIORITY
          return generic_class_graphics[@class_id][1] if !generic_class_graphics[@class_id].nil? && !generic_class_graphics[@class_id][0].empty?
          return default_generic_class_graphics[1] if !default_generic_class_graphics.nil? && !default_generic_class_graphics[0].empty?
          return self.class.character_index if !self.class.character_name.empty?
        end
      end
      @character_index
    end
    #------------------------------------------------------------------------
    # New: face_name
    #------------------------------------------------------------------------
    def face_name
      if CXJ::CLASS_EXTENSIONS::ENABLE_CLASS_SPECIFIC_GRAPHICS
        if !actor.class_graphics[@class_id].nil? && CXJ::CLASS_EXTENSIONS::CLASS_SPECIFIED_HAS_PRIORITY
          return class_graphics[@class_id][:face_name] if !class_graphics[@class_id][:face_name].nil?
        end
        if graphics_opt_in
          return self.class.face_name if !self.class.face_name.empty? && CXJ::CLASS_EXTENSIONS::CLASS_SPECIFIED_HAS_PRIORITY
          return generic_class_graphics[@class_id][2] if !generic_class_graphics[@class_id].nil? && !generic_class_graphics[@class_id][2].empty?
          return default_generic_class_graphics[2] if !default_generic_class_graphics.nil? && !default_generic_class_graphics[2].empty?
          return self.class.face_name if !self.class.face_name.empty?
        end
      end
      @face_name
    end
    #------------------------------------------------------------------------
    # New: face_index
    #------------------------------------------------------------------------
    def face_index
      if CXJ::CLASS_EXTENSIONS::ENABLE_CLASS_SPECIFIC_GRAPHICS
        if !actor.class_graphics[@class_id].nil?
          return class_graphics[@class_id][:face_index] if !class_graphics[@class_id][:face_index].nil?
        end
        if graphics_opt_in
          return self.class.face_index if !self.class.face_name.empty?
          return generic_class_graphics[@class_id][3] if !generic_class_graphics[@class_id].nil? && !generic_class_graphics[@class_id][2].empty?
          return default_generic_class_graphics[3] if !default_generic_class_graphics.nil? && !default_generic_class_graphics[2].empty?
          return self.class.face_index if !self.class.face_name.empty?
        end
      end
      @face_index
    end
    #------------------------------------------------------------------------
    # * Alias: Change Experience
    #     show : Level up display flag
    #------------------------------------------------------------------------
    alias game_actor_change_exp_cxj_ce change_exp
    def change_exp(exp, show)
      maxLevel = CXJ::CLASS_EXTENSIONS::DEFAULT_MAX_LEV
      maxLevel = self.class.max_level if self.class.max_level > -1
      maxExp = self.class.exp_for_level(maxLevel)
      if !CXJ::CLASS_EXTENSIONS::ENABLE_CLASS_LEVEL_LIMITER
        game_actor_change_exp_cxj_ce(exp, show)
      elsif CXJ::CLASS_EXTENSIONS::STOP_GAINING_EXP_AFTER_MAX
        game_actor_change_exp_cxj_ce([exp, maxExp].min, show)
      elsif CXJ::CLASS_EXTENSIONS::STOP_LEVELING_AFTER_CLASS_MAX
        @exp[@class_id] = [exp, 0].max
        last_level = @level
        last_skills = skills
        level_up while !max_level? && self.exp >= next_level_exp && self.exp <= maxExp
        level_down while self.exp < current_level_exp
        display_level_up(skills - last_skills) if show && @level > last_level
        refresh
      else
        game_actor_change_exp_cxj_ce(exp, show)
      end
    end
    #------------------------------------------------------------------------
    # Override: New: class_level Edited by DisturbedInside
    #------------------------------------------------------------------------
    def class_level(class_id)
      return @level if YEA::CLASS_SYSTEM::MAINTAIN_LEVELS
      maxLevel = CXJ::CLASS_EXTENSIONS::DEFAULT_MAX_LEV
      maxLevel = self.class.max_level if self.class.max_level > -1
      maxLevel = max_level if CXJ::CLASS_EXTENSIONS::ENABLE_CLASS_LEVEL_LIMITER
      maxExp = self.class.exp_for_level(maxLevel)
      @exp[class_id] = 0 if @exp[class_id].nil?
      n = 1
      loop do
        break if maxExp <= self.class.exp_for_level(n)
        break if @exp[class_id] < self.class.exp_for_level(n)
        n+= 1
      end
      return n
    end
  end
  
  if $imported["YEA-ClassSpecifics"]
    #==========================================================================
    # ** Window_ClassList
    #--------------------------------------------------------------------------
    #  This class handles the class list window
    #==========================================================================

    class Window_ClassList < Window_Selectable
      
      #----------------------------------------------------------------------
      # Override: make_item_list
      #----------------------------------------------------------------------
      def make_item_list
        @data = []
        for class_id in YEA::CLASS_SYSTEM::CLASS_ORDER
          next if $data_classes[class_id].nil?
          item = $data_classes[class_id]
          next if CXJ::CLASS_EXTENSIONS::CLASS_HIDE_MODE == 1 && available?(item)
          @data.push(item) if include?(item)
        end
      end
      
      #----------------------------------------------------------------------
      # New: Check if available
      #----------------------------------------------------------------------
      def available?(item)
        case @command_window.current_symbol
        when :primary
          return false if item.subclass_only
        when :subclass
          return false if item.primary_only
          return @actor.subclass_to?(item.id) if item.subclass_to != []
        end
        return true
      end
      
      #----------------------------------------------------------------------
      # Alias: set_item_colour
      #----------------------------------------------------------------------
      alias window_classlist_set_item_color set_item_colour
      def set_item_colour(item)
        if CXJ::CLASS_EXTENSIONS::CLASS_HIDE_MODE == 2
          primary_enable = (@command_window.current_symbol == :primary ? item == @actor.class : enable?(item))
          subclass_enable = (@command_window.current_symbol == :subclass ? item == @actor.subclass : enable?(item))
          if item == @actor.class
            change_color(text_color(YEA::CLASS_SYSTEM::CURRENT_CLASS_COLOUR), primary_enable)
          elsif item == @actor.subclass
            change_color(text_color(YEA::CLASS_SYSTEM::SUBCLASS_COLOUR), subclass_enable)
          else
            change_color(normal_color, enable?(item))
          end
        else
          window_classlist_set_item_color(item)
        end
      end
    end
  end
end

 

 

I might be releasing it later on this forum if you people don't mind, and perhaps on the official one as well.

Edited by GaryCXJk

Share this post


Link to post
Share on other sites

Wow, you really went all out with this. Stunning work.

 

It's a brilliant and highly suggested add-on to Yanfly's class system for sure. I hope you do distribute it throughout the RM community and Yanfly's channel :3

Share this post


Link to post
Share on other sites

I actually made a few errors in the original script, so I updated it. Also a new feature added as a bonus :P

 

Yeah, flip this stool, it still wasn't good enough, so I put a working version in the complete scripts section.

Edited by GaryCXJk

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.

  • Recently Browsing   0 members

    No registered users viewing this page.

×