level for class

nio kasgami

VampCat
Veteran
Joined
May 21, 2013
Messages
8,945
Reaction score
3,029
First Language
French
Primarily Uses
RMMV
guys I wanted to know because I wanted to code for my game a new type of system

instead the characters have a "level" 

I wanted to have her class with level

if I explain

example you have the class "goddess" who are level 4 so it will be mark level 4

but the other class "warrior" is level 2 

(and obviously you can change it but that's not the thing I want to know I already know how to change a class)

and obviously they not have level for the player only class level!

so after I want to make a way class not evolve in level unless you spend "Gp" (god point) who are obviously just the exp

it is possible to do that or no the coding is to much hard coded for that?

thanks for your further answer :)
 
Last edited by a moderator:

Iavra

Veteran
Veteran
Joined
Apr 9, 2015
Messages
1,797
Reaction score
862
First Language
German
Primarily Uses
For an easy solution, couldn't you just create every char multiple times, once for each class?

/edit: Otherwise you would extend the Game_Actor class with a new Hash, that says something like:

@class_levels = {    1 => 10,    2 => 5}where you use the class ids as keys and the levels as values.

Upon changing the class you would then change the player level according to the stored values and write back the current level to the corresponding class.

For the leveling up part, you would have to further modify the code to not automatically gain levels with enough Exp or track "Gp" as its own variable inside the actor.

I'm at work and don't have RM access, so i can't work out something concrete ^^
 
Last edited by a moderator:

nio kasgami

VampCat
Veteran
Joined
May 21, 2013
Messages
8,945
Reaction score
3,029
First Language
French
Primarily Uses
RMMV
Nan "the easy solution" is like abandonning the challenge this how we improve in everything if we not force ourself to continue even this hard we will not improve at all so yes I choose the hard road but at least I will improve 

(sorry haha that's my artist spirit who speak now xD)
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
2,602
Reaction score
1,932
First Language
English
Primarily Uses
RMMV
As an addendum to lavra's explanation, by default actors store their exp for different classes separately anyway, so they technically already have "class levels" but don't display them. It's not that hard to create a window showing the different classes an actor has and what level they're at, it just requires some inventive use of the @exp variable.
 

nio kasgami

VampCat
Veteran
Joined
May 21, 2013
Messages
8,945
Reaction score
3,029
First Language
French
Primarily Uses
RMMV
so in simple I can create a dummy level splitted by the class id?

I currently noticed the way of stopping a level of autoleveling is simply by removing the loop method in the game actor if I remember (I don't have ace in front of me)

so in simple I just have to dipllucate the Level methods into the class method in simple?

For an easy solution, couldn't you just create every char multiple times, once for each class?

/edit: Otherwise you would extend the Game_Actor class with a new Hash, that says something like:



Code:
@class_levels = {    1 => 10,    2 => 5}
where you use the class ids as keys and the levels as values.

Upon changing the class you would then change the player level according to the stored values and write back the current level to the corresponding class.

For the leveling up part, you would have to further modify the code to not automatically gain levels with enough Exp or track "Gp" as its own variable inside the actor.

I'm at work and don't have RM access, so i can't work out something concrete ^^
Oh now this make more senses yeah this seem a legit way to do that but after the problem is ...these level rest really static no?
 
Last edited by a moderator:

Iavra

Veteran
Veteran
Joined
Apr 9, 2015
Messages
1,797
Reaction score
862
First Language
German
Primarily Uses
Hmm, i only quickly took a look at the code, but going by these methods:

def change_class(class_id, keep_exp = false)    @exp[class_id] = exp if keep_exp    @class_id = class_id    change_exp(@exp[@class_id] || 0, false)    refresh  end
Code:
def change_exp(exp, show)    @exp[@class_id] = [exp, 0].max    last_level = @level    last_skills = skills    level_up while !max_level? && self.exp >= next_level_exp    level_down while self.exp < current_level_exp    display_level_up(skills - last_skills) if show && @level > last_level    refresh  end
it seems like after a class change, the actor's level actually gets adjusted up or down.

Also, he keeps once learned skills, since level_down only reduces the level attribute by 1.

/edit: Also, the Game_Interpreter method that corresponds to the "change class" event doesn't pass a value for keep_exp, so it should default to false:

Code:
#--------------------------------------------------------------------------  # * Change Class  #--------------------------------------------------------------------------  def command_321    actor = $game_actors[@params[0]]    actor.change_class(@params[1]) if actor && $data_classes[@params[1]]  end
 
Last edited by a moderator:

nio kasgami

VampCat
Veteran
Joined
May 21, 2013
Messages
8,945
Reaction score
3,029
First Language
French
Primarily Uses
RMMV
yeah it seem legit so in simple I could just make the level get changed..the question how to save the separate level because it have to retain class have different level

and for the fact stopping auto-leveling I discover how to stop doing that haha
 

Iavra

Veteran
Veteran
Joined
Apr 9, 2015
Messages
1,797
Reaction score
862
First Language
German
Primarily Uses
According to the code i posted, your level should change automatically, once you change classes. To prevent automatic level ups you would need to change the method gain_exp:

def gain_exp(exp)    change_exp(self.exp + (exp * final_exp_rate).to_i, true)end
You don't want to touch the underlying change_exp method, because it is responsible for keeping your class levels apart. The easiest way would be to take the exp gained as calculated in the method above and store it in a different variable. Then, upon spending exp to level up, you would call change_exp.

So, basically, you delay the original gain_exp method.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

10/24 done :3 Maybe I can finish 11 and 12 this weekend^^
Been updating my game's control scheme to optionally use a mouse. Now the player pixel moves towards the mouse destination, which looks super sweet with the sparkles. Also turns out I made a Mouse Common Event plugin at some point... Thanks past me. :LZSexcite: Now the mouse wheel cycles different forms, and the right mouse button activates that form's special. :LZScool:
Oh man the controls in Mario Sunshine are pretty awful and I haven't even witnessed the controls without FLUDD

Forum statistics

Threads
102,957
Messages
996,257
Members
134,420
Latest member
MxMachine
Top