Special Skills based on classes

Keikuina

Villager
Member
Joined
Feb 21, 2013
Messages
19
Reaction score
0
First Language
English
Primarily Uses
Hi, I have a multi-classing system in my project. I'm using Yanfly's Class System for it. Since the Main Class can inherit the Subclass' skills, I'm trying to make it so it creates a new skill for the character if they have two specific skills. They would create a new skill usable only by the combination of those two classes.

Example:

Main Class: Knight, with Slice skill

Subclass: Magician, with Fire skill

Result: Skill added is Flame Slash

So if anyone has a solution for that, that'd be great.

I was thinking of looking at Common Events for this, but I'm not sure that's what I should be looking for?
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
try looking for the script called Skill conditions, by tsukihime I think... it might be able to do that...
 

Keikuina

Villager
Member
Joined
Feb 21, 2013
Messages
19
Reaction score
0
First Language
English
Primarily Uses
Would it be this script? http://www.rpgmakervxace.net/topic/18654-learn-condition-formulas/

I've been looking around and I think this might be closest to what I want.

I've been thinking that each class have different skills and none shares the same

so I kinda need to only have the character with those two skills as conditions to have the Special

I'll still keep looking for solutions, in case I can find something else as well.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
I've moved this thread to RGSS3 Script Requests. Please be sure to post your threads in the correct forum next time. Thank you.
 

kerbonklin

Hiatus King
Veteran
Joined
Jan 6, 2013
Messages
1,726
Reaction score
275
First Language
English
Primarily Uses
RMMV
Actually that script might not be able to pull it off, since that goes by level-up learning skills.

What you need is your class system calling a common event upon class-switching. (reserve_common_event method for it during the on_class_ok method.  However before calling it, give the actor a scripted add_state for a new blank state (name it Class Change Check)

This common event will do a check to see if an actor was inflicted by this state (whoever changed should have it)

Then for that actor it will erase all combination skills that exist in the game from him/her.

Then it will check if two skills are learned, if so then add the specific combination skill to the actor.(Do this for every combination skill you have)

Then remove the Class Change Check state from that actor.

Repeat everything in the common event for each actor. (starting from the state infliction check)

This is the script call to add a state to the class-changing actor

@actor.add_state(ID Goes Here)and this is the script call for the common event

$game_temp.reserve_common_event(ID Goes Here)I would also recommend using Tsuki's Scene Interpreter script for the "run scene: current" ability for the common event.

Code:
#--------------------------------------------------------------------------  # 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.add_state(101)   #<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< ADD THIS      @actor.change_class(class_id, maintain)      $game_temp.reserve_common_event(24)#<<<<<<<<<<<<<<<<<<<<<<< ADD THIS      SceneManager.return      SceneManager.call(Scene_Class)    when :subclass             @actor.add_state(101)   #<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< ADD THIS      @actor.change_subclass(class_id)            $game_temp.reserve_common_event(24)#<<<<<<<<<<<<<<<<<<<<<<< ADD THIS      SceneManager.return      SceneManager.call(Scene_Class)    else      @item_window.activate      return    end    @status_window.refresh    @item_window.update_class  end
 
Last edited by a moderator:

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
Actually that script might not be able to pull it off, since that goes by level-up learning skills.
No, the learnings are constantly checked to determine whether you can learn something new or not, so if you make your learning condition based on having a particular subclass then you should learn it when you have a specific sub-class.


This is why if you set the level requirement to 1, and put a learning formula to learn the skill if switch 1 is ON, you can then turn on switch 1 and the skill will be learned.


The problem is not NOT being able to learn it when you switch subclasses, it's NOT being able to forget it when you switch subclasses.
 
Last edited by a moderator:

Keikuina

Villager
Member
Joined
Feb 21, 2013
Messages
19
Reaction score
0
First Language
English
Primarily Uses
So, if I understand, I would need to add the skill to the class, then add the requirements and then it would check if the character has both the skills in order to learn the new one?

How should I do that though? I don't really know how to make a formula that has skills in it.

And thank you, this is pretty much what I need I think.

EDIT: Also I've been testing a little, and I put something like <req condition: a.mat > 25 />

But after it goes back under than amount, the character still has the skill even though he doesn't meet the requirements anymore.

Well, I know it's a "Learning" condition, but yeah, I just have to figure out how to make the character forget the skill.
 
Last edited by a moderator:

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
For checking if the actor has learned a skill or not, you can use

a.skills.include?($data_skills[x])For some number x.I've implemented "forget condition formulas" to the learn condition formulas script.

Get the latest version from the blog post.

The learning objects that hold your combination skill will basically have a "require condition" and a "forget condition"

Code:
<req condition: a.is_subclass2 /> <forget condition: !a.is_subclass2 />
I don't know the specific method call to check what your subclass is.
 
Last edited by a moderator:

Keikuina

Villager
Member
Joined
Feb 21, 2013
Messages
19
Reaction score
0
First Language
English
Primarily Uses
Thank you very much for adding this!

I've been trying to get it to work, but I keep getting this error

 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
Oh, you'll also need to update the Core Learning script.
 

Keikuina

Villager
Member
Joined
Feb 21, 2013
Messages
19
Reaction score
0
First Language
English
Primarily Uses
Thank you!

Also, I know you said you don't know the specific method call to check the subclass, but what if it checked for something like a Feature?

Like, I'd make a Feature and it would transfer to the main class when the subclass is equipped. Like a state, but that actually does nothing.

I'm just trying to find a thing it can check for to forget the skill.
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
Better to ask if someone knows how to check the current subclass ID.


I imagine it's just something really trivial like `subclass_id`...but I haven't looked at yanfly's class system.
 
Last edited by a moderator:

kerbonklin

Hiatus King
Veteran
Joined
Jan 6, 2013
Messages
1,726
Reaction score
275
First Language
English
Primarily Uses
RMMV
@subclass_id  when used within Game_Actor

= 0 means no subclass / nil
 
Last edited by a moderator:

Keikuina

Villager
Member
Joined
Feb 21, 2013
Messages
19
Reaction score
0
First Language
English
Primarily Uses
Does that mean this kind of formula should work?

<req condition: a.skills.include?($data_skills[51]) />

<req condition: a.skills.include?($data_skills[81]) />

<req condition: @subclass_id = 15 />

<forget condition: @subclass_id = 0 />

(just put them like this 'cause it's easier to read)

I tried with just

<req condition: @subclass_id = 15 /> 

<forget condition: @subclass_id = 0 />

It works, but it shows a message like "Actor forgot the skill!" when I hadn't equipped any subclass yet.
 

kerbonklin

Hiatus King
Veteran
Joined
Jan 6, 2013
Messages
1,726
Reaction score
275
First Language
English
Primarily Uses
RMMV
<forget condition: @subclass_id = 0 />
Shouldn't it be something like @subclass_id != @subclass_id

Because what you have there would mean that if you were to switch from subclass 4 to subclass 6, it wouldn't remove anything because it's not 0. You have to remove the skills for every @subclass_id change scenario, not just for setting it to 0. Something like storing the @subclass_id # into a variable and check to see if it doesn't equal itself after switching subclasses, then forget skills.

Honestly I wish you took the method that I gave you, it's more simpler in my opinion.
 
Last edited by a moderator:

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
You need two equal signs, otherwise it is always true.

@subclass_id wouldn't work, because the formula is evaluated in the context of the Learning object, not the actor, which is why you need to say `a.skills.include?( ... )`

There is no support for multiple instances of the same condition, so you need to say

<req condition: a.skills.include?($data_skills[51]) && a.skills.include?($data_skills[81]) && a.subclass_id == 15 />Which just means "has skill 51 and has skill 81 and subclass is 15)For the subclass issue that kerbonklin brings up, you probably want to say

<forget condition: a.subclass_id != 15 />So if you change your subclass then it will be forgotten.The forget condition is not required if you use a common event to just remove all of the combination skills yourself, as that is basically what the forget condition does.
 
Last edited by a moderator:

Keikuina

Villager
Member
Joined
Feb 21, 2013
Messages
19
Reaction score
0
First Language
English
Primarily Uses
Thank you very much! Now I understand better how to use it.

And sorry kerbonklin, I tried, but I wasn't making it work properly.
 

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

Latest Threads

Latest Profile Posts

People3_5 and People3_8 added!

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.

Forum statistics

Threads
105,868
Messages
1,017,081
Members
137,582
Latest member
Spartacraft
Top