Help - Search - Members - Calendar
Full Version: Job changer Blackmorning
RPG RPG Revolution Forums > Scripting > Script Submissions > RGSS2-Submissions
Pages: 1, 2
Blackmorning
QUOTE (Andrelvis @ Aug 4 2009, 01:45 AM) *
Blackmorning, what would I need to do to make it so def equippable? checks for all classes the character has available, instead of just the one he is using at the moment?


Try this out. Will check all classes that an actor has available.
Based on version 1.81

CODE
# Blackmorning Job Changer Addon
# Equippable items are based on all of the unlocked classes in an actor's list.
#==============================================================================
# ** Game_Actor
#==============================================================================
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
alias job_equippable? equippable?
#--------------------------------------------------------------------------
def equippable?(item)
result = false
for i in @unlocked_classes
job = $data_classes[i]
if item.is_a?(RPG::Weapon)
result = job.weapon_set.include?(item.id)
elsif item.is_a?(RPG::Armor)
result = job.armor_set.include?(item.id)
end
if result
return result
end
end
return job_equippable?(item)
end
end


QUOTE (Son Goku @ Aug 4 2009, 09:58 AM) *
Is there a way to unlock a certain number of classes after a certain event? For example, in FF3, whenever you beat the boss at the crystal, the crystal gives you it's light (which is more jobs), and you have to encounter all 4 four crystals to acquire all jobs besides onion knight.


How to unlock classes is in the demo and described in the script.
Andrelvis
Great, thanks biggrin.gif
Son Goku
Ok heres my problem, in the game, the beginning is where you cannot access the menu yet, until you complete a mini dungeon, and I don't want my characters to gain JP just yet, how can I do this?
Blackmorning
QUOTE (Son Goku @ Aug 5 2009, 11:28 PM) *
Ok heres my problem, in the game, the beginning is where you cannot access the menu yet, until you complete a mini dungeon, and I don't want my characters to gain JP just yet, how can I do this?


try this out. put it below my script and below my yanfly aftermath addon if you're using it.

CODE

module S_B
module CLASS
# unless switch is on, no jp is gained
# switch is automatically on at start of game if MENU_CLASS_CHANGE_OPTION = false
NO_GAIN_JP_SWITCH = 20
end
end
#===============================================================================
# ■ Scene_Title
#===============================================================================
class Scene_Title < Scene_Base
#--------------------------------------------------------------------------
# ● Create various game objects
#--------------------------------------------------------------------------
def create_game_objects
job_create_game_objects
unless S_B::CLASS::MENU_CLASS_CHANGE_OPTION
$game_switches[S_B::CLASS::DISABLE_CLASS] = true
$game_switches[S_B::CLASS::HIDE_CLASS] = true
$game_switches[S_B::CLASS::NO_GAIN_JP_SWITCH] = true
end
end
end
#==============================================================================
# ** Game_Troop (addon) *from yanfly
#==============================================================================
class Game_Troop < Game_Unit
#--------------------------------------------------------------------------
def jp_total
jp = 0
unless $game_switches[S_B::CLASS::NO_GAIN_JP_SWITCH]
for enemy in dead_members
jp += enemy.enemy.enemy_jp unless enemy.hidden
end
end
return jp
end
end
#==============================================================================
# Game_Battler
#==============================================================================
class Game_Battler
#--------------------------------------------------------------------------
# perform gain_jp
#--------------------------------------------------------------------------
def gain_jp_battle(amount)
return unless self.actor?
jp = amount
for state in states
amount *= state.bonus_jp_per
amount /= 100
end
for state in states
amount += state.bonus_jp_set
end
unless $game_switches[S_B::CLASS::NO_GAIN_JP_SWITCH]
self.jp_counter += jp if $scene.is_a?(Scene_Battle)
jp_received(jp)
end
end
end
#==============================================================================
# ** Scene_Battle (addon) *from yanfly
#==============================================================================
class Scene_Battle < Scene_Base
def display_JP
unless $game_switches[S_B::CLASS::NO_GAIN_JP_SWITCH]
if S_B::CLASS::ENEMIES_GIVE_JP
jp = $game_troop.jp_total
if jp > 0
text = sprintf(Vocab::ObtainClassExp, jp)
$game_message.texts.push('\.' + text)
for actor in $game_party.existing_members
last_level = actor.class_level
last_skills = actor.skills
actor.jp_received(jp, nil, true)
end
end
end
unless $imported["battleresults"]
if S_B::CLASS::USE_BONUS_JP
if S_B::CLASS::DISPLAY_BONUS_JP
for actor in $game_party.existing_members
if actor.jp_counter > 0
text = sprintf(Vocab::Display_Actor_Msg, actor.name, actor.jp_counter)
$game_message.texts.push('\>' + text)
end
end
end
end
end
end
end
end
if $imported["VAEP-GainJP"]
#==============================================================================
# Scene_Battle
#==============================================================================
class Scene_Battle < Scene_Base
#--------------------------------------------------------------------------
# alias display_extra_pages
#--------------------------------------------------------------------------
def display_extra_pages
create_jp_pages if $imported["JobChange"] && !$game_switches[S_B::CLASS::NO_GAIN_JP_SWITCH]
display_extra_pages_bmjp
end
end
end
livpj11
QUOTE (Blackmorning @ Jun 28 2009, 09:50 AM) *
QUOTE (RPGManiac3030 @ Jun 27 2009, 07:34 PM) *
Great, thanks. Um, is there a way to have some classes locked until certain classes are a certain level, or is that already possible? This is just a hypothetical question. rolleyes.gif


Take a look at the updated script and demo. there's a new command that can check a actor's class level and assign it to a variable. From there, you can make events that can unlock classes once they reach a certain level.


Correct me if I am wrong but it looks like you can only assign classes to unlock based of 1 other class level. For example is there a way to unlock a class when say they are a level 4 warrior and a level 2 thief?
Blackmorning
QUOTE (livpj11 @ Aug 22 2009, 06:36 PM) *
QUOTE (Blackmorning @ Jun 28 2009, 09:50 AM) *
QUOTE (RPGManiac3030 @ Jun 27 2009, 07:34 PM) *
Great, thanks. Um, is there a way to have some classes locked until certain classes are a certain level, or is that already possible? This is just a hypothetical question. rolleyes.gif


Take a look at the updated script and demo. there's a new command that can check a actor's class level and assign it to a variable. From there, you can make events that can unlock classes once they reach a certain level.


Correct me if I am wrong but it looks like you can only assign classes to unlock based of 1 other class level. For example is there a way to unlock a class when say they are a level 4 warrior and a level 2 thief?


The demo is just an example. Unlocking classes has nothing specific to do with class levels. It is through events that new classes can be unlocked. Class levels can be assigned to any number of variables for checking. you'd just have to have more conditional branches for extra conditions.
I mean, you can use unlock classes based on whatever you like with as many conditions as you can think of.
livpj11
Great that makes perfect sense now. Thanks for the speedy reply. Oh and one other question. Is there a script command that will change an actors class? I want to forcibly change an actor from one class to another.
Andrelvis
QUOTE (livpj11 @ Aug 22 2009, 09:05 PM) *
Great that makes perfect sense now. Thanks for the speedy reply. Oh and one other question. Is there a script command that will change an actors class? I want to forcibly change an actor from one class to another.


There is a default event command that does that.
livpj11
QUOTE (Andrelvis @ Aug 23 2009, 01:47 AM) *
QUOTE (livpj11 @ Aug 22 2009, 09:05 PM) *
Great that makes perfect sense now. Thanks for the speedy reply. Oh and one other question. Is there a script command that will change an actors class? I want to forcibly change an actor from one class to another.


There is a default event command that does that.


Great thanks a bunch. My current project is my first attempt at making a large quality game so I am still a noob at what I can and can't do.
Vorpal-darkness
Can you help me.
I have being trying to make a shop where you can buy the classes and then use the item to get them
but i have not succeded.
I have put the item tag in, but it still won't work.

HELP PLZ
Blackmorning
QUOTE (Vorpal-darkness @ Sep 27 2009, 06:24 AM) *
Can you help me.
I have being trying to make a shop where you can buy the classes and then use the item to get them
but i have not succeded.
I have put the item tag in, but it still won't work.

HELP PLZ


What exactly is it doing? Are the items not working? Do you have a script that is possibly overriding
"def item_effects"? I need a little more to go on because it should work.
leon0205
Now I use the KGC Custom Menu Command, so how can the Menu CLASSES appear with that script?
Blackmorning
QUOTE (leon0205 @ Sep 28 2009, 04:41 AM) *
Now I use the KGC Custom Menu Command, so how can the Menu CLASSES appear with that script?


Do you know that it's easier to put new things in the menu with Yanfly's version? It's basically the same script, but with a few extras, like a spot to add custom scripts.
Otherwise you'll have to look through the KGC script and add the commands in based off how the other ones were done.
leon0205

QUOTE
when 20 #
next unless $imported["JobChange"]
next unless S_B::CLASS::MENU_CLASS_CHANGE_OPTION
next unless $game_switches[S_B::CLASS::ENABLE_CLASS_CHANGE_SWITCH]
index_list[:jobchange] = commands.size
@command_class_change = commands.size
commands.push(S_B::CLASS::MENU_CLASS_CHANGE_TITLE)

I change the script by using menu Yanfly's version but it appear error.
Blackmorning
QUOTE (leon0205 @ Sep 28 2009, 09:40 AM) *
QUOTE
when 20 #
next unless $imported["JobChange"]
next unless S_B::CLASS::MENU_CLASS_CHANGE_OPTION
next unless $game_switches[S_B::CLASS::ENABLE_CLASS_CHANGE_SWITCH]
index_list[:jobchange] = commands.size
@command_class_change = commands.size
commands.push(S_B::CLASS::MENU_CLASS_CHANGE_TITLE)

I change the script by using menu Yanfly's version but it appear error.


not exactly what I meant... There is a spot in the yanfly script for adding new menu items. If you look for IMPORTED_COMMANDS you'll find it.
What version of my script are you using? 'Cause those aren't the terms that are in my script.
What's the error?

You could try replacing those lines you have with this:
CODE
when 20       # Class Change
        next unless $imported["JobChange"]
        next if $game_switches[S_B::CLASS::HIDE_CLASS]
        index_list[:classchange] = commands.size
        @command_class_change = commands.size
        commands << S_B::CLASS::MENU_CLASS_CHANGE_TITLE
leon0205
When the character change the class, how can I make them change the picture each class ? I saw the script and that didn't the information about that, just only CHANGE_GRAPHIC = true.
Blackmorning
QUOTE (leon0205 @ Oct 2 2009, 07:30 AM) *
When the character change the class, how can I make them change the picture each class ? I saw the script and that didn't the information about that, just only CHANGE_GRAPHIC = true.


Check again. The format is there, plus there is an example in the demo.

format is :

$a_c

where a = actor_id and c = class_id

example: $1_5 is the character graphic for actor 1 when class 5
dorky106
Um where in the script would i have to edit to make it that warrior and priest is needed for a palidan?
as well as lock a class till the character gets (????) job to ?? level to unlock the next class?
Blackmorning
QUOTE (dorky106 @ Oct 13 2009, 10:35 PM) *
Um where in the script would i have to edit to make it that warrior and priest is needed for a palidan?
as well as lock a class till the character gets (????) job to ?? level to unlock the next class?


the way my script is set up, the only way you can do that is by using events and variables. you can see the demo for a simple example
dorky106
yeah i cant figure out events that much
main ones, talking, change maps, change job normaly
so can you help me out a bit
Blackmorning
QUOTE (dorky106 @ Oct 14 2009, 06:44 PM) *
yeah i cant figure out events that much
main ones, talking, change maps, change job normaly
so can you help me out a bit


It is necessary to understand how to use variables and conditional branches even without custom scripts.
Did you look at the demo, at how the events were done?
I suggest that you look at the demo and the comments in my script and maybe look into reading some tutorials on eventing.
dorky106
nvm figured it out after hunting in the script

would it be possible to use the script in common events

so after a battle is the requirements are meet the character gets the new class?
Blackmorning
New update, fixed an issue with gaining jp during battle

updated main script, VAEP addon, and addon for switching on/off jp gain
Khaosn95
incredible script, blackmorning. i had seen it before on other forums, but never really taken interest because i didn't need it then. but i love it.
nicolaz
I like this script I in charcher one like this for a long time, but on your xreen, seen from the menu and me, in my menu y ' nothing...
Why?
How you did?
Even in your demo it y ' is not
Blackmorning
QUOTE (nicolaz @ Nov 27 2009, 02:11 PM) *
I like this script I in charcher one like this for a long time, but on your xreen, seen from the menu and me, in my menu y ' nothing...
Why?
How you did?
Even in your demo it y ' is not


You're saying that classes doesn't show up as a choice in the menu? There's only two reasons for this. The first is that the switch controlling hiding the choice is turned on. The second is that some other script is rewriting the menu.
My bet is on the first, check which switch is assigned to hiding classes in the menu and see if it is turned ON in the game.
nicolaz
Ok, thank you for help, I managed to set the menu. happy.gif
I think you've had a very good idea by this script. wink.gif
Thank you!
I am very sorry for my bad English, I'm not English ... unsure.gif
nicolaz
Hi !
It is still me! mellow.gif
I repost because I have another probléme sad.gif :
Here we are, I have to install the script Vampyr SABS, the script of fight ABS smile.gif , best at the moment, and he beug blink.gif .
I have to look at the cause, and as I have only your script and the other script, I have to try to remove yours, and has him Vampyr SABS walks!! ohmy.gif
I deduct that from it your script has to have a trick which prevents Vampyr SABS. unsure.gif
Now, as I like your script, I do not want the Remove... confused.gif
Could you try to make a new version who would correct this beug? huh.gif
Or have you the answer? huh.gif
nicolaz
Piece of news happy.gif :

The beug it had to stop suddenly blink.gif !
I can thus take back my game smile.gif Thanks to you all the same thing if you had let make a new version! yes.gif
Blackmorning
Hey all, new update on main page. Cleaned up what skills are forgotten when changing classes. Only skills from the previous class should be removed, so as long as the skill isn't in the learning list for that class you won't forget it. Should help people that have been having certain problems.

Also a new addon for class level requirements to unlock new classes without the use of events.
Xigre
QUOTE (Blackmorning @ Jun 25 2010, 05:32 AM) *
Hey all, new update on main page. Cleaned up what skills are forgotten when changing classes. Only skills from the previous class should be removed, so as long as the skill isn't in the learning list for that class you won't forget it. Should help people that have been having certain problems.

Also a new addon for class level requirements to unlock new classes without the use of events.


This addon doesn't work or there is some configuration that I'm neglecting despite your extensive instructions inside the script.

I tried it on my game and a basic game and also tested with AVAILABLE_CLASSES set to a single class and multiple classes.

It seems that, if I set all classes in AVAILABLE_CLASSES, the player can be any class regardless of requirements set in the addon.
If I set only one class (the starting class for that actor), they can't change classes at all, event after meeting requirements I entered into the addon.

I have your 16/02/10 configuration file and there's no date on the Engine file, but it's from this topic (about two weeks ago), so it should be up-to-date. If there's another version I need to be made aware of, please do!

EDIT:
Nevermind.
The addon isn't "on" by default.

It took some fiddling around (and learning a smidge of RGSS2 by reading and re-reading your Jog Changer scripts), but I figured it out.

It's fantastic! biggrin.gif
Leonlionheart
Have a problem with YEM Core Fixes and Upgrades. Whenever I'm trying to change classes in-game, I get to 9 on the list and it crashes, saying:
"Script 'YEM Core Fixes and Upgrades' line 1095: TypeError occurred.

can't clone NilClass"

-__-; I'm no scripter, I have no clue how to fix this. I was just trying to configure the script to allow for me to change between all of my desired classes. I added 9-20 in all applicable categories. I'm thinking i missed a variable where you specify how many classes you have? Idk.
Any help would be appreciated.

Edit: Figured it out, it was where the script was asking for class descriptions, I had left one blank 9 => [] and that messed it up ^^;

Problem Solved!
Leonlionheart
*Double post*
Leonlionheart
Now I'm having several other problems with these scripts. For some reason my JP or levels aren't being saved properly during the game, Sometimes I'm level 2 Knight, then all of a sudden I'm level 1. I don't know the cause at all -__-; Highest I've been able to get to is 3.

All help is appreciated ^^

Edit: Still having the same problems, but they seem to be fixed when i change the custom jp for job level to true. However, when i do that i get an error with script line 266 in the job change engine, copied from the demo and left completely untouched. Some NoMethodError. undefined method `[] for nil:NilClass . Also, only happens when I gain large amounts of JP.
Xigre
QUOTE (Leonlionheart @ Jul 31 2010, 03:24 PM) *
Now I'm having several other problems with these scripts. For some reason my JP or levels aren't being saved properly during the game, Sometimes I'm level 2 Knight, then all of a sudden I'm level 1. I don't know the cause at all -__-; Highest I've been able to get to is 3.

All help is appreciated ^^

Edit: Still having the same problems, but they seem to be fixed when i change the custom jp for job level to true. However, when i do that i get an error with script line 266 in the job change engine, copied from the demo and left completely untouched. Some NoMethodError. undefined method `[] for nil:NilClass . Also, only happens when I gain large amounts of JP.


Try going to your Job requirement addon, which I'm assuming you use because it's the lazy thing to do (and easy), and put a comma after all of your class brackets. Like this:
20 => [3,20],
21 => [3,20],

Be sure to remove any periods/ replace periods with commas and leave no spaces in those fields (E.G., [3,20] and not [3, 20]).
And then go to your JP requirement list at the bottom of the configuration file and do the same thing.

Line 266 in the Engine references those two lines, from what I can tell, so you should look into it, if nothing else.

You should also consider re-arranging your scripts in the script editor so that they don't interfere with any other scripts which manipulate character mechanics. I have mine set up in this order:

"(All fixes and upgrades)

YERD Display Victory Aftermath

Blackmorning's Job Confirguation
Blackmorning's Job Engine
BM's Job Requirement Addon
YERD Victory Aftermath Extra Page
YERD Victory Aftermath Compatibility"

Also keep in mind that some scripts conflict with others because of rewriting and/or influence (position). So, if nothing else works, try and re-order them in various places to test the effects.
Leonlionheart
QUOTE (Xigre @ Jul 31 2010, 10:54 PM) *
QUOTE (Leonlionheart @ Jul 31 2010, 03:24 PM) *
Now I'm having several other problems with these scripts. For some reason my JP or levels aren't being saved properly during the game, Sometimes I'm level 2 Knight, then all of a sudden I'm level 1. I don't know the cause at all -__-; Highest I've been able to get to is 3.

All help is appreciated ^^

Edit: Still having the same problems, but they seem to be fixed when i change the custom jp for job level to true. However, when i do that i get an error with script line 266 in the job change engine, copied from the demo and left completely untouched. Some NoMethodError. undefined method `[] for nil:NilClass . Also, only happens when I gain large amounts of JP.


Try going to your Job requirement addon, which I'm assuming you use because it's the lazy thing to do (and easy), and put a comma after all of your class brackets. Like this:
20 => [3,20],
21 => [3,20],

Be sure to remove any periods/ replace periods with commas and leave no spaces in those fields (E.G., [3,20] and not [3, 20]).
And then go to your JP requirement list at the bottom of the configuration file and do the same thing.

Line 266 in the Engine references those two lines, from what I can tell, so you should look into it, if nothing else.

You should also consider re-arranging your scripts in the script editor so that they don't interfere with any other scripts which manipulate character mechanics. I have mine set up in this order:

"(All fixes and upgrades)

YERD Display Victory Aftermath

Blackmorning's Job Confirguation
Blackmorning's Job Engine
BM's Job Requirement Addon
YERD Victory Aftermath Extra Page
YERD Victory Aftermath Compatibility"

Also keep in mind that some scripts conflict with others because of rewriting and/or influence (position). So, if nothing else works, try and re-order them in various places to test the effects.


I'll try fiddling with these suggestions, thanks. If nothing seems to be working, I'll come back here.
Leonlionheart
Updated to the more recent job changer by blackmorning, and getting pretty much the same error, except this time it's 268 instead of 266. I can no longer tell if my character's job levels are being saved, however.

I can't find script for YERD victory afatermath anymore, maybe this is all because I was previously using Yanfly Engine Melody's version? I like YEM's more personally, though i have YERD's.

EDIT: Just to specify:
Error Message: Script '*Job_Engine' line 268: NoMethodError occurred. undefined method `[]' for nil:NilClass
This error appears after the drops screen in the victory aftermath. Only seems to appear when either all actors and classes level, or all actor's classes level.

Scripts look like:

YERD Victory_Aftermath
YERD VictoryExtend
MALG YerdAftermathFix

Blackmorning's Job Configurations
Blackmorning's Job Engine
Blackmorning's Job Requirement Addon
Blackmorning's Victory Aftermath Addon
Blackmorning's No Gain JP
Adrien.
-- Stat point changes are not happening with in the game upon changing classes.
-- Stat point changes only happen for DEX and Res.

what would cause this?
Blackmorning
small bug fix. part b download on main page.


QUOTE (Adrien. @ Jan 7 2011, 04:36 PM) *
-- Stat point changes are not happening with in the game upon changing classes.
-- Stat point changes only happen for DEX and Res.

what would cause this?


if stats aren't changing except for dex and res, it probably means that something below my script is overwriting those definitions. try placing my script below some of the others.
Adrien.
Thanks I have come across a new issue. If I am not using JP which I am not.

Mid Battle I get this error:

Click to view attachment

Which happens on a successful hit from player to enemy.

The lines of code that are affected are:

CODE
while @jp_exp[id] >= @jp_list[id][@class_level[id] + 1] and @jp_list[id][@class_level[id] + 1] > 0


On 268.

Do you have a patch that if I am not using JP this wont happen?

-- Edit:

It seems commenting out that whole Method clears the issue but I don't know if that will cause issues down the road.
Flashflame58
How would I use this to say...make the Thief class always have two-sword style?
kartacha
I added the script, but it's not displayed in the menu. I used it in a previous game and copied it directly from the project there... What I've missed?
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2013 Invision Power Services, Inc.