[XP] Character Races

Started by G_G, January 28, 2010, 08:34:35 pm

Previous topic - Next topic

G_G

January 28, 2010, 08:34:35 pm Last Edit: January 28, 2010, 09:21:08 pm by game_guy
Character Races
Authors: game_guy
Version: 1.0
Type: Character Customization
Key Term: Actor Add-on



Introduction

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



Screenshots

N/A


Demo

MediaFire


Script

Spoiler: ShowHide

#===============================================================================
# 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



Instructions

In the script.


Compatibility

Not 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 Notes

Please 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!

ShinyToyGuns

January 28, 2010, 08:50:45 pm #1 Last Edit: January 28, 2010, 09:05:08 pm by ShinyToyGuns
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)
Days
I've missed so many days
In a world that has become an unfamiliar place
Now to you, I'm just an unfamiliar face

~Shiny Toy Guns, Blown Away (2008)

G_G

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 :)

ShinyToyGuns

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?
Days
I've missed so many days
In a world that has become an unfamiliar place
Now to you, I'm just an unfamiliar face

~Shiny Toy Guns, Blown Away (2008)

G_G


Blizzard

There's much sex in this young one. :V: *levels up*
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

WhiteRose

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.

Eternal

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...

[Faint]

@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
Scripts by me - State Requirement Skills
current project - Project: AURA

G_G

@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.

[Faint]

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
Scripts by me - State Requirement Skills
current project - Project: AURA

G_G

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.

[Faint]

February 01, 2010, 05:05:14 pm #12 Last Edit: February 01, 2010, 05:07:55 pm by [Faint]
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.
Scripts by me - State Requirement Skills
current project - Project: AURA

G_G

I already added that as well(element efficiancies) :S

I'm almost done with the levels hopefully I'll have it done tonight.

[Faint]

well then I do believe I love you :P
Scripts by me - State Requirement Skills
current project - Project: AURA

Eternal

@faint aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaahhh. +@game_guy not too stupid actually...

[Faint]

Everything is easier when you break it down  8)
Scripts by me - State Requirement Skills
current project - Project: AURA

Godsigma

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....

Eternal


phillip1756