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

31
I was trying to change the price of an item in my script Max Limit Breaker and for some reason the price still stays at the default price. I was wondering if I wrote this correctly.
module Warrior_Engine
 module CORE
# This hash allows you to adjust the individual item price. This allows you
# to go past the original editor limit of 999,999 gold for a single item.
CUSTOM_PRICES ={
:item => {1 => 9999999999, 30 => 123456789999},
:weapon => {},
:armor => {},
}

end
end
module RPG
class Item
include Warrior_Engine::CORE
custom_prices = CUSTOM_PRICES[:item][@id]
@price = custom_prices.nil? ? 0 : custom_prices
end
class Weapon
include Warrior_Engine::CORE
custom_prices = CUSTOM_PRICES[:weapon][@id]
@price = custom_prices.nil? ? 0 : custom_prices
end
class Armor
include Warrior_Engine::CORE
custom_prices = CUSTOM_PRICES[:armor][@id]
@price = custom_prices.nil? ? 0 : custom_prices
end
end
32
Script Troubleshooting / [RESOLVED][RGSS] Shorting code
January 01, 2013, 08:00:55 pm
Okay so I was writing my script to day, which I've finish except for this part, and then I got stuck so I left it until the end. Well it's the end and now I need help and this is the question. While I was writing my shop base script I've notice that this appears multiple times:

		case item
when RPG::Item then number = $game_party.item_number(item.id)
when RPG::Weapon then number = $game_party.weapon_number(item.id)
when RPG::Armor then number = $game_party.armor_number(item.id)
end


I tried simplifing it by applying it to Game_Party like in VX but I ran into several issues. In the buy part, number in possesion # doesn't increase. In the sell part, it doesn't display of items you have. When selling the item, you can't increase amount of items to be sold. Besides this set back the script is pretty much done.

Here an example of what I'm talking about.

Simple Script
33
RMXP Script Database / [XP] Scene_Biography
December 29, 2012, 04:08:21 pm
Scene_Biography
Authors: Bigace360
Version: 3.1
Type: Actor Biography
Key Term: Misc Add-on



Introduction
This is a script that calls a window that displays different aspects about a character... like their age, height, gender etc. These can be changed though. This script is free to use and edit as long as credit is given to me.



Features
Shows actors characteristic stats and battler image or imported image. Can also add a background to it now.



Screenshots

Spoiler: ShowHide




Script




Instructions
Insert this script above main, and call it Scene_Biography. Everything is in the module so there's no need to go any further down unless you know what your doing. Also as default, the script uses the battlers set in the database unless you place a image in the picture folder and place _P at the end of the files name.



Compatibility
Requires Scene_Base

scripts that may conflict with this Engine are stated in the comments in the SECTIONS.



Credits and Thanks


  • Bigace360, for the script.


34
Okay as the title says I'm having trouble applying the gsub method to what I'm trying to do.

Scene_Base
Biography Script [Removed Link]

When I try applying it, it works for the other two methods as they only had a string. However I guess since this is a array of items it doesn't work the same way as the others and since this is my first time applying it I'm kind of having trouble getting this to work. This is the error that is producing when I use this code.

QuoteScript 'Scene_Biography v3.0' line 86 NoMethod Error occurred.
private method 'gsub!' called for #<Array:ox32ccbe0>
35
RMXP Script Database / [XP] ACE Menu Engine
December 27, 2012, 01:57:34 pm
ACE Menu Engine
Authors: Bigace360
Version: 1.40
Type: ACE Custom Menu System
Key Term: Custom Menu System



Introduction
With this script, you can add, remove, and rearrange menu commands as you see fit. In addition to that, you can add in menu commands that lead to common events or even custom commands provided through other scripts.

This script also provides window appearance management such as setting almost all command windows to be center aligned or changing the position of the help window.



Features


  • Debug Shortcuts (Only during $DEBUG and $BTEST mode)

  • Moving Backgrounds

  • Add and removing scenes can be down easily now through the module without having to reconfigure the menu.

  • You can now have moving battlers in the menu.




Screenshots

Spoiler: ShowHide









Script




Instructions
To install this script, open up your script editor and copy/paste this script to an open slot below Scene_Debug, and Warrior_Engine, but above Main. Considering the special nature of this script, unless I state otherwise, it is  highly recommended that you place this script above all non-core scripts. Remember to save.

Scroll down and edit the module as you see fitting for your game.



Compatibility
Requires Scene_Base

Scripts that are compatibily with the Engine:
Bestiary
Scene_Biography
Scene_RowChanger

scripts that may conflict with this Engine are stated in the comments in the SECTIONS.



Credits and Thanks


  • Bigace360, for the script.



36
RMXP Script Database / [XP] Bestiary
December 27, 2012, 03:20:58 am
Bestiary
Authors: Bigace360
Version: 3.1
Type: Enemy Catalogue Display
Key Term: Player / Party / Troop Add-on



Introduction
This script will allow your characters to retrieve information about enemies they gained during battle.



Features


  • Animated battler graphic in the bestiary that you can move left to right

  • Allows you to rebattle an enemy

  • five Pages; Status - Skills - Bio - Battle Tactics - Test Battle

  • Show enemy Description text

  • While in the Status section use LEFT/RIGHT/UP/DOWN to navigate




Screenshots

Spoiler: ShowHide








Script




Instructions
Inside the script in the first comment.



Compatibility
Requires Scene_Base

This is an Advisory for those of you using multiple scripts. If you are using other scripts that rewrite the same classes or methods as this one, there may be a conflict and things will work incorrectly in unpredictable ways.

This script automatically adds itself to the default menu if you turn that feature on in the module.



Credits and Thanks


  • Bigace360, for the script.

  • Blizzard (Bitmap.Slice_text method)

  • Kellessdee, for helping me add the conditions to the Bestairy

  • Night_Runner, for helping fix a couple of things I was having trouble with




Author's Notes
If you have any suggestion to add to the Monster Album, don't hestitate to ask. But just know that there's a chance that it won't be added.
37
How do you call actor.id in Window_MenuStatus, the game crashes when I try to call it like name and class_id. I just notice that it's not a variable like the latters so won't work the same as them.
38
Okay for this should of been quick, issue I can't seem to get rid of this error:

QuoteScript 'Game_Actor' line 16: NoMethodError occurred.
undefined method 'nonresistance' for nil:NilClass


In Window_StatusItem, the issue seems to be coming from the first array in the draw_status_resistances method, apparently the @actor.state_probability(i) from the draw_status_list method doesn't like something from $data_states.name which causes the crash. I've been stuck on this for a day in a half now and this is practically the only thing holding me back. The results is supposed to show a list of states the game has and the only issue is getting the rank percentages to appear.

Script:
Spoiler: ShowHide
class Game_Actor < Game_Battler
 def state_probability(state_id)
   if $data_states[state_id].nonresistance
     return 100
   else
     rank = $data_classes[@class_id].state_ranks[state_id]
     return [0,100,80,60,40,20,0][rank]
   end
 end
end
class Window_StatusItem < Window_Base
def draw_status_resistances
@pages = []; lines = []; @spacing = 24
AFFINITIES[:states_shown].each do |i|
state = $data_states[i].name
state.each {|line| lines << line}
end
page_numbers = (lines.size / 22) + 1
page_numbers.times {|i| @pages[i] = lines[i*22, 22]}
states_text
end
def states_text
contents.clear
draw_background
draw_status_header(:states_title)
draw_states_list
end
def draw_states_list
dx = 48; dy = 48; dw = calc_ele_width(AFFINITIES[:states_shown])
page = @pages[@page_number - 1]
page.each_index do |i|
rect = item_rect(i)
dx2 = rect.x += dx; rect.y += dy
next if page[i].nil?
begin
draw_icon(page[i], rect.x, rect.y)
rescue
end
contents.font.color = normal_color; contents.font.size = Font.default_size
rect.x += 26; rect.width += dw+20
contents.draw_text(rect, page[i])
contents.font.color = rank_colour(@actor.state_probability(i))
resist = sprintf("%d%%", @actor.state_probability(i))
contents.font.size = 16
contents.draw_text(dx2+dx+44+dw, rect.y, 60, 24, resist, 2)
end
page_footer
end
def rank_colour(amount)
if amount > 100;   AFFINITIES[:rank_colour][:srank]
elsif amount > 80; AFFINITIES[:rank_colour][:arank]
elsif amount > 60; AFFINITIES[:rank_colour][:brank]
elsif amount > 40; AFFINITIES[:rank_colour][:crank]
elsif amount > 20; AFFINITIES[:rank_colour][:drank]
elsif amount > 0;  AFFINITIES[:rank_colour][:erank]
else AFFINITIES[:rank_colour][:frank]
end
end
def calc_state_width(states)
return $game_temp.status_st_width if !$game_temp.status_st_width.nil?
n = 0
states.each do |state_id|
next if $data_states[state_id].nil?
n = [n, contents.text_size($data_states[state_id].name).width].max
end
$game_temp.status_st_width = n
return n
end
end
39
Okay so the issue I'm having is when you select an enemy (that isn't the first enemy) to look at its status, then try to scroll through the other enemies it won't scroll in the correct order. Plus when you try to go back to the main enemy page from the status window and your on the last enemy with a bunch of unknown enemies in between, it will go to another enemy instead of the one you just on. (ex. I was viewing enemy 32's status, then went back and it sent me to enemy 10 instead of showing me 32 on the main page.)

Hopefully that made sense, I can show a video in the morning, if that was to confusing. Whatever is going on with the scrolling is the last issue I'm having. The link to my script is below.

Link: Removed
40
Okay so I was trying to simplify my code:

Old Code:
	def draw_enemy_hp(enemy, x, y, hidden)
colour = STAT_BAR_COLOURS[:hp_bar]
draw_enemy_bar(x, y, 120, 10, enemy.maxhp, ENEMY_STATS[:maxhp], colour)
contents.font.color = system_color
contents.draw_text(x, y-22, 24, 32, "#{$data_system.words.hp}:")
contents.font.color = normal_color
rect = Rect.new(x + 24, y-22, 72, 32)
unless hidden
contents.draw_text(rect, enemy.maxhp.group)
else
contents.draw_text(rect, '???')
end
end
def draw_enemy_sp(enemy, x, y, hidden)
colour = STAT_BAR_COLOURS[:hp_bar]
draw_enemy_bar(x, y, 120, 10, enemy.maxsp, ENEMY_STATS[:maxsp], colour)
contents.font.color = system_color
contents.draw_text(x, y-22, 24, 32, "#{$data_system.words.sp}:")
contents.font.color = normal_color
rect = Rect.new(x + 24, y-22, 72, 32)
unless hidden
contents.draw_text(rect, enemy.maxhp.group)
else
contents.draw_text(rect, '???')
end
end


New Code:

DEF = [
['hp', :hp_bar, 'enemy.maxhp', :maxhp],
['sp', :sp_bar, 'enemy.maxsp', :maxsp],
]
(DEF.size).times do |i|
eval "def draw_enemy_#{DEF[i][0]}(enemy, x, y, hidden)
value = #{DEF[i][2]}
max = ENEMY_STATS[#{DEF[i][3]}]
draw_enemy_bar(x, y, 120, 10, value, max, STAT_BAR_COLOURS[#{DEF[i][1]}])
contents.font.color = system_color
contents.draw_text(x, y-22, 24, 32, $data_system.words.#{DEF[i][0]})
contents.font.color = normal_color
rect = Rect.new(x + 24, y-22, 72, 32)
unless hidden
contents.draw_text(rect, #{DEF[i][2]}.group)
else
contents.draw_text(rect, '???')
end
end"
end


And for some reason I kept getting an error, well to my eyes I don't really see how I'm getting this error. So if anyone else can help spot it that would be great. If you need anymore info I'll post it.
41
So while I was updating my Bestiary Script, I ran into this error while I was trying to create a

way into text files into my code.

module ACE
module Bestiary
def self.get_text(mode, file_id)
# Opens a text document, makes an array whose elements consist of the

lines
# of the document, and returns it.
case mode
when 0 then filename = "Data/Bio/#{file_id}.txt"
when 1 then filename = "Data/Battle/#{file_id}.txt"
end
begin
file = File.open(filename, 'r')
rescue
case mode
when 0 then return 'A fearsome foe'
when 1 then return 'No battle data found'
end
end
book = []
file.each_line {|line| book << line}
file.close
return book
end
end
end

As you see in this code, its function is to open text files in either the Bio or Battle folders

and if the file doesn't exist, then it would print the strings instead.

class Window_BestiaryStatus < Window_Base
def draw_enemy_bio
refresh
unless $game_album.enemy_blacklisted?(@enemy.id)
2.times {|i| draw_horz_line(15+(i*200),self.width)}
self.contents.font.color, self.contents.font.size = system_color, 20
self.contents.draw_text(x=4, 25, self.width, 32, ALBUM_VOCAB

[:biography], 0)
self.contents.draw_text(x, 225, self.width, 32, ALBUM_VOCAB[:tactics],

0)
draw_bio_info(x, 50, normal_color)
draw_ability_info(x, 250, normal_color)
else
draw_horz_line(15, self.width)
fontsize = self.contents.font.size = 50
self.contents.draw_text(0, 64, 600, fontsize, BLACKLIST_QUOTE)
end
end
def draw_bio_info(x, y, color)
contents.font.color, contents.font.size = color, 18
text = contents.slice_text(ACE::Bestiary.get_text(0, @enemy.id), 588)
text.each_index {|i| contents.draw_text(x, (y)+i*20, 604, 32, text[i],

BIO_ALIGN)}
end
def draw_ability_info(x, y, color)
contents.font.color, contents.font.size = color, 18
text = contents.slice_text(ACE::Bestiary.get_text(1, @enemy.id), 588)
text.each_index {|i| contents.draw_text(x, (y)+i*20, 604, 32, text[i],

SKILL_ALIGN)}
end
end

This script is where the get_text goes to from the module above. Here it's supposed to input

the opened text file and display it on the screen from methods draw_bio_info and

draw_ability_info. The error is coming from the Bitmap.slice_text message which I'm about to

get to.


class Bitmap
 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Slice Text Method
# Author: Blizzard
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def slice_text(text, width)
words = text.split(' ')
return words if words.size == 1
result, current_text = [], words.shift
words.each_index do |i|
if self.text_size("#{current_text} #{words[i]}").width > width
result << current_text
current_text = words[i]
else current_text = "#{current_text} #{words[i]}"
end
result << current_text if i >= words.size - 1
end
return result
end
end

This script is blizzards slice_text method, where it breaks the paragraph to new lines, and

this is where the error is coming from.

Okay for the actually issue, for some reason whenever I try to get the script to open a text file I get this error.



However, if I was just to input a string, I don't get this error. I'm most likely doing something wrong with the input, but I can't really tell, so I need another set of eyes to show me how to fix this error that might just be pretty obvious.

If anymore info is need I'll post it.
42
Just recently it started having problems. It won't play any type of music
file, when I go to play a song it will say "Windows Media Player encountered
a problem while playing the file. For additional assistance, click Web Help.

Ok so I click web help and it takes me to this page

https://www.microsoft.com/windows/wi...nalid=80004005

My audio drivers are up to date and everything is working fine I don't
understand what could be causing this.

Note: It works on sound and other stuff works on everything else, just the WMP encountering problems.
43
Special Elements Script
Authors: Bigace
Version: 1.0
Type: Special Element-Add-on
Key Term: Add-on Collection



Introduction

First ever script done by me(bigace) and probably my last until my first game is done. This script allows it so for only certain enemies to be hurt by certain elements. Mostly for items that are supposed to target a certain type of enemy. Like If you have a Item called 'Dragoon Slayer'. That Item should only hurt dragons, other enemies would be uneffected by this item. You can do the same with skills to.


Screenshots

None needed....


Demo

If you need one, I'll make one for you.


Script

Spoiler: ShowHide
Quote#==============================================================================
#Special Elements
#By Bigace
#==============================================================================
=begin
This script allows it so for only certain enemies to be hurt by certain elements.
Mostly for items that are supposed to target a certain type of enemy. Like If you
have a Item called 'Dragoon Slayer'. That Item should only hurt dragons, other
enemies would be uneffected by this item. You can do the same with skills to.

In the Database Under 'Items' add the type of element, most preferably an animal
type like demon or dragon, and then in this script add the monster ID for the
one that certain element works on.
=end
#-----------------------------------------
$special_elements = {
#Element_ID => [Enemy_ID],

  10 => [3, 7, 12], #element 10 only works against monsters 3, 7 and 12
  11 => [6, 14], #element 11 only works against monsters 6 and 14
}
#-----------------------------------------
# Don't Not Touch Below
#-----------------------------------------
class Game_Enemy
  alias special_element_rate element_rate
  def element_rate(element_id)
    result = special_element_rate(element_id)
    if $special_elements.keys.include?(element_id)
      unless $special_elements[element_id].include?(@enemy_id)
        result = 0
      end
    end
    return result
  end
end




Instructions

Plugin above main and then in the Database Under 'Items' add the type of element to an Item your using against a enemy, most preferably an animal type like demon or dragon, and then in this script add the monster ID for the one that certain element works on.


Compatibility

It works on my game and I have a wall of scripts, only thing I can tell you that it might have trouble with the Game_Enemy,but that's about it.


Credits and Thanks


  • It's a very small script so need to credit but some feedback would be nice

44
Script Requests / [Resolved] Attacking SP
April 30, 2010, 09:57:02 pm
I'm wondering if someone can make a script that attacks the enemies SP instead of HP, since you can do that in the database.
45
I look all over the web and I couldn't find it, so here we go. I was trying to get a script like in SO3 & 4 that:
-Gives info of all the cities you've been to (or heard of); and
-All Important people that you've encountered (or heard of).
I already have a monster and item book so I didn't include it in the list. It would be really cool if some created it.  :^_^': :haha:

Thanks in Advance.