Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Topics - BetaGod

1
Script Requests / RMXP to RMVX script?
August 15, 2013, 10:36:28 pm
Sup' guys!

So a while ago, KK20 helped me with a script that allowed the player to see some basic performance info ingame.

Recently i got into RMVX and although i am know some coding, i am still not used to most of the new stuff in RGSS2.

So i was wondering if someone could adapt this RMXP script into RMVX (Mostly because i want to learn how would you guys do it).
I just need the "Game Stats" screen, and not the "Special Abilities" stuff, so it should be quite simple.

Spoiler: ShowHide
=begin
/////////////////////////////////////////////////////////////////////////////
Special Abilities and Stats Scenes                               May 2, 2013
By KK20
/////////////////////////////////////////////////////////////////////////////

[ Instructions ]
Configure the script below. Make your special abilities in the Skill tab of the
database. The script only requires that the skill have a name, icon, and
description--all other values do not matter.

To process an event after using a special ability, use the script call:
      used_ability(id)
where 'id' is the ID of the skill in the database. It works much in the same
way as G_G's Key Items script.

To add/remove special abilities to the party:
      $game_party.add_ability(id)
      $game_party.remove_ability(id)

To call upon the 'Jobs' scene, use
      $scene = Scene_SpecialAbilities.new
To call upon the 'Statistics' scene, use
      $scene = Scene_Statistics.new
You will have to manually add these lines to your Scene_Menu class if you wish
to access them in the game menu.
     
=end
#=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
# C O N F I G U R A T I O N
#=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
# Input key to bring up the Special Abilities window on map
USE_SPECIAL_ABILITY_KEY = Input::X
# Return index to Menu screen when exiting 'Jobs'
JOBS_MENU_INDEX = 2
# Return index to Menu screen when exiting 'Statistics'
STATS_MENU_INDEX = 3
# The names of the five traits drawn in the 'Statistics' window. The names
# should be the same as the graphic files located in the \Pictures folder.
FIVE_MASTERIES = ['Alignment','Discretion','Conjuration','Alteration','Inquisition']
# Input the variables used to store the player's mastery levels.
# Please put them in quotes to prevent startup errors
MASTERY_VAR = ['$game_party.alignment','$game_party.discretion','$game_party.conjuration','$game_party.alteration','$game_party.inquisition']

STAT_RECORDS = [
# Used in 'Statistics'. Draws the player's records.

# Configure setup:
# [Description of record, Variable called to display, (optional) Total Number]

# If 'Total Number' is specified, draws a '/' in between the two values.
# If 'Total Number' is a decimal value, the game will create a percentage.
# If using game variables, please put them in quotes to prevent startup errors.
['Enemies defeated:', "$game_party.actors.size"],
['Bosses killed:', '$game_variables[20]'],
['Total party deaths:', '$game_party.death_count'],
['Quests completed:', '$game_party.completed_quests', 200],
['Number of saves:', '$game_system.save_count'],
['Percent complete:', '$game_system.percent_complete', 100.0]
#=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
# E N D    O F    C O N F I G U R A T I O N
#=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
]

#==============================================================================
# ** Game_Party
#------------------------------------------------------------------------------
#  Creates a special abilities array and defines methods for adding/removing
#==============================================================================
class Game_Party
  attr_reader :special_abilities
 
  alias init_special_abilities initialize
  def initialize
    @special_abilities = []
    init_special_abilities
  end
 
  def add_ability(id)
    @special_abilities.push(id) unless @special_abilities.include?(id)
  end
 
  def remove_ability(id)
    @special_abilities.delete(id)
  end
 
end
#==============================================================================
# Interpreter (Edit)
#------------------------------------------------------------------------------
#  Added the method "used_ability(id)"
#==============================================================================
class Interpreter
  def used_ability(id)
    flag = id == $game_temp.ability_id
    $game_temp.ability_id = 0
    return flag
  end
end
#==============================================================================
# Scene_Map (Edit)
#------------------------------------------------------------------------------
#  Modified to add Window_SpecialAbility_Map
#==============================================================================
class Scene_Map
  #----------------------------------------------------------------------------
  # Initializes Map
  #----------------------------------------------------------------------------
  alias create_special_abilities_win main
  def main
    @spcabl_window = Window_SpecialAbility_Map.new
    create_special_abilities_win
    @spcabl_window.dispose
  end
  #----------------------------------------------------------------------------
  # Updates Map
  #----------------------------------------------------------------------------
  alias update_special_abilities_win update
  def update
    @spcabl_window.update
    update_special_abilities_win
  end
end
#==============================================================================
# Game_Temp
#------------------------------------------------------------------------------
#  Added @ability_id to keep track of used special ability
#==============================================================================
class Game_Temp
  attr_accessor :ability_id
end

#==============================================================================
# Window_SpecialAbility_Map
#------------------------------------------------------------------------------
#  On map window to display "special abilities" that can be used with events
#==============================================================================
class Window_SpecialAbility_Map < Window_Selectable
  #----------------------------------------------------------------------------
  # Creates Window
  #----------------------------------------------------------------------------
  def initialize
    super(220, 304, 200, 160)
    @column_max = 1
    self.back_opacity = 160
    self.active = false
    self.visible = false
    refresh
    @menu_disabled = $game_system.menu_disabled
  end
  #----------------------------------------------------------------------------
  # Updates Window
  #----------------------------------------------------------------------------
  def update
    super
    $game_system.menu_disabled = @menu_disabled
    if Input.trigger?(Input::C) && self.active
      $game_system.se_play($data_system.decision_se)
      self.active = false
      self.visible = false
      $game_temp.ability_id = selected_item.id
      $game_temp.message_window_showing = false
      return
    elsif Input.trigger?(USE_SPECIAL_ABILITY_KEY) &&
        !$game_temp.message_window_showing &&
        !$game_system.map_interpreter.running?
      $game_system.se_play($data_system.decision_se)
      refresh
      self.index = 0
      self.active = true
      self.visible = true
      $game_temp.message_window_showing = true
      return
    elsif Input.trigger?(Input::B) && self.active
      $game_system.se_play($data_system.cancel_se)
      self.active = false
      self.visible = false
      $game_temp.message_window_showing = false
      @menu_disabled = $game_system.menu_disabled
      $game_system.menu_disabled = true
    end
  end
  #----------------------------------------------------------------------------
  # Refreshes Window
  #----------------------------------------------------------------------------
  def refresh
    if self.contents != nil
      self.contents.dispose
      self.contents = nil
    end
    @items = []
    $game_party.special_abilities.each{|ability|
      @items.push($data_skills[ability])
    }
    @item_max = @items.size
    if @item_max > 0
      self.contents = Bitmap.new(width - 32, row_max * 32)
      for i in 0...@item_max
        draw_item(i)
      end
    end
  end
  #----------------------------------------------------------------------------
  # Draws Item
  #----------------------------------------------------------------------------
  def draw_item(index)
    skill = @items[index]
    x = 4
    y = index * 32
    rect = Rect.new(x, y, self.width, 32)
    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
    bitmap = RPG::Cache.icon(skill.icon_name)
    self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24))
    self.contents.draw_text(x + 28, y, 200, 32, skill.name, 0)
  end
  #----------------------------------------------------------------------------
  # Returns Selected Item
  #----------------------------------------------------------------------------
  def selected_item
    return @items[self.index]
  end
end
#==============================================================================
# ** Window_SpecialAbility_Menu
#------------------------------------------------------------------------------
#  This window displays party's special abilities
#==============================================================================
class Window_SpecialAbility_Menu < Window_Selectable
  #--------------------------------------------------------------------------
  # * Object Initialization
  #     actor : actor
  #--------------------------------------------------------------------------
  def initialize
    super(0, 64, 640, 416)
    @column_max = 2
    refresh
    self.index = 0
  end
  #--------------------------------------------------------------------------
  # * Acquiring Skill
  #--------------------------------------------------------------------------
  def skill
    return @data[self.index]
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    if self.contents != nil
      self.contents.dispose
      self.contents = nil
    end
    @data = []
    $game_party.special_abilities.each{|ability|
      @data.push($data_skills[ability])
    }
    # If item count is not 0, make a bit map and draw all items
    @item_max = @data.size
    if @item_max > 0
      self.contents = Bitmap.new(width - 32, row_max * 32)
      for i in 0...@item_max
        draw_item(i)
      end
    end
  end
  #--------------------------------------------------------------------------
  # * Draw Item
  #     index : item number
  #--------------------------------------------------------------------------
  def draw_item(index)
    skill = @data[index]
    x = 4 + index % 2 * (288 + 32)
    y = index / 2 * 32
    rect = Rect.new(x, y, self.width / @column_max - 32, 32)
    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
    bitmap = RPG::Cache.icon(skill.icon_name)
    self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24))
    self.contents.draw_text(x + 28, y, 204, 32, skill.name, 0)
  end
  #--------------------------------------------------------------------------
  # * Help Text Update
  #--------------------------------------------------------------------------
  def update_help
    @help_window.set_text(self.skill == nil ? "" : self.skill.description)
  end
end

#==============================================================================
# ** Scene_SpecialAbilities
#------------------------------------------------------------------------------
#  This class processes the special abilities scene
#==============================================================================
class Scene_SpecialAbilities
  #--------------------------------------------------------------------------
  # * Main Processing
  #--------------------------------------------------------------------------
  def main
    # Make help window, status window, and skill window
    @help_window = Window_Help.new
    @skill_window = Window_SpecialAbility_Menu.new
    # Associate help window
    @skill_window.help_window = @help_window
    # Execute transition
    Graphics.transition
    # Main loop
    loop do
      # Update game screen
      Graphics.update
      # Update input information
      Input.update
      # Frame update
      update
      # Abort loop if screen is changed
      if $scene != self
        break
      end
    end
    # Prepare for transition
    Graphics.freeze
    # Dispose of windows
    @help_window.dispose
    @skill_window.dispose
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    # Update windows
    @help_window.update
    @skill_window.update
    # call update_skill
    update_skill
  end
  #--------------------------------------------------------------------------
  # * Frame Update (if skill window is active)
  #--------------------------------------------------------------------------
  def update_skill
    # If B button was pressed
    if Input.trigger?(Input::B)
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      # Switch to menu screen
      $scene = Scene_Menu.new(JOBS_MENU_INDEX)
      return
    end
  end
end
#==============================================================================
# ** Window_Statistics
#------------------------------------------------------------------------------
#  This window displays party's accomplishments and traits
#==============================================================================
class Window_Statistics < Window_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #     actor : actor
  #--------------------------------------------------------------------------
  def initialize
    super(0, 0, 640, 480)
    self.contents = Bitmap.new(width-32, height-32)
    refresh
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    # Draw title
    self.contents.font.size = 50
    self.contents.draw_text(0,0,640,60,"Game Stats",1)
    # Draw accomplishments/statistics
    self.contents.font.size = 18
    index = 0
    x,y = 0,40
    STAT_RECORDS.each{|data|
      record = data[0]
      value = data[1].is_a?(String) ? eval(data[1]) : data[1]
      total = data[2].is_a?(String) ? eval(data[2]) : data[2]
      # If display percentage
      value /= total if total != nil and total.is_a?(Float)
      string = record + ' ' + value.to_s
      string += '%' if total.is_a?(Float)
      string += ' / ' + total.to_s if total.is_a?(Integer)
      a = index % 2 == 0 ? 0 : 2
      self.contents.draw_text(x + 320*(index%2),y + 24*(index/2),320-32,32,string,a)
      index += 1
    }
    # Draw Alignment
    self.contents.font.size = 28
    img = RPG::Cache.picture(FIVE_MASTERIES[0])
    self.contents.blt(170,30+40,img,Rect.new(0,0,img.width,img.height))
    self.contents.draw_text(245, 160+40, 150, 40, FIVE_MASTERIES[0], 1)
    c1,c2,c3= Color.new(255,55,0),Color.new(185,25,0),Color.new(0, 0, 0)
    rate = (eval(MASTERY_VAR[0]) / 100.0).abs
    self.contents.gradient_bar(220, 185+40, 200, c1, c2, c3, rate)
    case eval(MASTERY_VAR[0]) <=> 0
    when -1 then str = 'Evil'
    when 0 then str = 'Neutral'
    when 1 then str = 'Good'
    end
    self.contents.draw_text(220,265,200,40,str, 1)
    self.contents.draw_text(220,295,200,40,'Lv. ' + eval(MASTERY_VAR[0]).to_s, 1)
    # Draw the 4 mastery symbols
    x = 4
    y = 300 #260
    FIVE_MASTERIES.each{|trait|
      # Skip the first mastery (which should be alignment)
      next if FIVE_MASTERIES.index(trait) == 0
      self.contents.font.size = 18
      img = RPG::Cache.picture(trait)
      dest_rect = Rect.new(x,y,img.width/2,img.height/2)
      self.contents.stretch_blt(dest_rect,img,Rect.new(0,0,img.width,img.height))
      self.contents.draw_text(x+25, y+110, 100, 32, trait, 1)
      # Determine gradient bar colors
      case x/150
      when 0 # Discretion
        c1 = Color.new(0, 240, 0)
        c2 = Color.new(0, 70, 0)
      when 1 # Conjuration
        c1 = Color.new(0, 240, 0)
        c2 = Color.new(0, 70, 0)
      when 2 # Alteration
        c1 = Color.new(0, 240, 0)
        c2 = Color.new(0, 70, 0)
      when 3 # Inquisition
        c1 = Color.new(0, 240, 0)
        c2 = Color.new(0, 70, 0)
      end
      rate = (eval(MASTERY_VAR[x/150+1]) / 100.0)
      self.contents.gradient_bar(x+25, y+78, 100, c1, c2, c3, rate)
      self.contents.font.size = 22
      self.contents.draw_text(x+25,y+88,100,28,eval(MASTERY_VAR[x/150+1]).to_s,1)
      x += 150
    }
  end
end
#==============================================================================
# ** Scene_Statistics
#------------------------------------------------------------------------------
#  This class performs statistics processing.
#==============================================================================
class Scene_Statistics
  #--------------------------------------------------------------------------
  # * Main Processing
  #--------------------------------------------------------------------------
  def main
    # Make statistics window
    @status_window = Window_Statistics.new
    # Execute transition
    Graphics.transition
    # Main loop
    loop do
      # Update game screen
      Graphics.update
      # Update input information
      Input.update
      # Frame update
      update
      # Abort loop if screen is changed
      if $scene != self
        break
      end
    end
    # Prepare for transition
    Graphics.freeze
    # Dispose of windows
    @status_window.dispose
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    # If B button was pressed
    if Input.trigger?(Input::B)
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      # Switch to menu screen
      $scene = Scene_Menu.new(STATS_MENU_INDEX)
      return
    end
  end
end


Thanks in advance!
2
I am not sure how to define this, so i am sorry in advance for the ambiguous title.

I need a simple script that allows me to call a small window somewhere in the screen (by pressing X-key) containing certain abilities (note that this abilities must not appear in the characters "skills" sections. Theese are just... options to choose from). The window itself should not be designed to stop/slow/interrupt the player's actions, so it doesn't have to call a new scene when executed.

As the game progresses, the player unlocks new special abilities that appear in the desired window (Wich esentially are common event calls with custom names and icons).

This is exactly what i want, sort of. Except that i am alredy using that script and the displayed options cannot be items.

So, basically, the script must have the following available features:
-Create a small window somewhere when X button (Not A, not B, X. This is kinda imperative) is pressed, cotaining all available special abilities mastered so far. The window is designed to contain juts a few options (4-6 when all available), displaying only the ability name and its icon (no description, keep it simple).
-Add new special abilities by executing a script call.
-A custom script call that opens up a completely new window displaying learned special abilities with their respective descriptions. This is intended to be called from the menu, so the player can see in detail more about the abilities (i am thinking just icon + name + brief description).

Ever played Skyrim before? There was an option to "favorite" certain items/skills/whatever. When the player pressed a predefined key, the window would come up right there on the map (without entering a full screen menu), where he could choose something. Think of this request as that, but without the "favorite" thingy.

I know is quite simple and i've tried to make it myself, but either fails totally and crashes my game or doesn't work at all. Can't get used to RGSS yet  :<_<:

Also, if i didn't made myself clear, i'll be happy to elaborate. Anybody willing to help?  :haha:




3
So i have the Passive Augments script by Xelias and the Threat System one by Fantasist.

There seems to be a problem with Passive Augments that causes my actors to not gain any threat at all when dealing damage. Can anybody help me out to identify the problem and edit the script properly?
4
Sup, i was wondering if any of you have stumbled before into some of this skills:

Double Cast

QuoteCast two spells during the same turn

Works as a regular skill, though when selected, a new window draws for the user where he can choose spell #1 followed by spell #2. Character then proceeds to cast both spells if the entire mana cost is available.

Magic Frenzy

QuoteAllows user to use a spell then follow up with a regular attack

This is a quite interesting concept. Kinda usefull for thoose hard to create "Battlemages".
Figured out how to do this one via eventing because both gameus and Wizered67 are freaking awesome.

Turbo MP

QuoteDouble MP use to increase damage and accuracy of skills requiring it.

This is actually a passive skill, but i can see that working as a regular one if used same method as in Double Cast case (You select "Double MP", wich lets you choose the skill that will be used with the increased mp cost).
Found that here.

Cover

QuoteCovers a unit, allowing the user to take damage for the target until the user's next turn.

Okay, i saw people trying to make this before, but they all failed. It is simple, character with status cover recives damage for the unit covered if that unit is attacked before the cover status expiration.

Can anybody link me to this kind of abilities if they are already made? Can you try to make some of them on your own? Theese are all taken from the FF series, i think.
5
Hi guys, i am the new guy. Reading through the forum over months now i never found the need to actually register and participate (Just lazyness, i believe. Nothing to do with you guys). But today i have a special request. I really hope this forum still gets some action and activity!

Is it possible to use the EQUAP system made by Blizzard in his Tons of Addons script with the following modification?

I have a couple of scripts that allow the player to choose the class/job of his character trought the whole game. The point is, i also have the EQUAP system enabled and this problem keeps bugging my mind:

Lets say i have X sword in the game. Class 1 (Warrior) would learn a skill called "Slash Attack" from it, while Class 2 (Gladiator) would learn a skill called "Pyro Strike" from it. Problem is, the EQUAP system works with skill restriction ONLY via actors. This means that Class 1 (Warrior) will learn BOTH skills when equiping said sword.

My actors can choose to become Mages, Warriors, Gladiators or anything they want any time they want to. So skill learning without restrictions can get abused quite easily.

With the previous case in mind, i want the warrior guy to learn only his respective skill from X sword, not the Class 2 (Gladiator) one as well. Is there a modification for this? Can anyone help me out? Did i made my self clear? Thanks a lot in advance!  :haha: