RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
[RMVX] Good VS Evil

0 Members and 1 Guest are viewing this topic.

**
Rep:
Level 88
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.

Spoiler for The Script:
Code: [Select]
#===============================================================================
# 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
#===============================================================================

DEMO:
My Scripts

Comments? Concerns? Post them.
« Last Edit: May 04, 2008, 06:48:10 PM by Synthesize »

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
Really useful for freeform games

**
Rep:
Level 86
Hell Blade © 2008, All Rights Reserved
Nice work.







**
Rep:
Level 86
This script looks great, but I need to know, is there a way to set it up so that depending on the alignment events will say different things like there is some generic antagonist and if your alignment is evil then he will help you but if it is good then he will attack

**
Rep:
Level 86
how do you change the alignment?

**
Rep:
Level 87
In the end, we realize our insignificance.
This script looks great, but I need to know, is there a way to set it up so that depending on the alignment events will say different things like there is some generic antagonist and if your alignment is evil then he will help you but if it is good then he will attack
Yeah, I'd like to know this also. Cause without the feature of alignment changing events, it seems kind of useless.

**
Rep:
Level 87
In the end, we realize our insignificance.
Yeah there is actually XD I just realized it. In the demo the first guy said different things depending on how much goodness, evilness, or neutralness you had.  ;)

********
Shadow Knight
Rep:
Level 91
Ruin that brick wall!
Project of the Month winner for October 2008
Good script.
Gives more variety for types of games you want to make.
Be kind, everyone you meet is fighting a hard battle.

***
Rep:
Level 86
Yeah... about that.....
I keep getting an message that "Firefox can't establish a connection to the server at 204.191.115.42:43179" when I try to download the demo.

Is this just me?
This is a signature.

*
Resident Cloud
Rep:
Level 91
no its everyone synth appears to have the file on his own computer availible for downloading if his pc isnt online then you cannot download

***
Rep:
Level 86
Yeah... about that.....
So then, could someone upload it somewhere where it doesn't matter if Synth is on?

His and my online times don't seem to correlate.
This is a signature.

***
Rep:
Level 86
Yeah... about that.....
Sorry to double post, but I wanted to be sure this would show up...

you forgot a letter on line 47 of the Alignment_Patch script in the demo.

Code: [Select]
        $game_party.members[i].alignmnt -= value

should be

Code: [Select]
        $game_party.members[i].alignment -= value
« Last Edit: May 12, 2008, 04:14:37 PM by ceegamus »
This is a signature.

**
Rep: +0/-0Level 84
thanks will be useful for my Freeform Oblivion/Fable Style game.