This is a locked, single-post thread from Creation Asylum. Archived here to prevent its loss.
No support is given. If you are the owner of the thread, please contact administration.
Introduction:
Hello everyone, It's been a long time since I've been on Creation Asylum. But this has been my favorite site for RPG Maker so I'm gunna post my Rank System here.
What it does:
The ranking system is like a Level System. Basically you use it like you were in a group of soldiers and you had Ranks
Right now this script can do the following things:
Add Hero to Ranks
Remove Hero From Ranks
Change Hero's Rank
Display Hero's Rank in the Message
Adding Hero:
To add a hero you type in the following:
Code:
$game_rank.AddSoldier(id,rank)
This will add the Hero of the ID to the Ranking system and give them the Rank
Removing Hero:
To remove a hero you type the following:
Code:
$game_rank.RemoveSoldier(id)
This will remove the Hero of the ID from the Ranking system
Changing Heroes:
To change the hero's rank type the following:
Code:
$game_rank.ChangeSoldier(id, rank)
You enter in the ID of what Hero you want to change, then pass in there new Rank
Displaying In Messages:
To display the rank of any hero in a message type this in your message:
Code:
\sr[id]
SR stands for Soldier Rank then just put in your ID you want to get the rank for
Checking Ranks:
To check if your rank is over, under, equal, or not equal to a rank do the following:
In your event, create an Conditional Branch
Choose script
Type in the following:
Code:
$game_rank.ranks[hero_id] [b]CONDITION[/b] rank
Replace CONDITION with one of the following:
Greater Than: >
Greater Than or Equal To: >=
Less Than: <
Less Than or Equal To: <=
Equal To: ==
Not Equal To: <>
Example:
Code:
$game_rank.ranks[3] == 5
NOTE: You MUST have a rank enabled before you use the condition or your game will get an error and die.
I'm working on that.
Future Features:
Here are some new features that will be added soon:
EXP System
Menu Display
Improved Variable Storage
The Script:
So if any of this sounds interesting to you, just copy this script into your project
Here is the demo:
Soldier_Rank_Demo.zip (Size: 243.07 KB / Downloads: 0)
"Ranking System Script"
Code:
#===============================================================================
# RANKING SYSTEM
# By: Leon Blade
#===============================================================================
# Features:
#
# * Dynamically Add, Remove, or Change Ranking for different Heros
# * Display Soldier's Rank in Message Boxes
#
#-------------------------------------------------------------------------------
# Adding, Removing, or Changing Ranking:
#
# Add Hero To Soldier: $game_rank.AddSoldier(hero_id, rank)
# Remove Hero From Soldier: $game_rank.RemoveSoldier(hero_id)
# Change Hero's Rank: $game_rank.ChangeSoldier(hero_id, rank)
#
#-------------------------------------------------------------------------------
# Displaying Messages:
#
# Typing \sr[id]: SR stands for Soldier Rank. Pass in the ID to get the rank
#
#-------------------------------------------------------------------------------
# NOTE: If you see anything commented out with the word "print" in it
# Those can be used for DEBUGING Just un comment them and then they
# Will provide you with basic information. Read them to figure it out
#
#-------------------------------------------------------------------------------
# Thats all for comments
# Hope you enjoy this script!
#
# --Leon Blade
#===============================================================================
class RankSystem
attr_reader :soldiers # Read in the Soldiers
attr_reader :ranks # Read in the Ranks
attr_accessor :hero_id # Get the hero's id
attr_accessor :rank # Get the hero's rank
def initialize
@hero = 0 # The Current Hero ID
@rank = 0 # The Current Rank
@soldiers = [] # The Heros Array
@ranks = [] # The Rank Array
end
#-----------------------------------------------------------------------------
# Add Soldier: To add a soldier type in $game_rank.AddSoldier(hero_id, rank)
#-----------------------------------------------------------------------------
def AddSoldier(hero_id, rank)
@hero = hero_id
@rank = rank
i=0
pick = true
while i < @soldiers.length
if @hero == @soldiers[i]
# print "The Soldier #{$game_actors[@hero].name} is already a Soldier"
pick = false
end
i += 1
end
if pick == true
@soldiers.push @hero
@ranks.push @rank
# print "You added #{$game_actors[@hero].name} to Soldier at Rank #{@rank}"
end
end
#-----------------------------------------------------------------------------
# Remove Soldier: To remove a soldier type in $game_rank.RemoveSoldier(hero_id)
#-----------------------------------------------------------------------------
def RemoveSoldier(hero_id)
@hero = hero_id
i=0
while i < @soldiers.size
if @hero == @soldiers[i]
@soldiers.delete_at(i)
@ranks.delete_at(i)
# print "You removed #{$game_actors[@hero].name} from Soldier"
end
i += 1
end
end
#-----------------------------------------------------------------------------
# Change Soldier: To change a soldier type in
# $game_rank.AddSoldier(hero_id, rank)
#-----------------------------------------------------------------------------
def ChangeSoldier(hero_id, rank)
@hero = hero_id
@rank = rank
i=0
while i < @soldiers.length
if @hero == @soldiers[i]
# print "#{$game_actors[@hero].name}'s current Rank is #{@ranks[i]}"
@ranks[i] = @rank
# print "You changed #{$game_actors[@hero].name}'s Rank to #{@rank}"
end
i += 1
end
end
end
#===============================================================================
# Window Message
#-------------------------------------------------------------------------------
# This will allow for easy naming for Soldier Members and there Ranks
# Simply type \SR[id] To get the Rank of the Soldier
#===============================================================================
class Window_Message < Window_Selectable
alias rank_special_character convert_special_characters
def convert_special_characters
rank_special_character
@text.gsub!(/\\SR\[([0-9]+)\]/i) { $game_rank.ranks[$1.to_i] }
end
end
#===============================================================================
# This will add $game_rank for refrence to the RankSystem Class
#===============================================================================
class Scene_Title < Scene_Base
alias rank_game_object create_game_objects
def create_game_objects
rank_game_object
$game_rank = RankSystem.new
end