Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

70 Pages V  « < 64 65 66 67 68 > »   
Reply to this topicStart new topic
> Submission: Blue Magic, by Prexus
Voidwalker
post Oct 1 2010, 08:33 PM
Post #1301



Group Icon

Group: Member
Posts: 4
Type: None
RM Skill: Intermediate




QUOTE (TimmahX @ Oct 1 2010, 07:24 PM) *
QUOTE (Voidwalker @ Oct 1 2010, 12:37 PM) *
Umm.. it s possible? Change the size of a Icon to make it more bigger in battle (Only Weapons)?
Need some help with this sweat.gif happy.gif wink.gif

Weapons for this Charas
[attachment=4021:_aatester.png]
unsure.gif


This should be in the script support section. However, if you are using the standard sideview script, just make an action sequence where the weapon size is scaled to whatever size you want (x2 I'd assume) in the configuration parts.



Please, explain me that sleep.gif
Go to the top of the page
 
+Quote Post
   
mattfriends
post Oct 7 2010, 05:38 AM
Post #1302


Level 3
Group Icon

Group: Member
Posts: 43
Type: Scripter
RM Skill: Advanced




Oh god!!! pinch.gif Taiine, why are you saying this in my threat!!!


__________________________
The new adventure - Real time action battle game.

Lastest Version - Demo v2.0

MY WEBSITE: I have moved to my website now. I'm not usually activate here anymore.

http://rpgxpultimate.darkbb.com/
Please register.
Go to the top of the page
 
+Quote Post
   
Taiine
post Oct 7 2010, 08:31 PM
Post #1303


Level 17
Group Icon

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




What? :/
You said you would update it later with the request I made on the 30th of aug..

Month later?

Still nothing.

NR was nice enough to provide with the exact update I and another were after... allowing me to continue on with making my game sense I rather not play catch up adding this to all my maps after they were already set up.

Tis all I'm saying :/

Think you should be thanking him for saving you the work :3


__________________________

an RMXP Game utilizing Blizz-ABS


Concept Projects: DASH! The Masters Game | Finny Adventures (temp title)
My first RMXP Script: Taiine's Solo Player Custom Menu System v0.6 (UPDATED 13th of Nov 10)

Go to the top of the page
 
+Quote Post
   
mattfriends
post Oct 8 2010, 05:21 AM
Post #1304


Level 3
Group Icon

Group: Member
Posts: 43
Type: Scripter
RM Skill: Advanced




I don't know what are you saying but I don't have time to continue the script. I'm working on my game.


__________________________
The new adventure - Real time action battle game.

Lastest Version - Demo v2.0

MY WEBSITE: I have moved to my website now. I'm not usually activate here anymore.

http://rpgxpultimate.darkbb.com/
Please register.
Go to the top of the page
 
+Quote Post
   
Taiine
post Oct 8 2010, 11:26 AM
Post #1305


Level 17
Group Icon

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




Okay... I don't see how you don't understand what I said.. but oh well.

If you were to busy to work on this, you should have said so rather then say you would do it later and make people hopefully wait for a change that wasn't going to come. :/


__________________________

an RMXP Game utilizing Blizz-ABS


Concept Projects: DASH! The Masters Game | Finny Adventures (temp title)
My first RMXP Script: Taiine's Solo Player Custom Menu System v0.6 (UPDATED 13th of Nov 10)

Go to the top of the page
 
+Quote Post
   
mattfriends
post Oct 8 2010, 06:38 PM
Post #1306


Level 3
Group Icon

Group: Member
Posts: 43
Type: Scripter
RM Skill: Advanced




So what does people want? I will do it and then I don't need to activate here again. (Maybe?)


__________________________
The new adventure - Real time action battle game.

Lastest Version - Demo v2.0

MY WEBSITE: I have moved to my website now. I'm not usually activate here anymore.

http://rpgxpultimate.darkbb.com/
Please register.
Go to the top of the page
 
+Quote Post
   
Taiine
post Oct 8 2010, 06:59 PM
Post #1307


Level 17
Group Icon

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




Night Runner had already done what we asked (and again, you should thank him for it, perhaps even add it to the first page) though if you want to add something to that..

You could add away to keep track of items/kills during quests. pick up x about of this or kill x amount of that and such.

Like Kill 5 Bats
Kill 3 Wolves

and have a command so when you do it adds to the quest total and when maxed shows that you finished killing/getting/whateever that part of the quest.


...and really, from what you said you never want to come back to this thread, posting a script, then pretty much abandoning it? That's not very nice :/


__________________________

an RMXP Game utilizing Blizz-ABS


Concept Projects: DASH! The Masters Game | Finny Adventures (temp title)
My first RMXP Script: Taiine's Solo Player Custom Menu System v0.6 (UPDATED 13th of Nov 10)

Go to the top of the page
 
+Quote Post
   
mattfriends
post Oct 8 2010, 07:07 PM
Post #1308


Level 3
Group Icon

Group: Member
Posts: 43
Type: Scripter
RM Skill: Advanced




No wait.. I just mean I don't have time. I'm busy. I need to work on my game.


__________________________
The new adventure - Real time action battle game.

Lastest Version - Demo v2.0

MY WEBSITE: I have moved to my website now. I'm not usually activate here anymore.

http://rpgxpultimate.darkbb.com/
Please register.
Go to the top of the page
 
+Quote Post
   
Kread-EX
post Oct 8 2010, 09:39 PM
Post #1309


(=___=)/
Group Icon

Group: +Gold Member
Posts: 4,136
Type: Scripter
RM Skill: Undisclosed




QUOTE (mattfriends @ Oct 9 2010, 04:38 AM) *
I will do it and then I don't need to activate here again. (Maybe?)

Considering the fact that you joined in July and only have 41 posts, you never really were active here at all. And in all honesty, you're not that much active on your own forum, where the only topic seemingly alive is the one asking for moderators.
What Taiine wants to make you understand is that it's kinda Night_Runner's job to support scripts when their authors stopped doing so - therefore don't whine about it.


__________________________
FRACTURE - a SMT inspired game (demo) made by Rhyme, Karsuman and me. Weep and ragequit.

My blog.

Click here for my e-peen


Go to the top of the page
 
+Quote Post
   
mattfriends
post Oct 9 2010, 04:37 AM
Post #1310


Level 3
Group Icon

Group: Member
Posts: 43
Type: Scripter
RM Skill: Advanced




Yeah, now I'm ativating on Pokecommunity's forum.


__________________________
The new adventure - Real time action battle game.

Lastest Version - Demo v2.0

MY WEBSITE: I have moved to my website now. I'm not usually activate here anymore.

http://rpgxpultimate.darkbb.com/
Please register.
Go to the top of the page
 
+Quote Post
   
Taiine
post Oct 9 2010, 06:41 AM
Post #1311


Level 17
Group Icon

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




I don't see why you wish to chose to be active on only one forum, I'm active on four and am just fine. Many are also actively working on games (like me) yet still can support scrips they had posted (again, like me).

Also... with how you seem to post then abandon? Advertising your forum, it almost felt that you tried to get members to your forum if they wanted support for your scripts. That honestly is a lousy way to get people to join your forum, and going by how dead it still is, it also not a very effective way either.

So you come back here and see NR or someone else picking up the slack YOU are suppose to be doing seeing how you clearly still pop back here from time to time... then don't whine about it. :/

You had a fantastic script here, one of the easier quest scrips I have see so fare where I actually threw out another I was using in favor for this, and you chose to abandon it/not support it anymore cause your 'busy' or you want people to sign up to your forum to get support.

That's cheezy.


__________________________

an RMXP Game utilizing Blizz-ABS


Concept Projects: DASH! The Masters Game | Finny Adventures (temp title)
My first RMXP Script: Taiine's Solo Player Custom Menu System v0.6 (UPDATED 13th of Nov 10)

Go to the top of the page
 
+Quote Post
   
Night_Runner
post Oct 9 2010, 07:31 AM
Post #1312


Level 50
Group Icon

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




Wow, leave you guys alone for a couple of days and this place gets a lot of activity smile.gif

@> Taiine: Glad I could help smile.gif

@> mattfriends: Thank you for your script, and I would like to wish you the best of luck on your game smile.gif If you want to stay active here, check out the Creative Commons and keep us updated with it smile.gif
Otherwise, this topic seems just about closed up happy.gif If you want it reopened, PM me

@> Kread-EX: Thanks


__________________________
K.I.S.S.
Want help with your scripting problems? Upload a demo! Or at the very least; provide links to the scripts in question.

Most important guide ever: Newbie's Guide to Switches
Go to the top of the page
 
+Quote Post
   
kyoryo
post Oct 10 2010, 01:48 AM
Post #1313



Group Icon

Group: Member
Posts: 4
Type: Scripter
RM Skill: Intermediate




nice share bro. i'd appreciate it.. : mage.gif thumbup:


__________________________
Go to the top of the page
 
+Quote Post
   
joey101
post Oct 10 2010, 01:55 PM
Post #1314


DeadlyWeapon6
Group Icon

Group: Revolutionary
Posts: 196
Type: Developer
RM Skill: Skilled




pretty kool but i dont really need it i rather have a 3 man CMS


__________________________
Go to the top of the page
 
+Quote Post
   
Kyo Panda
post Oct 10 2010, 02:01 PM
Post #1315



Group Icon

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




Scene ShopVariable
Author: Kyo Panda

Release in: October 04 of 2010 - Version: 1.1



About:
Introduces a shop in your game, but, instead of use money, the monetary unity is defined by a variable.

Special Thanks:
pedro_severo: For the idealization and improvements in script.

Setup:
• Paste the script above of ▼ Main Proccess below of ▼ Materials in the Script Editor of RPG Maker VX.
• Setup the script in guide Configuration in the script..

Utilization:
Use these codes with the Event Command Script in any event:

Codes
CODE
# • To define the shop's variable:
#   VShop.var = Variable ID
#
# • To turn on the function of shop by variables:
#   VShop.on
#
# • To turn off the function of shop by variables:
#   VShop.off
#
# • To change the symbol shown in the shop:
#   VShop.symbol = "Symbol"
#
# • To change the text of buy in the shop:
#   VShop.buy_string = "Text"
#
# • To change the text of sell in the shop:
#   VShop.sell_string = "Text"
#
# • To change the text of exit in the shop:
#   VShop.exit_string = "Text"
#
# • To show or not the symbol at side of the itens price when buying:
#   Define true to show and false to not show.
#   VShop.show_symbol = true / false
#
# • To hide the option of buying in shop:
#   Define true to hide and false to not hide.
#   VShop.hidden_buy = true / false
#
# • To hide the option of selling in shop:
#   Define true to hide and false to not hide.
#   VShop.hidden_sell = true / false


Script:
CODE
#======================================================================
========
# Scene_ShopVariable [VX]
#------------------------------------------------------------------------------
# Introduces a shop in your game, but, instead of use money, the monetary
# unity is defined by a variable.
#------------------------------------------------------------------------------
# Site : http://www.rpgrevolution.com/
# Brazil's Site : http://www.mundorpgmaker.com/
# Author : Kyo Panda
# Release in : October 04 of 2010
# Version : 1.1
#==============================================================================

#==============================================================================
# Special Thanks:
#------------------------------------------------------------------------------
# • pedro_severo : For the idealization and improvements in script.
#==============================================================================

#==============================================================================
# How to use:
#------------------------------------------------------------------------------
#
# #--------------------------------------------------------------------------
# # Setup
# #--------------------------------------------------------------------------
#
# • Paste the script above of "▼ Main Proccess" below of "▼ Materials"
# in the Script Editor of RPG Maker VX.
#
# • Setup the script in guide "Configuration" right above.
#
# #--------------------------------------------------------------------------
# # Utilization
# #--------------------------------------------------------------------------
#
# Use these codes with the "Event Command" "Script" in any event:
#
# • To define the shop's variable:
# VShop.var = Variable ID
#
# • To turn on the function of shop by variables:
# VShop.on
#
# • To turn off the function of shop by variables:
# VShop.off
#
# • To change the symbol shown in the shop:
# VShop.symbol = "Symbol"
#
# • To change the text of buy in the shop:
# VShop.buy_string = "Text"
#
# • To change the text of sell in the shop:
# VShop.sell_string = "Text"
#
# • To change the text of exit in the shop:
# VShop.exit_string = "Text"
#
# • To show or not the symbol at side of the itens price when buying:
# Define true to show and false to not show.
# VShop.show_symbol = true / false
#
# • To hide the option of buying in shop:
# Define true to hide and false to not hide.
# VShop.hidden_buy = true / false
#
# • To hide the option of selling in shop:
# Define true to hide and false to not hide.
# VShop.hidden_sell = true / false
#
#==============================================================================

#==============================================================================
# Version History:
#------------------------------------------------------------------------------
# • Version 1.1: October 05 of 2010
# * Added the option of change the texts of buy, sell and exit.
# * Added the option of show or not the symbol at the itens side in the
# buying time.
# * Added the option of hide the options of buy and sell..
# • Version 1.0: October 04 of 2010
# * First script version..
#==============================================================================

#==============================================================================
# VShop_Config
#------------------------------------------------------------------------------
# Configuration class of the script Scene_ShopVariable.
#==============================================================================

module VShop_Config
#--------------------------------------------------------------------------
# Configuration
#--------------------------------------------------------------------------

# Define here the default variable ID of the shop by variables.
DEFAULT_VARIABLE = 1

# Define here the default symbol used by the script.
# The name must be between quotes ("") or apostrophes ('').
DEFAULT_SYMBOL = "P"

# Define here the default state of the shop, if is turned on or not.
# Define true to turned on and false to turned off.
DEFAULT_STATE = false

# Define here the default texts that will be shown in the shop.
# The texts must be between quotes ("") or apostrophes ('').
DEFAULT_BUY = "Buy" # Buy
DEFAULT_SELL = "Sell" # Sell
DEFAULT_EXIT = "Exit" # Exit

# Define here if you wish to show the symbol at the itens side in shop,
# by default.
# Define true to show and false to not show.
DEFAULT_SHOW_SYMBOL = true

# Define here if you wish to hide the options of buy or sell by default.
# Define true to hide and false to not hide.
DEFAULT_HIDDEN_BUY = false # Buy
DEFAULT_HIDDEN_SELL = false # Sell

#--------------------------------------------------------------------------
# End of the configuration
#--------------------------------------------------------------------------
end

#--------------------------------------------------------------------------
# Define the key "Scene_ShopVariable" in hash $kpanda_scripts as true
#--------------------------------------------------------------------------
$kpanda_scripts = {} if $kpanda_scripts.nil?
$kpanda_scripts["Scene_ShopVariable"] = true

#==============================================================================
# VShop
#------------------------------------------------------------------------------
# Operation class of the script Scene_ShopVariable.
#==============================================================================

module VShop
#--------------------------------------------------------------------------
# Definition of the variable of the variable shop
# variable_id : Variable's ID
#--------------------------------------------------------------------------
def self.var=(variable_id)
return $game_temp.vshop_variable = variable_id
end
#--------------------------------------------------------------------------
# Turn on the shop by variables
#--------------------------------------------------------------------------
def self.on
return $game_temp.vshop_active = true
end
#--------------------------------------------------------------------------
# Turn off the shop by variables
#--------------------------------------------------------------------------
def self.off
return $game_temp.vshop_active = false
end
#--------------------------------------------------------------------------
# Definition of the symbol of the shop by variables
# symbol : New symbol
#--------------------------------------------------------------------------
def self.symbol=(symbol)
return $game_temp.vshop_symbol = symbol
end
#--------------------------------------------------------------------------
# Change the text of buy in the shop by variables
# string : New String
#--------------------------------------------------------------------------
def self.buy_string=(string)
return $game_temp.vshop_buy_string = string
end
#--------------------------------------------------------------------------
# Change the text of sell in the shop by variables
# string : New String
#--------------------------------------------------------------------------
def self.sell_string=(string)
return $game_temp.vshop_sell_string = string
end
#--------------------------------------------------------------------------
# Change the text of exit in the shop by variables
# string : New String
#--------------------------------------------------------------------------
def self.exit_string=(string)
return $game_temp.vshop_exit_string = string
end
#--------------------------------------------------------------------------
# Show the symbol at itens side
# state : New state
#--------------------------------------------------------------------------
def self.show_symbol=(state)
return $game_temp.vshop_show_symbol = state
end
#--------------------------------------------------------------------------
# Hide the buy option at the shop by variable
# state : New state
#--------------------------------------------------------------------------
def self.hidden_buy=(state)
return $game_temp.vshop_hidden_buy = state
end
#--------------------------------------------------------------------------
# Hide the sell option at the shop by variable
# state : New state
#--------------------------------------------------------------------------
def self.hidden_sell=(state)
return $game_temp.vshop_hidden_sell = state
end
end

#==============================================================================
# Game_Temp
#------------------------------------------------------------------------------
# This class handles temporary data that is not included with save data.
# The instance of this class is referenced by $game_temp.
#==============================================================================

class Game_Temp
#--------------------------------------------------------------------------
# Public instance variables
#--------------------------------------------------------------------------
attr_accessor :vshop_active # Activity of the shop by variables
attr_accessor :vshop_symbol # Symbol of the shop by variables
attr_accessor :vshop_variable # Variable of the shop by variables
attr_accessor :vshop_buy_string # Buy text
attr_accessor :vshop_sell_string # Sell text
attr_accessor :vshop_exit_string # Exit text
attr_accessor :vshop_show_symbol # Exhibition of the symbol
attr_accessor :vshop_hidden_buy # Definition of the hide buy
attr_accessor :vshop_hidden_sell # Definition of the hide sell
#--------------------------------------------------------------------------
# Alias of object initialization
#--------------------------------------------------------------------------
alias kpnsvs0001_initialize initialize
#--------------------------------------------------------------------------
# Object initialization
#--------------------------------------------------------------------------
def initialize
@vshop_active = VShop_Config::DEFAULT_STATE
@vshop_symbol = VShop_Config::DEFAULT_SYMBOL
@vshop_variable = VShop_Config::DEFAULT_VARIABLE
@vshop_buy_string = VShop_Config::DEFAULT_BUY
@vshop_sell_string = VShop_Config::DEFAULT_SELL
@vshop_exit_string = VShop_Config::DEFAULT_EXIT
@vshop_show_symbol = VShop_Config::DEFAULT_SHOW_SYMBOL
@vshop_hidden_buy = VShop_Config::DEFAULT_HIDDEN_BUY
@vshop_hidden_sell = VShop_Config::DEFAULT_HIDDEN_SELL
kpnsvs0001_initialize
end
end

#==============================================================================
# Window_Base
#------------------------------------------------------------------------------
# This is a superclass of all windows in the game.
#==============================================================================

class Window_Base < Window
#--------------------------------------------------------------------------
# Draw number with currency unit
# value : Number (gold, etc)
# x : Draw spot x-coordinate
# y : Draw spot y-coordinate
# width : Width
# symbol : Monetary unity's symbol
#--------------------------------------------------------------------------
def draw_currency_value_ex(value, x, y, width, symbol = Vocab::gold)
cx = contents.text_size(symbol).width
self.contents.font.color = normal_color
self.contents.draw_text(x, y, width - cx - 2, WLH, value, 2)
self.contents.font.color = system_color
self.contents.draw_text(x, y, width, WLH, symbol, 2)
end
end

#==============================================================================
# Window_ShopVariable
#------------------------------------------------------------------------------
# Window responsable by the exhibition of the variable in possesion by party.
#==============================================================================

class Window_ShopVariable < Window_Base
#--------------------------------------------------------------------------
# Public instance variables
#--------------------------------------------------------------------------
attr_accessor :variable # Window variable
attr_accessor :symbol # Window symbol
#--------------------------------------------------------------------------
# Object Initialization
# x : Window x-coordinate
# y : Window y-coordinate
# variable : Variable that will be drawn
# symbol : Symbol that will be drawn
#--------------------------------------------------------------------------
def initialize(x, y, variable, symbol)
super(x, y, 160, WLH + 32)
@variable = variable
@symbol = symbol
refresh
end
#--------------------------------------------------------------------------
# Update
#--------------------------------------------------------------------------
def refresh
self.contents.clear
draw_currency_value_ex(@variable, 4, 0, 120, @symbol)
end
end

#==============================================================================
# Window_ShopBuy
#------------------------------------------------------------------------------
# This window displays buyable goods on the shop screen.
#==============================================================================

class Window_ShopBuy < Window_Selectable
#--------------------------------------------------------------------------
# Alias of draw item
#--------------------------------------------------------------------------
alias kpnsvs0001_draw_item draw_item
#--------------------------------------------------------------------------
# Desenho do item
# index : Item number
#--------------------------------------------------------------------------
def draw_item(index)
if $game_temp.vshop_active
item = @data[index]
number = $game_party.item_number(item)
enabled = (item.price <= $game_variables[$game_temp.vshop_variable] and
number < 99)
rect = item_rect(index)
self.contents.clear_rect(rect)
draw_item_name(item, rect.x, rect.y, enabled)
rect.width -= 4
if $game_temp.vshop_show_symbol
rect.width -= self.contents.text_size($game_temp.vshop_symbol).width
rect.width -= 4
end
self.contents.draw_text(rect, item.price, 2)
if $game_temp.vshop_show_symbol
rect.width += self.contents.text_size($game_temp.vshop_symbol).width
rect.width += 4
self.contents.font.color = system_color
self.contents.draw_text(rect, $game_temp.vshop_symbol, 2)
self.contents.font.color = normal_color
end
else
kpnsvs0001_draw_item(index)
end
end
end

#==============================================================================
# Window_ShopNumber
#------------------------------------------------------------------------------
# This window is for inputting quantity of items to buy or sell on the
# shop screen.
#==============================================================================

class Window_ShopNumber < Window_Base
#--------------------------------------------------------------------------
# Alias of update
#--------------------------------------------------------------------------
alias kpnsvs0001_refresh refresh
#--------------------------------------------------------------------------
# Update
#--------------------------------------------------------------------------
def refresh
if $game_temp.vshop_active
y = 96
self.contents.clear
draw_item_name(@item, 0, y)
self.contents.font.color = normal_color
self.contents.draw_text(212, y, 20, WLH, "×")
self.contents.draw_text(248, y, 20, WLH, @number, 2)
self.cursor_rect.set(244, y, 28, WLH)
draw_currency_value_ex(@price * @number, 4, y + WLH * 2, 264,
$game_temp.vshop_symbol)
else
kpnsvs0001_refresh
end
end
end

#==============================================================================
# Scene_Shop
#------------------------------------------------------------------------------
# This class performs shop screen processing.
#==============================================================================

class Scene_Shop < Scene_Base
#--------------------------------------------------------------------------
# Alias of object initialization
#--------------------------------------------------------------------------
alias kpnsvs0001_start start
#--------------------------------------------------------------------------
# Object initialization
#--------------------------------------------------------------------------
def start
kpnsvs0001_start
if $game_temp.vshop_active
@gold_window = Window_ShopVariable.new(384, 56,
$game_variables[$game_temp.vshop_variable], $game_temp.vshop_symbol)
end
end
#--------------------------------------------------------------------------
# Alias of create command window
#--------------------------------------------------------------------------
alias kpnsvs0001_create_command_window create_command_window
#--------------------------------------------------------------------------
# Create command window
#--------------------------------------------------------------------------
def create_command_window
if $game_temp.vshop_active
commands = []
s1 = $game_temp.vshop_buy_string
s2 = $game_temp.vshop_sell_string
s3 = $game_temp.vshop_exit_string
commands << s1 unless $game_temp.vshop_hidden_buy
commands << s2 unless $game_temp.vshop_hidden_sell
commands << s3
@command_window = Window_Command.new(384, commands, commands.size)
@command_window.y = 56
if $game_temp.shop_purchase_only
@command_window.commands.each_index do |i|
if @command_window.commands[i] == $game_temp.vshop_sell_string
@command_window.draw_item(i, false)
end
end
end
else
kpnsvs0001_create_command_window
end
end
#--------------------------------------------------------------------------
# Alias of update command selection
#--------------------------------------------------------------------------
alias kpnsvs0001_update_command_selection update_command_selection
#--------------------------------------------------------------------------
# Update command selection
#--------------------------------------------------------------------------
def update_command_selection
if $game_temp.vshop_active
if Input.trigger?(Input::cool.gif
Sound.play_cancel
$scene = Scene_Map.new
elsif Input.trigger?(Input::C)
case @command_window.commands[@command_window.index]
when $game_temp.vshop_buy_string # Buy
Sound.play_decision
@command_window.active = false
@dummy_window.visible = false
@buy_window.active = true
@buy_window.visible = true
@buy_window.refresh
@status_window.visible = true
when $game_temp.vshop_sell_string # Sell
if $game_temp.shop_purchase_only
Sound.play_buzzer
else
Sound.play_decision
@command_window.active = false
@dummy_window.visible = false
@sell_window.active = true
@sell_window.visible = true
@sell_window.refresh
end
when $game_temp.vshop_exit_string # Exit
Sound.play_decision
$scene = Scene_Map.new
end
end
else
kpnsvs0001_update_command_selection
end
end
#--------------------------------------------------------------------------
# Alias of update buy item selection
#--------------------------------------------------------------------------
alias kpnsvs0001_update_buy_selection update_buy_selection
#--------------------------------------------------------------------------
# Update buy item selection
#--------------------------------------------------------------------------
def update_buy_selection
if $game_temp.vshop_active
@status_window.item = @buy_window.item
if Input.trigger?(Input::cool.gif
Sound.play_cancel
@command_window.active = true
@dummy_window.visible = true
@buy_window.active = false
@buy_window.visible = false
@status_window.visible = false
@status_window.item = nil
@help_window.set_text("")
return
end
if Input.trigger?(Input::C)
@item = @buy_window.item
number = $game_party.item_number(@item)
if @item == nil or @item.price >
$game_variables[$game_temp.vshop_variable] or number == 99
Sound.play_buzzer
else
Sound.play_decision
max = @item.price == 0 ? 99 :
$game_variables[$game_temp.vshop_variable] / @item.price
max = [max, 99 - number].min
@buy_window.active = false
@buy_window.visible = false
@number_window.set(@item, max, @item.price)
@number_window.active = true
@number_window.visible = true
end
end
else
kpnsvs0001_update_buy_selection
end
end
#--------------------------------------------------------------------------
# Alias of update sell item selection
#--------------------------------------------------------------------------
alias kpnsvs0001_update_sell_selection update_sell_selection
#--------------------------------------------------------------------------
# Update sell item selection
#--------------------------------------------------------------------------
def update_sell_selection
if $game_temp.vshop_active
if Input.trigger?(Input::cool.gif
Sound.play_cancel
@command_window.active = true
@dummy_window.visible = true
@sell_window.active = false
@sell_window.visible = false
@status_window.item = nil
@help_window.set_text("")
elsif Input.trigger?(Input::C)
@item = @sell_window.item
@status_window.item = @item
if @item == nil or @item.price == 0
Sound.play_buzzer
else
Sound.play_decision
max = $game_party.item_number(@item)
@sell_window.active = false
@sell_window.visible = false
@number_window.set(@item, max, @item.price / 2)
@number_window.active = true
@number_window.visible = true
@status_window.visible = true
end
end
else
kpnsvs0001_update_sell_selection
end
end
#--------------------------------------------------------------------------
# Alias of confirm number input
#--------------------------------------------------------------------------
alias kpnsvs0001_decide_number_input decide_number_input
#--------------------------------------------------------------------------
# Confirm number input
#--------------------------------------------------------------------------
def decide_number_input
if $game_temp.vshop_active
Sound.play_shop
@number_window.active = false
@number_window.visible = false
case @command_window.index
when 0 # Buy
$game_variables[$game_temp.vshop_variable] -=
@number_window.number * @item.price
$game_party.gain_item(@item, @number_window.number)
@gold_window.variable = $game_variables[$game_temp.vshop_variable]
@gold_window.refresh
@buy_window.refresh
@status_window.refresh
@buy_window.active = true
@buy_window.visible = true
when 1 # Sell
$game_variables[$game_temp.vshop_variable] +=
@number_window.number * (@item.price / 2)
$game_party.lose_item(@item, @number_window.number)
@gold_window.variable = $game_variables[$game_temp.vshop_variable]
@gold_window.refresh
@sell_window.refresh
@status_window.refresh
@sell_window.active = true
@sell_window.visible = true
@status_window.visible = false
end
else
kpnsvs0001_decide_number_input
end
end
end


Demo:
In attachments.

Screenshots:
Since the script doesn't make yet great changes in the default shop of RPG Maker VX, would be irrelevant post screenshots right now.

Version History:
Version History
• Version 1.1: October 05 of 2010
* Added the option of change the texts of buy, sell and exit.
* Added the option of show or not the symbol at the itens side in the buying time.
* Added the option of hide the options of buy and sell..
• Version 1.0: October 04 of 2010
* First script version.


Finalization
Any doubts, errors or suggestions about the script, notify me, that I will do the possible to attend you.
Any English mistake, notify me too. My primary language is Portuguese, so...


This post has been edited by Kyo Panda: Oct 11 2010, 09:57 AM
Attached File(s)
Attached File  Scene_ShopVariable.zip ( 304.53K ) Number of downloads: 49
 
Go to the top of the page
 
+Quote Post
   
gerrtunk
post Oct 10 2010, 04:43 PM
Post #1316


Level 5
Group Icon

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




This script adds a lost feature from old rpgmakers: the option to create item use restrictions by actor or class. Also now dead actors cant be valid users of items.

Also adds a new feature: option to decide what actors can be the target of a item and the option to view it visually when selecting the targets.

In development. Bugs, suggerences, compatibality, etc
CODE
]#====================================================================
==========
# Restricted use and apply items
# By gerkrt/gerrtunk
# Version: 1.1
# License: GPL, credits
#==============================================================================
=begin

This script adds a lost feature from old rpgmakers: the option to create item use
restrictions by actor or class. Also now dead actors cant be valid users of items.

Also adds a new feature: option to decide what actors can be the target of
a item and the option to view it visually when selecting the targets.

--------Use Restriction-----------

This system gives you the option to decide what actors can use a item.

Instructions:

Restricted_items = {1 => [2,6],2 => [1,2]}

If you wanted to add a use restriction for item 5 and that it can only be used
to actors 5 and 7:

Restricted_items = {1 => [2,6],2 => [1,2], 5=>[5,7] }

item_id => [actor_id, actor_id2, actor_idx]

Note that you can remove the examples:

Restricted_items = {5=>[5,7]}

Notes about the usage:

-The ids you add define only the actors that can use the items, the rest cant do that.

-Items that you dont add to the Restricted_items list will be treated like
normal ones(no restrictions)

Options(true= active, false= inactive):

Dead_cant_use: Imagine that you have a item restricted only for actor 1, who is dead.
With this option enabled the item cant be used in the main menu.

---------Apply Restriction----------

This system gives you the option to decide what actors can be the target of a item.

Instructions:

Restricted_aplication = {1 => [2,6],2 => [1,2]}

If you wanted to add a apply restriction for item 5 and that it can only be applied
to actors 5 and 7:

Restricted_aplication = {1 => [2,6],2 => [1,2], 5=>[5,7] }

item_id => [actor_id, actor_id2, actor_idx]

Note that you can remove the examples:

Restricted_aplication = {5=>[5,7]}

Notes about the usage:

-The ids you add define only the actors that can be target, the rest cant do that.

-All members items effects: The effect will be applied to all members except wich
cant be applied. If nobody can be target, the item cant be used.

-Single target effects: Only to that can.

-Items that you dont add to the Restricted_aplication list will be treated like
normal ones(no restrictions)

Options(true= active, false= inactive):

Use_is_Aplication: This make that use restictions and apply restrctions are the same.
This means that only an actor that can use an item can be target of it. If you active
it all the options defined in Restricted_aplication will be ignored.

Active_restricted_aplication: This is a compatibality option. The apply script
modifies a lot of things, so, is possible that it will be incompatible. Then you
might want to turn off this option, because you still want to use restricted
normal items. Note that you will lose all its functions.

Show_application_battle_grafic: Another compatibality option. This makes that the
actor name is printed in disabled color in the battle. If dont work or use another
system, desactive it.

Show_application_item_grafic: Another compatibality option. This makes that the
actor name is printed in disabled color in the item menu. If dont work or use another
system, desactive it.

----------Restrictions based on Classes-------

The method of adding is the same that in the others.Just add a Class_ before the variable
name to know what is. Anyway you must know that an
actor restriction have preference over clases restrictions. This means that a
actor that can use restricted item also can use that item with any class. If the
actor cant use the item then class rectictions are checked.

----------Tip for long lines-------------

After every , you can make a new line. Example:

Restricted_aplication = {1 => [2,6],2 => [1,2], 5=>[5,7],
7 => [2,6],9 => [1,2], 13=>[5,7]}

=end

module Wep
# {Item_id => [actor_id]}
Restricted_items = {2 => [1]}
Class_restricted_items = {2 => [1]}
Active_restricted_aplication = true
Use_is_Aplication = false
Show_application_battle_grafic = true
Show_application_item_grafic = true
Restricted_aplication = {2 => [4,1]}
Class_restricted_aplication = {2 => [2]}
Dead_cant_use = true
end

# RESTRICTED APLICATION CODE
if Wep::Active_restricted_aplication

class Scene_Battle
#--------------------------------------------------------------------------
# * Make Item Action Results
#--------------------------------------------------------------------------
def make_item_action_result
# Get item
@item = $data_items[@active_battler.current_action.item_id]
# If unable to use due to items running out
unless $game_party.item_can_use?(@item.id)
# Shift to step 1
@phase4_step = 1
return
end
# If consumable
if @item.consumable
# Decrease used item by 1
$game_party.lose_item(@item.id, 1)
end
# Display item name on help window
@help_window.set_text(@item.name, 1)
# Set animation ID
@animation1_id = @item.animation1_id
@animation2_id = @item.animation2_id
# Set common event ID
@common_event_id = @item.common_event_id
# Decide on target
index = @active_battler.current_action.target_index
target = $game_party.smooth_target_actor(index)
# Set targeted battlers
set_target_battlers(@item.scope)
# Apply item effect
for target in @target_battlers
# Check restrictions
if target.is_a?(Game_Actor) and $game_party.item_can_apply?(@active_battler.current_action.item_id, target.actor_id_reader)
target.item_effect(@item)
end
end
end

#--------------------------------------------------------------------------
# * Frame Update (actor command phase : actor selection)
#--------------------------------------------------------------------------
def update_phase3_actor_select
# Update actor arrow
@actor_arrow.update
# If B button was pressed
if Input.trigger?(Input::cool.gif
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
# End actor selection
end_actor_select
return
end
# If C button was pressed
if Input.trigger?(Input::C)
#p @active_battler.current_action.item_id, $game_party.actors[@actor_arrow.index].actor_id_reader
if not $game_party.item_can_apply?(@active_battler.current_action.item_id, $game_party.actors[@actor_arrow.index].actor_id_reader)
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
return
end
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Set action
@active_battler.current_action.target_index = @actor_arrow.index
# End actor selection
end_actor_select
# If skill window is showing
if @skill_window != nil
# End skill selection
end_skill_select
end
# If item window is showing
if @item_window != nil
# End item selection
end_item_select
end
# Go to command input for next actor
phase3_next_actor
end
end

end





class Game_Party
#--------------------------------------------------------------------------
# * Determine if Item is Apply
# item_id : item ID
# actor_id : target actor id
#--------------------------------------------------------------------------
def item_can_apply?(item_id, actor_id)
# If this option is enabled, use restriction information for apply restrictions
if Wep::Use_is_Aplication

# Actor check
if Wep::Restricted_items[item_id] != nil and Wep::Restricted_items[item_id][0] != nil
if Wep::Restricted_items[item_id].include?(actor_id)
return true
else

# Actor-Class check
if Wep::Class_restricted_items[item_id] != nil and Wep::Class_restricted_items[item_id][0] != nil
if Wep::Class_restricted_items[item_id].include?($game_actors[actor_id].class_id)

return true
else
return false
end
# If normal item, all true
return true
end


# If not class also, false.
return false
end
# If normal item, all true
return true
end

# Class only check
if Wep::Class_restricted_items[item_id] != nil and Wep::Class_restricted_items[item_id][0] != nil
if Wep::Class_restricted_items[item_id].include?($game_actors[actor_id].class_id)
return true
else
return false
end
# If normal item, all true
return true
end
end


# Normal behavior


# Actor check
if Wep::Restricted_aplication[item_id] != nil and Wep::Restricted_aplication[item_id][0] != nil
if Wep::Restricted_aplication[item_id].include?(actor_id)
return true
else

# Actor-Class check
if Wep::Class_restricted_aplication[item_id] != nil and Wep::Class_restricted_aplication[item_id][0] != nil
if Wep::Class_restricted_aplication[item_id].include?($game_actors[actor_id].class_id)
return true
else
return false
end
# If normal item, all true
return true
end
# If not class also, false.
return false
end


end

# Class check
if Wep::Class_restricted_aplication[item_id] != nil and Wep::Class_restricted_aplication[item_id][0] != nil
if Wep::Class_restricted_aplication[item_id].include?($game_actors[actor_id].class_id)
return true
else
return false
end
# If normal item, all true
return true
end



# If normal item, all true
return true
end
end


end


# CORE CODE

class Scene_Item
#--------------------------------------------------------------------------
# * Frame Update (when target window is active)
#--------------------------------------------------------------------------
def update_target
if Wep::Show_application_item_grafic
@target_window.refresh_disabled(@item_window.item.id)
end
# If B button was pressed
if Input.trigger?(Input::cool.gif

# Play cancel SE
$game_system.se_play($data_system.cancel_se)
# If unable to use because items ran out
unless $game_party.item_number(@item.id) == 0
# Remake item window contents
@item_window.refresh
end
# Erase target window
@item_window.active = true
@target_window.visible = false
@target_window.active = false
return
end
# If C button was pressed
if Input.trigger?(Input::C)
# If items are used up
if $game_party.item_number(@item.id) == 0
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
return
end


# If target is all
if @target_window.index == -1
# If apply restriction system is active
if Wep::Active_restricted_aplication
# First check that at least one actor can take the effect
for i in $game_party.actors
if $game_party.item_can_apply?(@item.id, i.actor_id_reader)
can_apply = true
end
end
# If any can, escape
if can_apply == nil
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
return
end
# Apply item effects to entire party
used = false
for i in $game_party.actors
# Only apply effects to the actors that can
if $game_party.item_can_apply?(@item.id, i.actor_id_reader)
used |= i.item_effect(@item)
end
end

# Normal behavior
else
# Apply item effects to entire party
used = false
for i in $game_party.actors
used |= i.item_effect(@item)
end


end
end


# If single target
if @target_window.index >= 0
# If apply restriction system is active
if Wep::Active_restricted_aplication
unless $game_party.item_can_apply?(@item.id, $game_party.actors[@target_window.index].actor_id_reader)
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
return
end
# Apply item use effects to target actor
target = $game_party.actors[@target_window.index]
used = target.item_effect(@item)
# Normal behavior
else
# Apply item use effects to target actor
target = $game_party.actors[@target_window.index]
used = target.item_effect(@item)
end

end



# If an item was used
if used
# Play item use SE
$game_system.se_play(@item.menu_se)
# If consumable
if @item.consumable
# Decrease used items by 1
$game_party.lose_item(@item.id, 1)
# Redraw item window item
@item_window.draw_item(@item_window.index)
end
# Remake target window contents
@target_window.refresh
# If all party members are dead
if $game_party.all_dead?
# Switch to game over screen
$scene = Scene_Gameover.new
return
end
# If common event ID is valid
if @item.common_event_id > 0
# Common event call reservation
$game_temp.common_event_id = @item.common_event_id
# Switch to map screen
$scene = Scene_Map.new
return
end
end
# If item wasn't used
unless used
#p'nmo usado'
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
end
return
end
end

end

class Scene_Battle
def actor_id_restricted_item
return @active_battler.actor_id_reader
end
end
class Game_Actor < Game_Battler
def actor_id_reader
return @actor_id
end
end
class Game_Party
#--------------------------------------------------------------------------
# * Determine if Item is Usable
# item_id : item ID actor id batalla? desde scnee?
#--------------------------------------------------------------------------
def item_can_use?(item_id)
# If item quantity is 0
if item_number(item_id) == 0
# Unusable
return false
end

# Restricted item in map menu

# If itsnt normal, check for use restriction
if Wep::Restricted_items[item_id] != nil and Wep::Restricted_items[item_id][0] != nil and not $game_temp.in_battle
# Check for dead option
if Wep::Dead_cant_use
# Check for at least one living valid actor
for actor in $game_party.actors
if Wep::Restricted_items[item_id].include?(actor.id) and actor.hp > 0
return true
end
end


# Check for class restrction if actor restriction fails
if Wep::Class_restricted_items[item_id] != nil and Wep::Class_restricted_items[item_id][0] != nil and not $game_temp.in_battle
# Check for dead option
if Wep::Dead_cant_use
# Check for at least one living valid actor
for actor in $game_party.actors
if Wep::Class_restricted_items[item_id].include?($game_actors[actor.id].class_id) and actor.hp > 0
return true
end
end
return false
# If dont check for dead
else
# Check for at least one valid actor-class
for actor in $game_party.actors
if Wep::Class_restricted_items[item_id].include?($game_actors[actor.id].class_id)
# At least one valid actor
return true
end
end
# It dont have valid actors in the party
return false

end
end


# If dont use class or class restriction failed
return false

# If dont check for dead
else
# Check for at least one valid actor
for actor in $game_party.actors
if Wep::Restricted_items[item_id].include?(actor.id)
# At least one valid actor
return true
end
end
# It dont have valid actors in the party
return false
end

end

# Check for only class restriction
if Wep::Class_restricted_items[item_id] != nil and Wep::Class_restricted_items[item_id][0] != nil and not $game_temp.in_battle
# Check for dead option
if Wep::Dead_cant_use
# Check for at least one living valid actor
for actor in $game_party.actors
if Wep::Class_restricted_items[item_id].include?($game_actors[actor.id].class_id) and actor.hp > 0
# At least one valid living actor
return true
end
end
return false if valid_actor_class == nil
# If dont check for dead
else
# Check for at least one valid actor-class
for actor in $game_party.actors
if Wep::Class_restricted_items[item_id].include?($game_actors[actor.id].class_id)
# At least one valid actor
return true
end
end
# It dont have valid actors in the party
return false

end
end

# All normal items are usable if not in batte
return true if not $game_temp.in_battle

# Get usable time
occasion = $data_items[item_id].occasion
# If in battle
if $game_temp.in_battle
# Check item use restriction
if Wep::Restricted_items[item_id] != nil and Wep::Restricted_items[item_id][0] != nil
# Check if usable in battle or not
if occasion == 0 or occasion == 1
# Check restrictions
if Wep::Restricted_items[item_id].include?($scene.actor_id_restricted_item)
return true
else
# Class restrictions(Actor+Class check)
if Wep::Class_restricted_items[item_id] != nil and Wep::Class_restricted_items[item_id][0] != nil #and not $game_temp.in_battle
# Check class restrictions
if Wep::Class_restricted_items[item_id].include?($game_actors[$scene.actor_id_restricted_item].class_id)
return true
end
return false
end
end
# If not usable in battle
else
return false
end
end




# Class restrictions if actor restriction dont exist
if Wep::Class_restricted_items[item_id] != nil and Wep::Class_restricted_items[item_id][0] != nil and $game_temp.in_battle
# Check if usable in battle or not
if occasion == 0 or occasion == 1
# Check class restrictions
if Wep::Class_restricted_items[item_id].include?($game_actors[$scene.actor_id_restricted_item].class_id)
return true
else
return false
end
# If not usable in battle
else
return false
end
end


# All normal items are usable in battle based on their occasion

# If useable time is 0 (normal) or 1 (only battle) it's usable
return (occasion == 0 or occasion == 1)
end
# If useable time is 0 (normal) or 2 (only menu) it's usable
return (occasion == 0 or occasion == 2)
end


end



# SHOW BATTLE GRAPHICS CODE

if Wep::Show_application_battle_grafic


class Scene_Battle
#--------------------------------------------------------------------------
# * Start Actor Selection
#--------------------------------------------------------------------------
def start_actor_select
# Make actor arrow
@actor_arrow = Arrow_Actor.new(@spriteset.viewport2)
@actor_arrow.index = @actor_index
# Associate help window
@actor_arrow.help_window = @help_window
# Disable actor command window
@actor_command_window.active = false
@actor_command_window.visible = false
@status_window.refresh_disabled(@active_battler) if @active_battler.current_action.kind == 2
end
#--------------------------------------------------------------------------
# * End Actor Selection
#--------------------------------------------------------------------------
def end_actor_select
@status_window.refresh
# Dispose of actor arrow
@actor_arrow.dispose
@actor_arrow = nil
end
end

class Window_BattleStatus < Window_Base

#--------------------------------------------------------------------------
# * Refresh Disabled
#--------------------------------------------------------------------------
def refresh_disabled(active_battler)
self.contents.clear
@item_max = $game_party.actors.size
for i in 0...$game_party.actors.size
actor = $game_party.actors[i]
actor_x = i * 160 + 4
if not $game_party.item_can_apply?(active_battler.current_action.item_id, $game_party.actors[i].actor_id_reader)
self.contents.font.color = disabled_color
self.contents.draw_text(actor_x, 0, 120, 32, actor.name)
else
draw_actor_name(actor, actor_x, 0)
end
draw_actor_hp(actor, actor_x, 32, 120)
draw_actor_sp(actor, actor_x, 64, 120)
if @level_up_flags[i]
self.contents.font.color = normal_color
self.contents.draw_text(actor_x, 96, 120, 32, "¡Sube Nivel!")
else
draw_actor_state(actor, actor_x, 96)
end
end
self.contents.font.color = normal_color
end
end

end



# SHOW ITEM GRAPHICS CODE


if Wep::Show_application_item_grafic

#==============================================================================
# ** Window_Target
#------------------------------------------------------------------------------
# This window selects a use target for the actor on item and skill screens.
#==============================================================================

class Window_Target < Window_Selectable
#--------------------------------------------------------------------------
# * Refresh Disabled
#--------------------------------------------------------------------------
def refresh_disabled(item_id)
self.contents.clear
for i in 0...$game_party.actors.size
x = 4
y = i * 116
actor = $game_party.actors[i]
if not $game_party.item_can_apply?(item_id, $game_party.actors[i].actor_id_reader)
self.contents.font.color = disabled_color
self.contents.draw_text(x, y, 120, 32, actor.name)
else
draw_actor_name(actor, x, y)
end
draw_actor_class(actor, x + 144, y)
draw_actor_level(actor, x + 8, y + 32)
draw_actor_state(actor, x + 8, y + 64)
draw_actor_hp(actor, x + 152, y + 32)
draw_actor_sp(actor, x + 152, y + 64)
end
self.contents.font.color = normal_color
end
end

end


This post has been edited by gerrtunk: Oct 10 2010, 04:44 PM
Go to the top of the page
 
+Quote Post
   
gerrtunk
post Oct 10 2010, 04:48 PM
Post #1317


Level 5
Group Icon

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





I created this script long ago for one of my menus and any other project. Its very flexible and can be used for a lot of things. It uses a modified window+sprite combination because i think that it looks better, anyway you can modify it or do what you want.

Features:

-The window size and position is based on the text size.
-All other sizes or positions are set automatically.
-It have methods for automatically visible/invisible, dipose,etc, all sprites
and windows.
-You can add a question to it. With this a modified version of a window command
is actived.
-You can changue the text, ask option, x and y in every call.

I use it with a variable in the Scene called "Warning_message_type" that defines the behavior of it.

Note that you need scripting knoledge for using this. Basically im sharing the code for anyone that may need it and don't want to make his own.

If you add something realy cool to it, tell me, the idea is to improve it. Anyway, suggerences,bugs,etc, i will listen for any feedback.

CODE
#======================================================================
========
# Warning message
# By gerkrt/gerrtunk
# Version: 1
# License: GPL, credits
#==============================================================================
=begin

Features:

I created this script long ago for one of my menus and any other project. Its very flexible
and can be used for a lot of things. It uses a modified window+sprite combination
because i think that it looks better, anyway you can modify it or do what you want.

-The window size and position is based on the text size.
-All other sizes or positions are set automatically.
-It have methods for automatically visible/invisible, dipose,etc, all sprites
and windows.
-You can add a question to it. With this a modified version of a window command
is actived.
-You can changue the text, ask option, x and y in every call.

I use it with a variable in the Scene called "Warning_message_type" that defines
the behavior of it.

=end

class Warning_Message
def initialize
# Default values when refreshing it
@default_x = 200
@default_y = 200
# Back text window
@text_window = Window_Base.new(120, 136, 400, 64)
@text_window.z = 252
@text_window.visible = false
# Text sprite
@text_sprite = Sprite.new
@text_sprite.z = 254
@text_sprite.x = 120
@text_sprite.y = 136
@text_sprite.bitmap = Bitmap.new(400,64)
# Testing bitmap for size test
@testing_bitmap = Bitmap.new(1,1)
# Question window
@question_window = Window_Selection.new(80, ["Yes", "No"])
@question_window.x = 280
@question_window.y = 200
@question_window.z = 253
@question_window.back_opacity = 0
@question_window.opacity = 0
@question_window.active = false
@question_window.visible = false
# Back question window
@back_question_window = Window_Base.new(120, 136, 64, 64)
@back_question_window.x = 280
@back_question_window.y = 200
@back_question_window.z = 254
@back_question_window.visible = false

end

# Make all the sprites/windows visibles
def visible
@text_window.visible = true
@text_sprite.visible = true
# Question ones only if active
if @back_question_window.active
@question_window.visible = true
@back_question_window.visible = true
end
end

# Make all the sprites/windows invisibles
def no_visible
@text_window.visible = false
@text_sprite.visible = false
@question_window.visible = false
@back_question_window.visible = false
end

# Is question window active?
def active
return @question_window.active
end

# Set question window active
def active=(value)
@question_window.active = value
end

# Update all the sprites/windows visibles
def update
@text_window.update
@text_sprite.update
@back_question_window.update
@question_window.update
end

# Draw the warning message
# question: called to add a yes/no window.
def refresh(message, question=true, x=@default_x, y=@default_y)
# Basic position settings
@text_window.y = y
@text_window.x = x
@text_sprite.x = x
@text_sprite.y = y
rect = @testing_bitmap.text_size(message)
# With question window or not. All the positions auto-setting are done here.
if question
@text_window.width = rect.width+26+40
@question_window.visible = true
@question_window.active = true
@back_question_window.visible = true
@question_window.x = @text_window.x+rect.width+4+6
@question_window.y = @text_window.y - 16
@back_question_window.x = @text_window.x+rect.width+4+16
@back_question_window.y = @text_window.y
else
@text_window.width = rect.width+26
end
# First update the back window
@text_window.update
@text_sprite.bitmap.clear
# Draw text
@text_sprite.bitmap.draw_text(0+10,0,400,64,message, 0)
@text_sprite.update
end

# Dispose all the sprites/windows visibles
def dispose
@text_window.dispose
@text_sprite.dispose
@question_window.dispose
@back_question_window.dispose
end
end


class Window_Selection < Window_Command
#--------------------------------------------------------------------------
# * Update Cursor Rectangle
#--------------------------------------------------------------------------
def update_cursor_rect
# If cursor position is less than 0
if @index < 0
self.cursor_rect.empty
return
end
# Get current row
row = @index / @column_max
# If current row is before top row
if row < self.top_row
# Scroll so that current row becomes top row
self.top_row = row
end
# If current row is more to back than back row
if row > self.top_row + (self.page_row_max - 1)
# Scroll so that current row becomes back row
self.top_row = row - (self.page_row_max - 1)
end
# Calculate cursor width
cursor_width = (self.width / @column_max - 32)+11
# Calculate cursor coordinates
x = @index % @column_max * (cursor_width + 32)
y = @index / @column_max * 32 - self.oy
# Update cursor rectangle
self.cursor_rect.set(x-4, y, cursor_width, 32)
end

end

Go to the top of the page
 
+Quote Post
   
gerrtunk
post Oct 10 2010, 04:49 PM
Post #1318


Level 5
Group Icon

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




This script recovers a function that was in old rpgmakers: creating items with any limited number of uses(not just 0 or unlimited).
Also adds the option to show the uses ratio in the item description.

Under development. Bugs, suggrences, compatibility issues... just ask.

CODE
#==============================================================================
# Multiusable items
# By gerkrt/gerrtunk
# Version: 1.5
# License: GPL, credits
#==============================================================================
=begin

--------Instructions-----------

Just add new items in the variable Multiusable_items. You have to do this to
add a new item every time.

Ex: If you wanted to add the item number 5 of the database with 3 uses:

Multiusable_items = {1=>3, 3=>2, 5=>3}

First goes the item id, then the uses. Note that you can remove the two examples
i have add:

Multiusable_items = {5=>3}

This works like in old Rpgmakers. Internally it will be used the item with less
number of uses left.

----------Options-------------

Show_uses: If you turn this option on it will add to every multiusable descriptions
the number of uses left, example:

Super Potion
Description: 2/2 uses. Recovers 300 HP.

Uses_text: You can modify here the text that is add before the uses ratio.


----------Compatibality-------------

The show uses option modifies the shop and item menu, if you have some script
that changue that it can give you problems. Turn this option off if something goes
wrong.

=end

module Wep
    # By uses. {Item_id=> number of uses}
    Multiusable_items = {1=>3, 3=>2}
    Show_uses = true
    Uses_text = ' uses. '
end

class Game_Party
   attr_reader :multiusable_items
   alias wep_gm_par_init initialize
   def initialize
     wep_gm_par_init
     @multiusable_items = []
  end

  #--------------------------------------------------------------------------
  # * Gain Items (or lose)
  #     item_id : item ID
  #     n       : quantity
  #--------------------------------------------------------------------------
  def gain_item(item_id, n)
    # Update quantity data in the hash.
    if item_id > 0
     # Check if multiusable
     if multiusable?(item_id) and n > 0
       for i in 0...n
        # Push a new item with uses and item id
        uses = Wep::Multiusable_items[item_id]
        @multiusable_items.push([item_id,uses])
       end
      end
      @items[item_id] = [[item_number(item_id) + n, 0].max, 99].min
    end
  end

  #--------------------------------------------------------------------------
  # * Lose Items
  #     item_id : item ID
  #     n       : quantity
  #--------------------------------------------------------------------------
  def lose_item(item_id, n)
     if multiusable?(item_id) and have_multiusables?(item_id) and not $scene.is_a?(Scene_Shop)
       # Sort by uses
       @multiusable_items.sort! {|a,b|a[1]<=> b[1]}
       # Iterate over all items in search of what have the lowest uses
       i=0
       for item in @multiusable_items
        if item[0] == item_id
          @multiusable_items[i][1]-=1
          # If have no more uses, delete it
          if @multiusable_items[i][1] == 0
           @multiusable_items.delete(item)
           @items[item_id] = [[item_number(item_id) -1, 0].max, 99].min
         end
         break
       end
       i+=1
       end
      elsif $scene.is_a?(Scene_Shop) and multiusable?(item_id)
        i=0
        to_lose = n
        @multiusable_items.sort! {|a,b|a[1]<=> b[1]}
        for item in @multiusable_items
          if to_lose == 0
            break
          end
          if item[0] == item_id
             @multiusable_items.delete_at(i)
             to_lose-=1
          end
          i+=1
        end
        @items[item_id] = [[item_number(item_id) -n, 0].max, 99].min
       else
       # Reverse the numerical value and call it gain_item
        gain_item(item_id, -n)
      end
    end
  
  #--------------------------------------------------------------------------
  # * Have Multiusables?
  #--------------------------------------------------------------------------
  def have_multiusables?(item_id)
       for item in @multiusable_items
         if item[0] == item_id
           return true
         end
       end
      return false
  end
  
  #--------------------------------------------------------------------------
  # * Multiusables?
  #--------------------------------------------------------------------------
  def multiusable?(item_id)
    return Wep::Multiusable_items[item_id]
  end
end

if Wep::Show_uses
  class Window_Item < Window_Selectable
    #--------------------------------------------------------------------------
    # * Help Text Update
    #--------------------------------------------------------------------------
    def update_help
      if Wep::Multiusable_items[self.item.id]
        for item in $game_party.multiusable_items
         if item[0] == self.item.id
           uses=item[1]
           break
         end
       end
        description = uses.to_s+'/'+Wep::Multiusable_items[self.item.id].to_s+Wep::Uses_text+self.item.description
        @help_window.set_text(description)
      else
        @help_window.set_text(self.item == nil ? "" : self.item.description)
      end
    end
  end

  class Window_ShopSell < Window_Selectable
    #--------------------------------------------------------------------------
    # * Help Text Update
    #--------------------------------------------------------------------------
    def update_help
      if Wep::Multiusable_items[self.item.id]
        for item in $game_party.multiusable_items
         if item[0] == self.item.id
           uses=item[1]
           break
         end
       end
        description = uses.to_s+'/'+Wep::Multiusable_items[self.item.id].to_s+Wep::Uses_text+self.item.description
        @help_window.set_text(description)
      else
        @help_window.set_text(self.item == nil ? "" : self.item.description)
      end
    end
  end  
end
Reason for edit: Fixed Spoiler Tags - Night_Runner
Go to the top of the page
 
+Quote Post
   
gerrtunk
post Oct 10 2010, 04:53 PM
Post #1319


Level 5
Group Icon

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




This script allows you to keep a diary of the player's actions in the game
with the purpose of being able to analyze the betatester playthrough.

For this purpose the script gives you three tools:

1-Game-Journal: The information is saved the current game, as
the configuration and type you choose. This journal keep a new entry every once you call it with a call script.

2 Save-Journal: This saves the save number, playing time and
additional information. It is updated every time you save automatically.

3-Write other data: Here you could enter values of variables or switches of within the game, for example, an indicator of % completed game.

-Three methods to add info: Simple, complex(you can configure it) and total. Also, you can choose if you want to write all actors info or only the group.
-High costumitzation and flexibility
-Title identifiers
-End and start headers.
-A compact text style mode.
-High compatibility
-Some features to improve you work with these files
Under development. Suggerences,bugs, traductions mistakes...etc i will listen.

This a example of the game-log. My database is spanish.
CODE
------------------------------------------
||||GAME START||||
------------------------------------------
Title: Alderhast
Autor: Wep
Version: 0.5z
Date: Mon Jan 01 09:35:46 Hora estándar romance 2007
Autor introduction: Welcome!

------------------------------------------
||||LOST FOREST||||
------------------------------------------

Date: Mon Jan 01 09:35:46 Hora estándar romance 2007
Playtime: 00:00:00
Money: 675. Steps: 0. Map: 1 (MAP001)


------------------------
alexis, my love (Luchador) Nv1
------------------------


Equipment:

Armas: Espada Bronce
Escudo: Escudo Bronce
Cabeza: Yelmo Bronce
Cuerpo: Armadura Bronce
Armas: Anillo Destreza


Parameters:

HP 741\741. SP 534\534
Str 67. Dex 69. Agi 58
Int 36. PDef 153. MDef 138
Atk 112. Eva 0

Skills:

Cruz Sagrada. Ataque Finta
Huracán.

------------------------
Basil (Lancero) Nv1
------------------------


Equipment:

Armas: Lanza Bronce
Escudo: Escudo Bronce
Cabeza:
Cuerpo: Peto Bronce
Accesorio:


Parameters:

HP 695\695. SP 591\591
Str 60. Dex 65. Agi 62
Int 31. PDef 96. MDef 89
Atk 110. Eva 0

Skills:

Barrido Regu.

------------------------
Silas (Mercenario) Nv1
------------------------


Equipment:

Armas: Hacha Bronce
Escudo: Escudo Bronce
Cabeza: Yelmo Bronce
Cuerpo: Armadura Bronce
Accesorio:


Parameters:

HP 747\747. SP 435\435
Str 76. Dex 56. Agi 52
Int 37. PDef 153. MDef 138
Atk 114. Eva 0

Skills:

Rompe Brazo.

------------------------
Dorothy (Ladrón) Nv1
------------------------


Equipment:

Armas: Daga Bronce
Escudo:
Cabeza: Yelmo Bronce
Cuerpo:
Accesorio:


Parameters:

HP 546\546. SP 590\590
Str 41. Dex 73. Agi 72
Int 32. PDef 53. MDef 47
Atk 108. Eva 0

Skills:

Golpe Serpiente.

------------------------
Ester (Arquero) Nv1
------------------------


Equipment:

Armas: Arco Bronce
Escudo:
Cabeza: Yelmo Bronce
Cuerpo: Peto Bronce
Accesorio:


Parameters:

HP 590\590. SP 570\570
Str 50. Dex 79. Agi 62
Int 48. PDef 127. MDef 116
Atk 111. Eva 0

Skills:

Asesino Aves.

------------------------
Félix (Pistolero) Nv1
------------------------


Equipment:

Armas: Revólver
Escudo:
Cabeza: Yelmo Bronce
Cuerpo: Peto Bronce
Accesorio:


Parameters:

HP 656\656. SP 531\531
Str 51. Dex 62. Agi 50
Int 33. PDef 127. MDef 116
Atk 115. Eva 0

Skills:

Plata Barrett.

------------------------
Gloria (Acólito) Nv1
------------------------


Equipment:

Armas: Mazo Bronce
Escudo:
Cabeza: Sombrero Algodón
Cuerpo: Túnica Algodón
Accesorio:


Parameters:

HP 486\486. SP 661\661
Str 43. Dex 55. Agi 55
Int 64. PDef 116. MDef 124
Atk 109. Eva 0

Skills:

Cura.

------------------------
Hilda (Mago) Nv1
------------------------


Equipment:

Armas: Bastón Bronce
Escudo:
Cabeza: Sombrero Algodón
Cuerpo: Túnica Algodón
Accesorio:


Parameters:

HP 422\422. SP 606\606
Str 31. Dex 30. Agi 46
Int 71. PDef 116. MDef 124
Atk 107. Eva 0

Skills:

Fuego.

--------------
Inventary:
--------------

Items:

Poción: 15. Super Poción: 1
Antídoto: 1

Weapons:

Espada Bronce: 1.

Armors:

Escudo Bronce: 1. Escud Caos: 1


------------------------------------------
||||MY EXTRA DATA||||
------------------------------------------
% completed game: 6

Lime king killed: true
I survived the hard dungeon: false

------------------------------------------
||||GAME END||||
------------------------------------------
Title: Alderhast
Autor: Wep
Version: 0.5z
Date: Mon Jan 01 09:35:46 Hora estándar romance 2007
End note: Good night

Save-log:

CODE
------------------------------------------
||||Save 1||||
------------------------------------------

Playtime: 00:00:03. Money: 675. Map: 1 (MAP001)

alexis, my love (Luchador) Nv1

Basil (Lancero) Nv1

Gloria (Acólito) Nv1

Hilda (Mago) Nv1

------------------------------------------
||||Save 2||||
------------------------------------------

Playtime: 00:00:05. Money: 675. Map: 1 (MAP001)

alexis, my love (Luchador) Nv1

Basil (Lancero) Nv1

Gloria (Acólito) Nv1

Hilda (Mago) Nv1

------------------------------------------
||||Save 3||||
------------------------------------------

Playtime: 00:00:05. Money: 675. Map: 1 (MAP001)

alexis, my love (Luchador) Nv1

Basil (Lancero) Nv1

Gloria (Acólito) Nv1

Hilda (Mago) Nv1



The script code is too long for this forum, get it here:
script

This post has been edited by gerrtunk: Oct 10 2010, 04:55 PM
Go to the top of the page
 
+Quote Post
   
gerrtunk
post Oct 10 2010, 04:58 PM
Post #1320


Level 5
Group Icon

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




Remember making eternal event systems in old makers? Creating the numbers and words images? And the condition systems to show that numbers and words?

I remember, and hate xD. Maybe its just for the XP but... anyway this script will help in that things.
Image



This script can show pictures based on a text line. The image will be treated lik ea normal picture loaded with the show picture event command. It have the same rules and can be moved, changue tone, erased, etc...

Then you need to put a command show picture with any image(its not used) and the values that you will put in a normal event command show picture. The script then creates creates a bitmap based on your text and options and loading a event picture with it.


The basic options are:
-Color
-Size
-Font type
-Bold
-Italic
-Default values
-Optimitzed large lines support.

Advanced options(Using MACL script, more info inside)
-Shadow
-Vertical gradient
-Horizontal gradient
-Outline

It includes advices to draw event variables.


A call script example:

@m = Message.new
@m.bold = true
@m.size = 48
@m.font = "Arial"
@m.italic = true
@m.color = Color.new(134,176,188,154)
@m.t"Text to show"
+Event command Show Picture

Note: This is my first completed script. Its in development, tell me any suggerences or bugs. My english is bad, if you see some thing to improve in the instructions...

Complete instructions in the script.

CODE
#======================================================================
========
# Picture Text Command
# By gerkrt/gerrtunk
# Version: 2
# License: GPL, credits
#==============================================================================

=begin

----------------------------------
Instalation and compatiility
----------------------------------
-Put this script before main.
-To use advance effects install MACL. Here: http://etheon.net/public/dl/macl_complete.txt
Here the forum thread: viewtopic.php?f=11&t=9417
-To install read the instructions. Anyway, you have to put before main but after
this script.

----------------------------------
Instructions
----------------------------------

This script can show pictures based on a text line. The image will be treated like
a normal picture loaded with the show picture event command. It have the same
rules and can be moved, changue tone, erased, etc...

A call script example:

@m = Message.new
@m.bold = true
@m.size = 48
@m.font = "Arial"
@m.italic = true
@m.color = Color.new(134,176,188,154)
@m.t"Text to show"

Then you need to put a command show picture with any image(its not used) and the
values that you will put in a normal event command show picture. The script then creates
creates a bitmap based on your text and options and loading a event picture with it.

You have to use this structure of call script+show picture to use this new command.

----------------------------------
Options and meanings
----------------------------------

Basic options. Description before #:

@m = Message.new # Dont changue or remove this. Always the first thing.

@m.bold = true # Bold letter
@m.size = 48 # Size of the font
@m.font = "Arial" # Fontname
@m.italic = true # Cursive italic
@m.color = Color.new(134,176,188,154) # Text basic color.
@m.t"Wep" # Text to write in the brackets "".

Advanced options. Only with MACL.

@m.shadow = true # Shadowed font
@m.s_color = Color.new(134,176,188,154) # Shadow color
@m.outline = true # Shows a outline
@m.o_color = Color.new(134,176,188,154) # Outline color
@m.horiz_grad = true # Horizontal gradient with two colors
@m.vert_grad = true # Vertical gradient with two colors
@m.g1_color = Color.new(134,176,188,154) # Gradiet Starting color
@m.g2_color = Color.new(1,255,188,154) # Gradiet Endig color

-The only fixed option is @m = Message.new. If you only put this will chargue
a picture based only in your predefenided values.

-Then you have to compose your call scripts adding a option in a new line every time
This a example:

Show message "Noooooo", size 16 and horizontal gradient with defined colors:

@m = Message.new
@m.t"Nooooooooooooooooo"
@m.size = 16
@m.horiz_grad = true
@m.g1_color = Color.new(134,176,188,154)
@m.g2_color = Color.new(1,255,188,154)

-The order dont care. The only rule is to put the @m = Message.new first.

-The two gradients use the same colors values.

-Incompatible effects: the two gradients, shadow/outline.

-Remember to quit the #'s.

-You can make a large call script in two call scripts, simply continue writting
in the next. The other option is:

@m.size = 16 ; @m.horiz_grad = true

The ; is a ruby line internal separator. Its like they are in different lines.

-Some advice about the values:

Color.new(134,176,188,154) Red,Green,Blue+alpha Only changue the numbers. 0-255.
"Texts": You must use the "" and the text inside of them.
true/false: It means Active or Inactive. For example to write bold: @m.bold = true

If the sucker call script gives you strange errors this is what you can try:

-Recolocate the larger scripts lines: spaces,intros,etc
-Add a new option at the end, event if its inactive one.

--------------------------------------------
Advices to write the text
--------------------------------------------

-To only write a event variable value :
@m.t$game_variables[variable_id].to_s

-Complex phrases:
@m.t"HP:"+$game_variables[variable_id].to_s+" "+"Z"

It writes HP:var Z.

-In ruby the + concatenate words to make larger ones.
-Use " " if you need some spaces or aligns
-Respect the "" word delimitators.
-The $game_variables[variable_id].to_s dont use "", but internslly its treated like a word
-variable_id: The number ID of a event variable

----------------------------------
Long lines
----------------------------------

Call script command suck for these. This a example of what you have to do:

@m.t"HP:"+$game_variables[variable_id].to_s

@m.t" MP:"+$game_variables[variable_id2].to_s

@m.t" Limit: "+$game_variables[variable_id3].to_s

The script automatically concatenates all. Just write it in order.

------------------------
Default values
------------------------

If you need this, you can make your predefenided values for all the options.
With this, the command can be shorter, removing the lines you dont need.

The constants names are Def_font_+ the option of the @ that you alreadyknow.

=end
module Wep
Def_font_name = "Arial"
Def_font_text = "Wep"
Def_font_size = 24
Def_font_bold = false
Def_font_italic = false
Def_font_color = Color.new(255, 255, 255, 255) # The normal color
Def_font_horiz_grad = false
Def_font_vert_grad = false
Def_font_outline = false
Def_font_shadow = false
Def_font_s_color = Color.new(0, 0, 0, 100)
Def_font_o_color = Color.new(0, 0, 0)
Def_font_g1_color = Color.new(255, 45, 255)
Def_font_g2_color = Color.new(12, 128, 128)
end


#==============================================================================
class Message
attr_accessor :text
attr_accessor :font
attr_accessor :size
attr_accessor :bold
attr_accessor :italic
attr_accessor :color
attr_accessor :horiz_grad
attr_accessor :vert_grad
attr_accessor :shadow
attr_accessor :outline
attr_accessor :s_color
attr_accessor :o_color
attr_accessor :g1_color
attr_accessor :g2_color
def initialize(text=Wep::Def_font_text,font=Wep::Def_font_name,size=Wep::Def_font_si
ze,bold=Wep::Def_font_bold,italic=Wep::Def_font_italic, color=Wep::Def_font_color, horiz_grad=Wep::Def_font_horiz_grad,vert_grad=Wep::Def_font_vert_grad,outline=We
p::Def_font_outline,shadow=Wep::Def_font_shadow, s_color=Wep::Def_font_s_color, o_color=Wep::Def_font_o_color,g1_color=Wep::Def_font_g1_color,g2_color=Wep::Def_
font_g2_color) @text = text
@font = font
@size = size
@bold = bold
@italic = italic
@color = color
@s_color = s_color
@o_color = o_color
@g1_color = g1_color
@g2_color = g2_color
@horiz_grad = horiz_grad
@vert_grad = vert_grad
@shadow = shadow
@text = ""
@text = text
@outline = outline
@first_concat = true
end

#--------------------------------------------------------------------------
# *t This metod concatenates the text string.
# Optimitzed to be very short.
#--------------------------------------------------------------------------

def t(text)
# Check if the text is the predefined and its the first time to add
# and clears it
if Wep::Def_font_text == @text and @first_concat
@text = ""
end
@first_concat = false
@text += text
end
end

class Sprite_Picture
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
super
# If picture file name is different from current one and have a message
if @picture_name != @picture.name and @picture.message
# Remember file name to instance variables
@picture_name = @picture.name
#if @picture_name != ""
# Get picture graphic

#end
# Use the testing bitmap to know text size
$game_screen.testing_bitmap.font.name = @picture.message.font
$game_screen.testing_bitmap.font.size = @picture.message.size
$game_screen.testing_bitmap.font.bold = @picture.message.bold
$game_screen.testing_bitmap.font.italic = @picture.message.italic
line = @picture.message.text
needed_rect = $game_screen.testing_bitmap.text_size(line)
# Changue basic font options
self.bitmap = Bitmap.new(needed_rect.width, needed_rect.height)
self.bitmap.font.name = @picture.message.font
self.bitmap.font.size = @picture.message.size
self.bitmap.font.bold = @picture.message.bold
self.bitmap.font.italic = @picture.message.italic
self.bitmap.font.color = @picture.message.color
# Exception check if MACL is instaled or not
begin
if MACL != nil
# Changue advanced font options
self.bitmap.font.horiz_grad = @picture.message.horiz_grad
self.bitmap.font.vert_grad = @picture.message.vert_grad
self.bitmap.font.outline = @picture.message.outline
self.bitmap.font.shadow = @picture.message.shadow
self.bitmap.font.shadow_color = @picture.message.s_color
self.bitmap.font.outline_color = @picture.message.o_color
self.bitmap.font.grad_s_color = @picture.message.g1_color
self.bitmap.font.grad_e_color = @picture.message.g2_color
end
rescue
end
self.bitmap.draw_text(0, 0, needed_rect.width, needed_rect.height, line)

end
# If picture file name is different from current one
if @picture_name != @picture.name and @picture.message == nil
# Remember file name to instance variables
@picture_name = @picture.name
# If file name is not empty
if @picture_name != ""
# Get picture graphic
self.bitmap = RPG::Cache.picture(@picture_name)
end
end
# If file name is empty
if @picture_name == ""
# Set sprite to invisible
self.visible = false
return
end
# Set sprite to visible
self.visible = true
# Set transfer starting point
if @picture.origin == 0
self.ox = 0
self.oy = 0
else
self.ox = self.bitmap.width / 2
self.oy = self.bitmap.height / 2
end
# Set sprite coordinates
self.x = @picture.x
self.y = @picture.y
self.z = @picture.number
# Set zoom rate, opacity level, and blend method
self.zoom_x = @picture.zoom_x / 100.0
self.zoom_y = @picture.zoom_y / 100.0
self.opacity = @picture.opacity
self.blend_type = @picture.blend_type
# Set rotation angle and color tone
self.angle = @picture.angle
self.tone = @picture.tone
end
end

class Game_Screen
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :testing_bitmap # Unique testing bitmap for text size calculation
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
alias gsc_init initialize
def initialize
gsc_init
@testing_bitmap = Bitmap.new(1,1)
end
end




class Game_Picture
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_reader :message # text
#--------------------------------------------------------------------------
# * Object Initialization
# number : picture number
#--------------------------------------------------------------------------
alias gp_init initialize
def initialize(number)
gp_init(number)
@message = nil
end

alias gp_show show
def show(name, origin, x, y, zoom_x, zoom_y, opacity, blend_type, message=nil)
gp_show(name, origin, x, y, zoom_x, zoom_y, opacity, blend_type)
@message = message
end
alias gp_erase erase
def erase
gp_erase
@message = nil
end
end


class Interpreter
#--------------------------------------------------------------------------
# * Show Picture
#--------------------------------------------------------------------------
def command_231
# Get picture number
number = @parameters[0] + ($game_temp.in_battle ? 50 : 0)
# If appointment method is [direct appointment]
if @parameters[3] == 0
x = @parameters[4]
y = @parameters[5]
# If appointment method is [appoint with variables]
else
x = $game_variables[@parameters[4]]
y = $game_variables[@parameters[5]]
end
# Show picture
# If message is written
if @m != nil
$game_screen.pictures[number].show(@parameters[1], @parameters[2],
x, y, @parameters[6], @parameters[7], @parameters[8], @parameters[9], @m)
# Format m for other calls
@m = nil
else
$game_screen.pictures[number].show(@parameters[1], @parameters[2],
x, y, @parameters[6], @parameters[7], @parameters[8], @parameters[9])

end
# Continue
return true
end
end
Go to the top of the page
 
+Quote Post
   

70 Pages V  « < 64 65 66 67 68 > » 
Reply to this 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 - 11:21 AM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker