Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

2 Pages V   1 2 >  
Closed TopicStart new topic
> [RMVX] Good VS Evil, Allows Actors to have an alignment
Ty
post Jan 26 2008, 02:24 AM
Post #1


Level 38
Group Icon

Group: +Gold Member
Posts: 1,007
Type: Scripter
RM Skill: Undisclosed




Script Name: Good VS Evil
Written by: Synthesize
Version: 1.0.0
Release Date: January 26, 2008

What is it?
This script allows the end user (you) to give each playable character an alignment and alignment points. The system works similar to the Baldur's Gate 'reputation system', where x amount of Upgrade points increase the actors alignment. The script automatically draws the alignment in the status screen.

[Show/Hide] The Script

CODE
#===============================================================================
# Good VS Evil --- RMVX Version
#===============================================================================
# Written by Synthesize
# Version 1.0.0
# January 26, 2008
#===============================================================================
#                            * RMVX Version *
#===============================================================================
module GoodVSEvil
  # The initial Alignment for actors
  Alignment_initial = {1 => 2, 2 => 3, 3 => -5}
  Alignment_initial.default = 0
  # The names of the alignments
  Alignment_names = ["Very Good", "Good", "Neutral", "Evil", "Devil Child"]
  # maximum amount of points
  Maximum_alignment = 100
  # Maximum amount of evil points
  Maximum_evil_alignment = -100
  # Format = {value => amount to check}
  Rates = {0 => 50, 1 => 25, 3 => -25, 4 => 50}
  # Rates configure how many Alignment points a character needs to have
  # there alignment 'upgrade'
  # $alignment commands:
  # $alignment.add(value, member)   # Adds value of alignment
  # $alignment.remove(value, member)   # Removes value from member
  # $alignment.checksum(amount, member)   # Check value of points then return
  # $alignment.checkname(member, name)   # Check if the alignment level is =name
end
#-------------------------------------------------------------------------------
# Create and set alignment points
#-------------------------------------------------------------------------------
class Game_Actor < Game_Battler
  attr_accessor :alignment
  attr_accessor :alignment_name
  alias syn_gve_setup setup
  #-----------------------------------------------------------------------------
  # Setup Actor Alignment
  #-----------------------------------------------------------------------------
  def setup(actor_id)
    syn_gve_setup(actor_id)
    @alignment = GoodVSEvil::Alignment_initial[actor_id]
    @alignment_name = "Neutral"
  end
  #-----------------------------------------------------------------------------
  # Return Alignment Values
  #-----------------------------------------------------------------------------
  def alignment_value
    @alignment = GoodVSEvil::Maximum_alignment if @alignment > GoodVSEvil::Maximum_alignment
    @alignment = GoodVSEvil::Maximum_evil_alignment if @alignment < GoodVSEvil::Maximum_evil_alignment
    if @alignment >= GoodVSEvil::Rates[1]
      @alignment_name = GoodVSEvil::Alignment_names[1]
      @alignment_name = GoodVSEvil::Alignment_names[0] if @alignment > GoodVSEvil::Rates[0]
      return @alignment_name
    elsif @alignment <= GoodVSEvil::Rates[3]
      @alignment_name = GoodVSEvil::Alignment_names[3]
      @alignment_name = GoodVSEvil::Alignment_names[4] if @alignment >= GoodVSEvil::Rates[4]
      return @alignment_name
    else
      @alignment_name = GoodVSEvil::Alignment_names[2]
      return @alignment_name
    end
  end
end
#-------------------------------------------------------------------------------
# Window_MenuStatus add-on
#-------------------------------------------------------------------------------
class Window_Status < Window_Base
  alias syn_gve_refresh refresh
  def refresh
    syn_gve_refresh
    self.contents.font.color = system_color
    self.contents.draw_text(32, 350, 120, 32, "Alignment:")
    self.contents.font.color = normal_color
    self.contents.draw_text(156, 350, 120, 32, @actor.alignment_value)
  end
end
#-------------------------------------------------------------------------------
# Alignment Management
#-------------------------------------------------------------------------------
class Alignment_Management
  def add(value, member)
    $game_party.members[member].alignment += value
  end
  def remove(value, member)
    $game_party.members[member].alignment -= value
  end
  def checksum(amount, member)
    if $game_party.members[member].alignment >= amount
      return true
    else
      return false
    end
  end
  def checkname(member, name)
    if $game_party.members[member].alignment_name == name
      return true
    else
      return false
    end
  end
end
#-------------------------------------------------------------------------------
# Scene_Title:: Create the Global Variable
#-------------------------------------------------------------------------------
class Scene_Title
  alias syn_gve_game_object create_game_objects
  def create_game_objects
    syn_gve_game_object
    $alignment = Alignment_Management.new
  end
end
#===============================================================================
#             * This script will not work with RPG Maker XP *
#===============================================================================
# Written by Synthesize
# Version 1.0.0
# January 26, 2008
#===============================================================================
# Good VS Evil --- RMVX Version
#===============================================================================



[Show/Hide] Alignment Management patch

CODE
#===============================================================================
# Alignment Management Patch
#===============================================================================
# Written by Synthesize
# Version 1.0.0
# March 1, 2008
#===============================================================================
# GoodVSEvil is required for this to work
#===============================================================================
# What is it?
#-------------------------------------------------------------------------------
# This rewrites the Alignment Management class fixing a checksum bug and adding
# additional commands. I am doing it this way because I am much to lazy to make
# a new demo.
# $alignment.commands:
#   $alignment.
#             add_points(value, member, string)
#             remove_points(value, member)
#             check_points(amount, member, sign)
#             check_name(member, name, sign)
# Where:
# Value = numerical value (0-9) OR "all"
# Member = Party member position -1
# Amount = Value to check
# Sign = ">", "<", "=", "!"
# Name = string of information to check (ie."This is a string")
#===============================================================================
class Alignment_Management
  #-----------------------------------------------------------------------------
  # Add_Points:: Add points to the specified member. Use "all" for all members
  #-----------------------------------------------------------------------------
  def add_points(value, member)
    if member == "all"
      for i in 0...$game_party.members.size
        $game_party.members[i].alignment += value
      end
    else
      $game_party.members[member].alignment += value
    end
  end
  #-----------------------------------------------------------------------------
  # Remove Points
  #-----------------------------------------------------------------------------
  def remove_points(value, member)
    if member == "all"
      for i in 0...$game_party.members.size
        $game_party.members[i].alignment -= value
      end
    else
      add_points(-value, member)
    end
  end
  #-----------------------------------------------------------------------------
  # Checksum:: Check the values and return the outcome
  #-----------------------------------------------------------------------------
  def check_points(amount, member, sign)
    case sign
    when "="
      if $game_party.members[member].alignment == amount
        return true
      else
        return false
      end
    when ">"
      if $game_party.members[member].alignment >= amount
        return true
      else
        return false
      end
    when "<"
      if $game_party.members[member].alignment <= amount
        return true
      else
        return false
      end
    when "!"
      if $game_party.members[member].alignment != amount
        return true
      else
        return false
      end
    end
  end
  #-----------------------------------------------------------------------------
  # Check Name:: Check the alignment name
  #-----------------------------------------------------------------------------
  def check_name(member, name, sign)
    if name.is_a(Numeral)
      p "Please turn you numeral into a string ("")"
    end
    case sign
    when "="
      if $game_party.members[member].alignment_name == name
        return true
      else
        return false
      end
    when "!"
      if $game_party.memebrs[member].alignment_name != name
        return true
      else
        return false
      end
    end
  end
end
#===============================================================================
# This Alignment patch applies for RPG Maker VX
#===============================================================================
# Written by Synthesize
# Version 1.0.0
# March 1, 2008
#===============================================================================
# Alignment Management Patch
#===============================================================================



DEMO:
http://www.4shared.com/file/37416989/279c8...GoodVSEvil.html

Comments? Concerns? Post them.


__________________________
My Script Demo link broken? Looking for old scripts? Go here:
http://synthesize.4shared.com
Go to the top of the page
 
+Quote Post
   
Rory
post Jan 26 2008, 03:49 AM
Post #2


GFX Pro
Group Icon

Group: +Gold Member
Posts: 409
Type: Artist
RM Skill: Skilled




Good script, this would make one very interactive RPG even better! =]


__________________________

THE SAVAGE NYMPH
Note: this is Magdreamer, I'm using my real name for my forum name now.
Go to the top of the page
 
+Quote Post
   
Rory
post Jan 26 2008, 08:47 AM
Post #3


GFX Pro
Group Icon

Group: +Gold Member
Posts: 409
Type: Artist
RM Skill: Skilled




How do you add and deduct Allignment points?


__________________________

THE SAVAGE NYMPH
Note: this is Magdreamer, I'm using my real name for my forum name now.
Go to the top of the page
 
+Quote Post
   
KiteDXX
post Jan 26 2008, 10:18 AM
Post #4


Level 7
Group Icon

Group: Member
Posts: 96
Type: Event Designer
RM Skill: Skilled




QUOTE (Magdreamer @ Jan 26 2008, 12:54 PM) *
How do you add and deduct Allignment points?

QUOTE (The script)
# $alignment.add(value, member) # Adds value of alignment
# $alignment.remove(value, member) # Removes value from member


Also, is there such a version for RMXP?


__________________________
Go to the top of the page
 
+Quote Post
   
Ty
post Jan 26 2008, 02:59 PM
Post #5


Level 38
Group Icon

Group: +Gold Member
Posts: 1,007
Type: Scripter
RM Skill: Undisclosed




Here is the RMXP Version:
http://204.191.115.42:43179/GoodVSEvil.zip

The Script:
CODE
#===============================================================================
# Good VS Evil --- RMXP Version
#===============================================================================
# Written by Synthesize
# Version 1.0.0
# January 26, 2008
#===============================================================================
#                            * RMXP Version *
#===============================================================================
module GoodVSEvil
  # The initial Alignment for actors
  Alignment_initial = {1 => 2, 2 => 3, 3 => -5}
  Alignment_initial.default = 0
  # The names of the alignments
  Alignment_names = ["Very Good", "Good", "Neutral", "Evil", "Devil Child"]
  # maximum amount of points
  Maximum_alignment = 100
  # Maximum amount of evil points
  Maximum_evil_alignment = -100
  # Format = {value => amount to check}
  Rates = {0 => 50, 1 => 25, 3 => -25, 4 => 50}
  # Rates configure how many Alignment points a character needs to have
  # there alignment 'upgrade'
  # $alignment commands:
  # $alignment.add(value, member)   # Adds value of alignment
  # $alignment.remove(value, member)   # Removes value from member
  # $alignment.checksum(amount, member)   # Check value of points then return
  # $alignment.checkname(member, name)   # Check if the alignment level is =name
end
#-------------------------------------------------------------------------------
# Create and set alignment points
#-------------------------------------------------------------------------------
class Game_Actor < Game_Battler
  attr_accessor :alignment
  attr_accessor :alignment_name
  alias syn_gve_setup setup
  #-----------------------------------------------------------------------------
  # Setup Actor Alignment
  #-----------------------------------------------------------------------------
  def setup(actor_id)
    syn_gve_setup(actor_id)
    @alignment = GoodVSEvil::Alignment_initial[actor_id]
    @alignment_name = "Neutral"
  end
  #-----------------------------------------------------------------------------
  # Return Alignment Values
  #-----------------------------------------------------------------------------
  def alignment_value
    @alignment = GoodVSEvil::Maximum_alignment if @alignment > GoodVSEvil::Maximum_alignment
    @alignment = GoodVSEvil::Maximum_evil_alignment if @alignment < GoodVSEvil::Maximum_evil_alignment
    if @alignment >= GoodVSEvil::Rates[1]
      @alignment_name = GoodVSEvil::Alignment_names[1]
      @alignment_name = GoodVSEvil::Alignment_names[0] if @alignment > GoodVSEvil::Rates[0]
      return @alignment_name
    elsif @alignment <= GoodVSEvil::Rates[3]
      @alignment_name = GoodVSEvil::Alignment_names[3]
      @alignment_name = GoodVSEvil::Alignment_names[4] if @alignment >= GoodVSEvil::Rates[4]
      return @alignment_name
    else
      @alignment_name = GoodVSEvil::Alignment_names[2]
      return @alignment_name
    end
  end
end
#-------------------------------------------------------------------------------
# Window_MenuStatus add-on
#-------------------------------------------------------------------------------
class Window_Status < Window_Base
  alias syn_gve_refresh refresh
  def refresh
    syn_gve_refresh
    self.contents.font.color = system_color
    self.contents.draw_text(330, 400, 120, 32, "Alignment:")
    self.contents.font.color = normal_color
    self.contents.draw_text(450, 400, 120, 32, @actor.alignment_value)
  end
end
#-------------------------------------------------------------------------------
# Alignment Management
#-------------------------------------------------------------------------------
class Alignment_Management
  def add(value, member)
    $game_party.actors[member].alignment += value
  end
  def remove(value, member)
    $game_party.actors[member].alignment -= value
  end
  def checksum(amount, member)
    if $game_party.actors[member].alignment >= amount
      return true
    else
      return false
    end
  end
  def checkname(member, name)
    if $game_party.actors[member].alignment_name == name
      return true
    else
      return false
    end
  end
end
#-------------------------------------------------------------------------------
# Scene_Title:: Create the Global Variable
#-------------------------------------------------------------------------------
class Scene_Title
  alias syn_gve_newgame command_new_game
  def command_new_game
    syn_gve_newgame
    $alignment = Alignment_Management.new
  end
end
#===============================================================================
#             * This script will not work with RPG Maker VX *
#===============================================================================
# Written by Synthesize
# Version 1.0.0
# January 26, 2008
#===============================================================================
# Good VS Evil --- RMXP Version
#===============================================================================



@MagDreamer: Check the Demo. it shows you how to add/remove points as well as how to create an NPC that uses the alignment of the character.


__________________________
My Script Demo link broken? Looking for old scripts? Go here:
http://synthesize.4shared.com
Go to the top of the page
 
+Quote Post
   
ScrewBall412
post Feb 8 2008, 10:18 PM
Post #6


Level 1
Group Icon

Group: Member
Posts: 9
Type: Developer
RM Skill: Beginner




The link to the demo is broken.
Go to the top of the page
 
+Quote Post
   
lahandi
post Feb 13 2008, 08:15 AM
Post #7


Level 8
Group Icon

Group: Revolutionary
Posts: 111
Type: Artist
RM Skill: Skilled




sweat.gif Yeah... the VX-demo link is error. fakenopic.gif


__________________________
Go to the top of the page
 
+Quote Post
   
Alrian
post Feb 17 2008, 04:08 PM
Post #8



Group Icon

Group: Member
Posts: 2
Type: None
RM Skill: Beginner




Could you plz repair the adress ?
I liked the idea of reputation points im my game .
Go to the top of the page
 
+Quote Post
   
SeeYouAlways
post Feb 18 2008, 03:00 AM
Post #9


Demented Moogle
Group Icon

Group: Banned
Posts: 1,130
Type: None
RM Skill: Undisclosed




You guys do realize the script is still there and the script can still be used? Anyway, the link to the demo has been fixed. Please check the first topic.


__________________________
Go to the top of the page
 
+Quote Post
   
Rory
post Feb 18 2008, 04:29 AM
Post #10


GFX Pro
Group Icon

Group: +Gold Member
Posts: 409
Type: Artist
RM Skill: Skilled




O.o a demo for a copy+paste script? Some people are just too lazy.


__________________________

THE SAVAGE NYMPH
Note: this is Magdreamer, I'm using my real name for my forum name now.
Go to the top of the page
 
+Quote Post
   
xiquinho
post Feb 28 2008, 11:39 AM
Post #11



Group Icon

Group: Member
Posts: 1
Type: None
RM Skill: Undisclosed




I am having an error in the line 83 when I try to use that script with only 1 character...
how to solve this problem?


*sry my poor english*
Go to the top of the page
 
+Quote Post
   
Ty
post Feb 28 2008, 11:50 AM
Post #12


Level 38
Group Icon

Group: +Gold Member
Posts: 1,007
Type: Scripter
RM Skill: Undisclosed




I have a link to all of my scripts in my signature, RMVX or otherwise. So click that next time a link is broken.

@Xiguinho: Don't attempt to add/remove points for characters that are not there.
The syntax to modify a actors points is:
CODE
$alignment.add(value, party_member)

So if you wanted to add 5 points on the first party member you would use:
CODE
$alignment.add(5, 0)

However, if you attempt to add points to the second party member, but there is no one there, you will get a nil? error.


__________________________
My Script Demo link broken? Looking for old scripts? Go here:
http://synthesize.4shared.com
Go to the top of the page
 
+Quote Post
   
Ty
post Mar 1 2008, 07:57 PM
Post #13


Level 38
Group Icon

Group: +Gold Member
Posts: 1,007
Type: Scripter
RM Skill: Undisclosed




Update! Released the Alignment management patch which should increase the effectiveness of the $alignment global variable. A new demo has also been uploaded.


__________________________
My Script Demo link broken? Looking for old scripts? Go here:
http://synthesize.4shared.com
Go to the top of the page
 
+Quote Post
   
calva64
post Mar 4 2008, 10:57 AM
Post #14


Level 2
Group Icon

Group: Member
Posts: 24
Type: Event Designer
RM Skill: Advanced




Hi Synth,

Great script, I found a typo though in the Remove_Points DEF alignment is mispelled.


__________________________
Go to the top of the page
 
+Quote Post
   
Ty
post Mar 4 2008, 04:06 PM
Post #15


Level 38
Group Icon

Group: +Gold Member
Posts: 1,007
Type: Scripter
RM Skill: Undisclosed




CODE
def remove_points(value, member)


That is spelt wrong?


__________________________
My Script Demo link broken? Looking for old scripts? Go here:
http://synthesize.4shared.com
Go to the top of the page
 
+Quote Post
   
kabuto202
post Mar 5 2008, 06:08 AM
Post #16


RAGNYAAA!!! *STAB STAB STAB*
Group Icon

Group: Revolutionary
Posts: 386
Type: Event Designer
RM Skill: Skilled




This is excellent... This will work extremely well for me... However since I can't see the demo, is there like an alignment bar in the menu or as a HUD piece. If not please insert one.


__________________________
A Lesson in Scope

The guy who doesn't care if he's the bearer of bad news.

"If you're gonna do something, do it right." -My father.


Freelance Web designer for hire.

Doing low rate web design, contact me if you're interested. Costs that are not included in my rate are: Hosting, Domain, and advertising.

Doing low rate logo designs, contact me for information.

Prices of rates go down based on how many USEFUL premade graphics you provide me with.
Go to the top of the page
 
+Quote Post
   
Ty
post Mar 5 2008, 06:48 AM
Post #17


Level 38
Group Icon

Group: +Gold Member
Posts: 1,007
Type: Scripter
RM Skill: Undisclosed




QUOTE (kabuto202 @ Mar 5 2008, 06:15 AM) *
This is excellent... This will work extremely well for me... However since I can't see the demo, is there like an alignment bar in the menu or as a HUD piece. If not please insert one.


It draws the alignment level (Neutral, Evil, Good, etc) in Scene_Status


__________________________
My Script Demo link broken? Looking for old scripts? Go here:
http://synthesize.4shared.com
Go to the top of the page
 
+Quote Post
   
zeblade
post Mar 6 2008, 04:54 AM
Post #18


Level 2
Group Icon

Group: Member
Posts: 20
Type: None
RM Skill: Undisclosed




I downloaded the demo and when I tried putting points down, it gave me an error and shut down the game.
Go to the top of the page
 
+Quote Post
   
kabuto202
post Mar 6 2008, 01:50 PM
Post #19


RAGNYAAA!!! *STAB STAB STAB*
Group Icon

Group: Revolutionary
Posts: 386
Type: Event Designer
RM Skill: Skilled




Yeah same error as the dude above me sad.gif


__________________________
A Lesson in Scope

The guy who doesn't care if he's the bearer of bad news.

"If you're gonna do something, do it right." -My father.


Freelance Web designer for hire.

Doing low rate web design, contact me if you're interested. Costs that are not included in my rate are: Hosting, Domain, and advertising.

Doing low rate logo designs, contact me for information.

Prices of rates go down based on how many USEFUL premade graphics you provide me with.
Go to the top of the page
 
+Quote Post
   
Puppet Of Fate
post Mar 8 2008, 07:54 PM
Post #20


Please join my site!
Group Icon

Group: Revolutionary
Posts: 675
Type: Mapper
RM Skill: Advanced




Okay if this works then you are my hero.


__________________________
Go to the top of the page
 
+Quote Post
   

2 Pages V   1 2 >
Closed TopicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 22nd May 2013 - 05:56 AM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker