Character Races
Authors: game_guy
Version: 1.0
Type: Character Customization
Key Term: Actor Add-on
IntroductionAdds character races to your game. If you've played oblivion its a lot like that. Pretty much each race has its own stat bonuses, skill bonuses, and name.
Features
- Have unlimited races
- Have stat bonuses
- Have skill bonuses
ScreenshotsN/A
DemoMediaFire (http://www.mediafire.com/download.php?n34yzhm4k0j)
Script
#===============================================================================
# Character Races
# Author game_guy
# Version 1.0
#-------------------------------------------------------------------------------
# Intro:
# Adds character races to your game. If you've played oblivion its a lot like
# that. Pretty much each race has its own stat bonuses, skill bonuses, and
# name.
#
# Features:
# Have unlimited races
# Have stat bonuses
# Have skill bonuses
#
# Instructions:
# Go down to Config. Follow the instructions there.
#
# To change a class of any actor use this.
# $game_actors[actor id].race = race id
#
# Credits:
# game_guy ~ for making it
# Bethesda ~ for making oblvion which this script is based from
#===============================================================================
module GameGuy
#=========================================================
# Config
#=========================================================
#==========================================
# DefaultRace ~ The id of the race that
# every actor starts with.
#==========================================
DefaultRace = 1 # Default Race for every actor
def self.racen(id) # Race Names
case id
#==========================================
# Race Name
# when race_id then return "Name of Race"
# Example:
# when 1 then return "Human"
# Race 1 is called human now
#==========================================
when 1 then return "Human"
when 2 then return "Orc"
when 3 then return "Elf"
end
return "Human"
end
def self.raceb(id) # Race Bonus Attributes
case id
#==========================================
# Race Stat Bonuses
# when race_id then return [hp+, sp+, str+, dex+, agi+, int+]
# Example:
# when 1 then return [10, 0, 5, 0, 0, 0]
# So 'Human' would have a 10 bonus hp and 5 bonus of strength.
#==========================================
when 1 then return [10, 0, 5, 0, 0, 0]
when 2 then return [0, 0, 10, 5, 0, 0]
when 3 then return [0, 20, 0, 0, 10, 5]
end
return [0, 0, 0, 0, 0, 0]
end
def self.races(id) # Race Bonus Skills
case id
#==========================================
# Race Bonus Skills
# when 1 then return [skill 1, skill 2, ect]
# Example:
# when 1 then return [1, 2]
# So 'Human' would know the skills Heal and Greater Heal
#==========================================
when 1 then return [1, 2]
when 2 then return [57, 58]
when 3 then return [4, 5, 6, 7, 8, 9]
end
return []
end
end
class Game_Actor
attr_accessor :race_id
attr_accessor :race_name
alias gg_add_races_act_later setup
def setup(actor_id)
@race_id = 0
gg_add_races_act_later(actor_id)
setup_race(GameGuy::DefaultRace)
end
def setup_race(id = 0)
old_id = @race_id
stats = GameGuy.raceb(old_id)
@maxhp_plus -= stats[0]
@maxsp_plus -= stats[1]
@str_plus -= stats[2]
@dex_plus -= stats[3]
@agi_plus -= stats[4]
@int_plus -= stats[5]
@race_id = id
skills = GameGuy.races(old_id)
skills2 = []
for i in $data_classes[@class_id].learnings
skills2.push(i.skill_id)
end
for i in skills
unless skills2.include?(i)
forget_skill(i)
end
end
stats = GameGuy.raceb(@race_id)
@maxhp_plus += stats[0]
@maxsp_plus += stats[1]
@str_plus += stats[2]
@dex_plus += stats[3]
@agi_plus += stats[4]
@int_plus += stats[5]
@race_name = GameGuy.racen(@race_id)
skills = GameGuy.races(@race_id)
@hp = maxhp
@sp = maxsp
for i in skills
learn_skill(i)
end
end
def race=(id)
setup_race(id)
end
end
InstructionsIn the script.
CompatibilityNot tested with SDK.
Tested with Blizz-Abs and works. (It was actually made for Blizz-Abs but it works for most battle systems as well.)
Credits and Thanks
- game_guy ~ for making it
- Bethesda ~ for making oblvion which this script is based from
Author's NotesPlease do give proper credit for the maker. This script was made for a game I'm working on with a friend. I thought it'd be cool to release it though.
Enjoy!
I'm definitely gonna have to try this out :D
I personally LOVE the Elder Scrolls series, and this seems like it would be a great addition to my game :D
I'll let you know what I think ;)
One question...does this script go below all others?
Another question just came to mind...is there a way to show the race name in-game, and how do I assign each actor a different race? (i.e. Orc Fighter)
if you read the instructions you'd know to use this.
$game_actors[actor id] = race id
Place it above blizz's scripts and below all others.
and glad you like it :)
Apparently, there's some sort of syntax error on line 75...I didn't make any changes to the script either...Would the actors have to have skills assigned to them for this to work?
My bad. I fixed it.
There's much sex in this young one. :V: *levels up*
Just a suggestion for the next version, maybe you should make it so certain races have weaknesses to certain elements (Orcs and goblins are weak against fire, etc.) This would also allow the creation of weapons more effective against certain races, such as silver weapons being strong against demonic races. That's just an idea that you might want to implement if you update in the future, though; the script is already great.
wait a second, couldn't you just give the actor the bonuses from the start...? and with the skill bonuses, wouldn't it just be a simple matter of assigning a unique class for every actor so that their skills could be unique or "with a bonus"?
lol, I'm most likely gonna use it, but to me it kinda seems as pointless as the existance of for example hannah montanna, or the thinking of the us government...
@Eternal : this script is great for orginization. Also it can be a pain if you have a larger amount of classes in your game to sit there and and create another class for each race. Say for example you have 15 classes and 5 races, with this script you can easily setup the bonus for being a certain race, but using the method you suggest, you would have to make and configure 75 different classes. So which seems easier? :P
@faint: Thanks for backing me up!
Also for the custom version I have the stat multiplier done like STR * 1.5 but learning a skill at a different level isn't quite done. It will be though so just gotta wait.
ok no problem man but just wondering how did you go about doing the multipliers? Only wondering because I am trying to get better at scripting myself and was trying to figure it out myself. I managed to get it it partially working =p
Well in the setup_race method I changed all the minuses to /= and all the pluses to *=. It was very simple. :D So you could go ahead and add that yourself. I'm trying to find a fairly easy way to setup the skill level.
omg I actually got it right bwahahaha. I just hadn't tested it yet. I don't feel like such a noob anymore lol. For the skills I wonder if "skill_can_use?" would work? I am gonig to try and figure out my idea about elemental efficiencies for the races.
I already added that as well(element efficiancies) :S
I'm almost done with the levels hopefully I'll have it done tonight.
well then I do believe I love you :P
@faint aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaahhh. +@game_guy not too stupid actually...
Everything is easier when you break it down 8)
game_guy, you are my hero. you have made my job so much easier right now i could cry.... my game will pass though the troubled times of my lacking RGSS skills and shall become a blossoming sakura (Cherry) tree and shall bear fruit of wisdom and love for pain and suffering of gamers. truly this night has been blessed for me to return from my stupor and lack of internets... hail odin....
8-O
cool
Is there a way to make this so it doesn't just trigger one actor, but a set of actors with the same race? i.e. Player chooses Elf race, then before they get to the class selection, it automatically makes them an Elf? To make this more clear, my situation is this: Player chooses race, and then they can choose the class, and then they are assigned an actor based on the class and race they choose.
Let me know if you need more detail.
You could do this.
$game_actors.each{|i| i.race = race_id}
That turns all actors into the same race. I think that'd do what you need.
So would I use that in an event script call when they choose their race?
Yes. After they choose the race. Just call that script and change race_id.
What if there are no actors in the Initial Party until they choose a class? I'd prolly have to put it in for each class, aye?
Game_Guy, I'd first like to declare that I adore you.
Second, I looked at the script and I'm guessing that it;d be possible to limit weapons to races by messing with a copy of the skills yoke.
You can just limit weapons through classes.
I could, but I could also do the same with skills.
can you maybe help me with a equipment by race plugin?
like
if shield => [[1, 0], [2,1], [3,2]]
if helmet... and so on...
id1 can be equped by all races, id2 can be equiped by raceid1 only, id3 can be equiped by raceid2 only...
thx in advance
bump
To start with, I do apologize for a... well, like 2 year necro-post. I do have legitimate questions though, and I know the creator is still active lolz..
1) Am I correct in thinking that by just changing the way it calculates bonuses, I could make it use a "percentage" instead of numbers?such as:
@temp_stat=@new_stat
@new_stat=(@temp_stat*1.5)
2) Is this called every time that Game_Actor is called? As in, if the character levels up, is there a way to make it recalculate the bonuses?
You'd have to modify the script a bit. The script subtracts and adds bonuses. The bonuses are calculated only once when you setup the player's race. Bonuses aren't added at every level up.
Is there an easy way to have the race be displayed in the menu right after the class? There's definitely space for it, as much space as there is for the actor name and class. I'm just getting into scripting so I personally haven't a clue how to do this yet.
Stick this to the end of the script:
class Window_Base < Window
def draw_actor_race(actor, x, y)
self.contents.font.color = normal_color
self.contents.draw_text(x, y, 236, 32, actor.race_name)
end
end
class Window_Status < Window_Base
alias draw_actor_race_after_refresh refresh
def refresh
draw_actor_race_after_refresh
draw_actor_race(@actor, 4 + 144 * 2, 0)
end
end
Right at the end of the races script? Didn't work for me, but like I said, still getting the hang of this so might be a tad confused...
Yes, just append the snippet to the end of G_G's script. Tested and works.
Did you put the script below Scene_Debug and above Main?
Yep. There's a few other scripts installed however, guess it might be a conflict...
pics
(https://imagizer.imageshack.us/v2/683x328q90/537/nEAzrc.jpg)
where I want the race name (right after class above hp)
(https://imagizer.imageshack.us/v2/524x155q90/537/9m0i2z.jpg)
Ohhhhhhh, that status window. Let me whip that up quick-like.
Append this to the bottom of what I put before.
class Window_MenuStatus < Window_Selectable
alias draw_races_after_refresh refresh
def refresh
draw_races_after_refresh
for i in 0...$game_party.actors.size
x = 64
y = i * 116
actor = $game_party.actors[i]
draw_actor_race(actor, x + 144 * 2, y)
end
end
end
Worked! Much thanks ^_^ and made it look so easy. I really need to wrap my head around this stuff. Just got back into using rpg maker after quite a few years (making a 5th ed D&D inspired thing), so I'll be definitely be frequenting these parts.