Jump to content
Rpg²S Forum

*Leon_Westbrooke New shop Interface


NAS_96
 Share

Recommended Posts

a nessuno e' successo?

NAS non sapeva come dirtelo,quindi te lo dico io.

Esiste uno script che io personalmente scoprii 1 anno fa che pur implementando un sistema locanda non era solo questo dall'apparenza ma era anche un adattatore di font,inoltre funziona anche su progetti dove font non si leggono e dove hai modificato la libreria RGSS.

Però Dimmi come ti funziona dopo,se ti funziona o no. :rovatfl:

 

#======================================================================

=# ** The Complete Windowskin Color, Faceset & Inn System

#-------------------------------------------------------------------------------

# by DerVVulfman

# Version 2

# 01-17-06

#------------------------------------------------------------------------------

# ** Script Modules Added:

# Module RPG(Bitmap) .. Editable: For default Font & Font Size

#

# ** Script Pages Modified:

# Game_Temp .. Editable: For all custom systems

# Window_Base .. added draw_actor_portrait & edited draw_class

# modified get_text_color 'n etc. for windowskin system

# Window_Selectable .. added draw_actor_portrait for Window_Message

# Window_MenuStatus .. edited refresh to include facesets

# Window_Status .. edited refresh to include facesets

# Window_SaveFile .. edited initialize & refresh to include facesets

# Window_NameEdit .. edited refresh to include facesets

# Window_Message .. edited refresh & reset_window for faceset system

# Scene_File .. edited main and update for faceset system

# Scene_Save .. edited write_save_data to include facesets

# Scene_Load .. edited read_save_data to include facesets

#

# ** Script Pages Added:

# Faceset .. called routine to display facesets in messages & inn

# Scene_Inn .. called routine to recreate the RM2K inn

# Window_Inn .. window screens for the inn system

#

#------------------------------------------------------------------------------

#

# * WINDOWSKIN COLORS *

#

# By using my script, and a suitably modified windowskin, you can have sixteen

# preset colors in your game. You can also SWITCH between your color schemes

# by switching windowskins.

#

# Because the system now allows for 16 colors, so too does the message system.

# Instead of /c being a range of 0-7, it now allows values from 0-15!

#

# NOTE: While I designed the system, I did adapt a couple of color value defs

# so my windowskins system is compatable with RPG Advocate's Advanced

# Equipment, Cursed Items, etc. systems.

#

# Though, making a couple of specifically named defs that return colors

# isn't hard at all. I just like the way he made those systems. :)

#

# Let us review, using my base windowskin's colorset - made w/ default colors:

#

# Colors 0 to 7

# #1) ( /c[0]) White (Normal)

# #2) ( /c[1]) Bluish

# #3) ( /c[2]) Pinkish

# #4) ( /c[3]) SeaGreen

# #5) ( /c[4]) SkyBlue

# #6) ( /c[5]) Lavender

# #7) ( /c[6]) Off-White Gold

# #8) ( /c[7]) Light Gray

# Colors 8 to 15 (not originally available in the message system)

# #9) ( /c[8]) Cloud Gray (System)

# #10) ( /c[9]) Yellow (Distress)

# #11) (/c[10]) Red (Knockout)

# #12) (/c[11]) Gold/Orange (Required)

# #13) (/c[12]) Purple (Cursed)

# #14) (/c[13]) Green (Attr. Up)

# #15) (/c[14]) Dark Gray (Attr. Down & Disabled)

# #16) (/c[15]) Black

#

#------------------------------------------------------------------------------

#

# * FACESET *

#

# This script allows you to display facesets in message boxes in roughly the

# same manner as in RM2K / RM2K3. You do so by calling a script:

#

# Script: FaceSet.new(filename,index)

# filename = bmp, jpg, or png filename in pictures directory holding images

# index = index number of image in file

#

# EXAMPLE: Faceset.new("portrait",6)

#

# This command actually does a number of things:

# 1) It checks and makes sure that a graphic image named "Portrait" is in the

# Graphics\Pictures directory

# 2) It saves that filename into the value "message_box_image" in Game_Temp

# 3) It saves that you, the scripter, has chosen image #6 in the image file.

#

# After that, when you make a message box, the box will display the 6th image

# from the "portrait" file. It will widen to accept both the image AND the

# accompanying text. IF there is no "portrait" file, IF there is no 6th image,

# or IF you run the command...

#

# Faceset.new()

#

# ... then, you erase the Faceset from memory, and the message box returns to

# it's normal default size.

#

# NOTE: The faceset images must be exactly 96 x 96 in size. That is exactly

# double the size of the old RM2K faceset size. It does NOT matter if

# the image stores them in in a single row of five, two rows of 20, or

# ten rows of 20! It counts how many rows and how many columns. Your

# faceset image can be any size!

#

# NOTE: This system is being designed for Faceset Styled Menus (like RM2K),

# with the idea of utilizing a default faceset. In it, the first hero's

# image will be index #1, the second's will be #2, etc.

#

#------------------------------------------------------------------------------

#

# * INN SYSTEM *

#

# This script allows you to bring up inns in almost the same manner as those

# in RM2K / RM2K3. You do so by calling a script:

#

# Script: $scene = Scene_Inn.new()

#

# But, it also relies on values stored in Game_Temp in order to operate:

# (inn_message1 to inn_message7, inn_price, inn_music AND inn_switch)

#

# Descriptions: inn_message1: The welcoming message when first turned on.

# inn_message2: A text string showing how much it costs.

# inn_message3: This holds the "Not enough money!" string

# inn_message4: Here, you taunt the customer to staying.

# inn_message5: The ever popular "Have a pleasant stay."

# inn_message6: Your character can say "Sure, why not?"

# inn_message7: Here, your character refuses to stay.

# inn_price: This is the value taken from the party.

# inn_music: A light ME (music effect) file for staying.

# inn_switch: You can specify a switch here, so you can

# make a decision if the hero stayed at an inn.

#

# NOTE: This system ALSO works with the FACESET system, so you can utilize

# facesets with it, or not!

#

# NOTE: In order to make line breaks (multiple lines) in the inn_messages,

# the special RMXP code "\n" is the key. As an example:

#

# $game_temp.inn_message4 = "You gotta be kidding!/nYou wanna stay, right?"

#

# would display.

#

# You gotta be kidding!

# You wanna stay, right?

#

#==============================================================================

 

#==============================================================================

# ** Module RPG (Editable Portion)

#------------------------------------------------------------------------------

# This class handles the default font settings for all window screens that are

# not modified by any other code. As it begins before Game_Temp, the Fontname

# and Fontsize of the Title Screen is controlled here, as well as all of the

# unmodified menus.

#==============================================================================

 

module RPG

class Bitmap < ::Bitmap

Font.default_name = "Comic Sans MS"

Font.default_size = 24

Font.default_bold = false

Font.default_italic = false

Font.default_color = Color.new(255,255,255,255)

end

end

 

 

# -----------------------------------------------------------------------------

# -----------------------------------------------------------------------------

# -----------------------------------------------------------------------------

 

 

#==============================================================================

# ** Game_Temp (Script Edit / Editable Portion)

#------------------------------------------------------------------------------

# This class handles temporary data that is not included with save data.

# Refer to "$game_temp" for the instance of this class.

#------------------------------------------------------------------------------

# This edit allows the scripts to control the size & typeface of the script's

# menu screens. If other menus are added, you may wish to refer to the values

# recorded here.

#

# It also stores the values used in the faceset system.

#==============================================================================

 

class Game_Temp

 

#--------------------------------------------------------------------------

# * Public Instance Variables

#--------------------------------------------------------------------------

attr_accessor :faceset_system

attr_accessor :faceset_file

attr_accessor :message_box_image

attr_accessor :message_box_image_index

# CUSTOM: For Inn System

attr_accessor :inn_message1

attr_accessor :inn_message2

attr_accessor :inn_message3

attr_accessor :inn_message4

attr_accessor :inn_message5

attr_accessor :inn_message6

attr_accessor :inn_message7

attr_accessor :inn_price

attr_accessor :inn_music

attr_accessor :inn_switch

 

#--------------------------------------------------------------------------

# * Object Initialization

#--------------------------------------------------------------------------

alias initialize_game_temp initialize

def initialize

initialize_game_temp

# Custom Screen Font (if used)

$fontname = "Comic Sans MS"

$fontsize = 24

# Faceset System

@faceset_system = true # If menus use facesets (true)

@faceset_file = "Actors" # Faceset file for heroes in menu.

@message_box_image = "" # File for non-menu windows (leave empty)

@message_box_image_index = nil # Index of image IN picture file

# Inn System

@inn_message1 = "Benvenuti nella mia locanda!."

@inn_message2 = "Il costo è di 50 Gladon."

@inn_message3 = "Non hai abbastanza Gladon."

@inn_message4 = "Sicuro?."

@inn_message5 = "Buonanotte!."

@inn_message6 = "Resto."

@inn_message7 = "Non resto."

@inn_price = 50

@inn_music = "014-Inn01"

@inn_switch = 0

end

 

#--------------------------------------------------------------------------

# * End of Class

#--------------------------------------------------------------------------

end

 

 

# -----------------------------------------------------------------------------

# -----------------------------------------------------------------------------

# -----------------------------------------------------------------------------

 

 

#==============================================================================

# ** FaceSet

#------------------------------------------------------------------------------

# This class allows Faceset graphics to appear in Text Boxes.

#==============================================================================

 

class FaceSet

#--------------------------------------------------------------------------

# * Object Initialization

#--------------------------------------------------------------------------

def initialize (file = "", number = nil)

# Assume no faceset file being loaded

$game_temp.message_box_image = ""

# Make sure it is a valid picture (in 1 of 3 formats...)

# and load faceset from Pictures directory

if FileTest.exist?("Graphics/Pictures/" + file + ".bmp")

$game_temp.message_box_image = file

end

if FileTest.exist?("Graphics/Pictures/" + file + ".jpg")

$game_temp.message_box_image = file

end

if FileTest.exist?("Graphics/Pictures/" + file + ".png")

$game_temp.message_box_image = file

end

# if no valid number, erase loaded faceset file

if number == nil

$game_temp.message_box_image = ""

end

# Set number of faceset in image

$game_temp.message_box_image_index = number

end

 

#--------------------------------------------------------------------------

# * End of Class

#--------------------------------------------------------------------------

end

 

 

# -----------------------------------------------------------------------------

# -----------------------------------------------------------------------------

# -----------------------------------------------------------------------------

 

 

#==============================================================================

# ** Window_Base (Reduced Actor class text width)

#------------------------------------------------------------------------------

# This class is for all in-game windows.

#==============================================================================

 

 

#==============================================================================

# ** Window_Selectable (Added draw_actor_portrait)

#------------------------------------------------------------------------------

# This window class contains cursor movement and scroll functions.

#==============================================================================

 

class Window_Selectable < Window_Base

 

#--------------------------------------------------------------------------

# * Draw Portrait

# number : image number in file

# x : draw spot x-coordinate

# y : draw spot y-coordinate

#--------------------------------------------------------------------------

def draw_actor_portrait(number, x, y, hue=0, opacity=255)

filename = $game_temp.faceset_file

# Obtain faceset bitmap from Picture directory

bitmap = RPG::Cache.picture(filename)

# Obtain number of images in bitmap (96 x 96 frames)

cw = bitmap.width

ch = bitmap.height

x_pic = cw / 96

y_pic = ch / 96

# Begin Loop to obtain image location from faceset

i = 0

xpos = 0

ypos = 0

for i in 1..number

xpos = xpos + 1

if xpos > x_pic

xpos = 1

ypos = ypos + 1

if ypos > y_pic

ypos = 1

end

end

end

# Calculate pixel coordinates of image

xpos = xpos - 1

xpos = xpos * 96

ypos = ypos * 96

# Display desired image at location

src_rect = Rect.new(xpos, ypos, 96, 96)

self.contents.font.name = "Comic Sans MS"

self.contents.font.size = 24

self.contents.blt(x , y, bitmap, src_rect,opacity)

self.contents.hue_change(hue)

end

 

#--------------------------------------------------------------------------

# * End of Class

#--------------------------------------------------------------------------

end

 

 

# -----------------------------------------------------------------------------

# -----------------------------------------------------------------------------

# -----------------------------------------------------------------------------

 

 

 

 

# -----------------------------------------------------------------------------

# -----------------------------------------------------------------------------

# -----------------------------------------------------------------------------

 

 

 

 

# -----------------------------------------------------------------------------

# -----------------------------------------------------------------------------

# -----------------------------------------------------------------------------

 

 

 

 

# -----------------------------------------------------------------------------

# -----------------------------------------------------------------------------

# -----------------------------------------------------------------------------

 

 

 

#==============================================================================

# ** Window_Inn

#------------------------------------------------------------------------------

# This window shows the bartering message of innkeepers

#==============================================================================

 

class Window_Inn < Window_Selectable

 

#--------------------------------------------------------------------------

# * Object Initialization

#--------------------------------------------------------------------------

def initialize

super(0, 0, 640, 160)

@face_indent = 0

self.contents = Bitmap.new(width - 192, height - 32)

if $game_temp.message_box_image != ""

@x = @face_indent = 128

end

end

 

#--------------------------------------------------------------------------

# * Set Text

# text : text string displayed in window

#

# NOTE: As each letter is drawn, it removed and erased "text" and any

# value linked to it. Strange as it seemed, I had to use another

# value @text2 and build it up, piece by piece from the dismantled

# text, and had to include any line breaks (\n) that it encountered.

#--------------------------------------------------------------------------

def set_text(text, index = 1)

# Clear window

self.contents.font.name = "Comic Sans MS"

self.contents.font.size = 24

self.contents.clear

# Save menu faceset

@tempfile = $game_temp.faceset_file

$game_temp.faceset_file = $game_temp.message_box_image

# Draw portrait

if $game_temp.message_box_image != ""

draw_actor_portrait($game_temp.message_box_image_index, 8, 16)

end

# Reset menu faceset

$game_temp.faceset_file = @tempfile

# Set empty space for temp string

@text2 = ""

# Text Position Reset

x = y = 0

# Get 1 text character in c (loop until unable to get text)

while ((c = text.slice!(/./m)) != nil)

# If new line text

if c == "\n"

# Add line break to @text2

@text2.concat("\n")

# Add 1 to y

y += 1

# Reset x to 0

x = 0

# go to next text

next

end

# Draw text

#----------------------------------------------------------------------

# * Draw text using the calculated margin

#----------------------------------------------------------------------

self.contents.font.name = "Comic Sans MS"

self.contents.font.size = 24

self.contents.draw_text(4 + x + @face_indent, 32 * y, 40, 32, c)

#----------------------------------------------------------------------

# * End

#----------------------------------------------------------------------

# Add x to drawn text width

x += self.contents.text_size©.width

# Add sliced character to @text2

@text2.concat©

end

# Show inn message window

self.visible = true

# Which message

case index

when 1

# Restore message to welcome

$game_temp.inn_message1 = @text2

when 2

# Restore message to price

$game_temp.inn_message2 = @text2

when 3

# Restore message to no sale

$game_temp.inn_message3 = @text2

when 4

# Restore message to hard sale

$game_temp.inn_message4 = @text2

when 5

# Restore message to goodnight

$game_temp.inn_message5 = @text2

end

end

 

#--------------------------------------------------------------------------

# * End of Class

#--------------------------------------------------------------------------

end

 

 

# -----------------------------------------------------------------------------

# -----------------------------------------------------------------------------

# -----------------------------------------------------------------------------

 

 

#----------------------------------------------------------

 

 

 

# -----------------------------------------------------------------------------

# -----------------------------------------------------------------------------

# -----------------------------------------------------------------------------

 

 

#

 

# -----------------------------------------------------------------------------

# -----------------------------------------------------------------------------

# -----------------------------------------------------------------------------

 

 

#==============================================================================

# ** Scene_Inn (NEW SCRIPT)

#------------------------------------------------------------------------------

# This class performs inn screen processing.

#==============================================================================

class Scene_Inn

 

#--------------------------------------------------------------------------

# * Object Initialization

#--------------------------------------------------------------------------

def initialize()

# Load values stored in $Game_Temp

# That way, you can change 'em or store 'em

@welcome = $game_temp.inn_message1

@the_price = $game_temp.inn_message2

@no_rest = $game_temp.inn_message3

@hard_sale = $game_temp.inn_message4

@goodnight = $game_temp.inn_message5

@command1 = $game_temp.inn_message6

@command2 = $game_temp.inn_message7

@price = $game_temp.inn_price

@music = $game_temp.inn_music

@switch_id = $game_temp.inn_switch

end

 

#--------------------------------------------------------------------------

# * Main Processing

#--------------------------------------------------------------------------

def main

# Set game switch to inn's switch id # (Turned on if inn is used, off if not)

$game_switches[@switch_id] = false

# Copy the background map

@spriteset = Spriteset_Map.new

# Make the inn window

@inn_window = Window_Inn.new

# Display the welcome text

@inn_window.set_text(@welcome, 1)

# Make a decision window (set to visible / active)

@selection= Window_Command.new(160, [@command1, @command2])

@selection.back_opacity = 0

@selection.visible = true

@selection.active = true

# Make an options window (set to invisible / inactive)

@option = Window_Command.new(160, ["Si", "No"])

@option.back_opacity = 0

@option.visible = false

@option.active = false

# Make the gold window

@money = Window_Gold.new

@money.x = 480

# Set inn window vertically

case $game_system.message_position

when 0

@inn_window.y = 0

when 1

@inn_window.y = 160

when 2

@inn_window.y = 320

end

# Set decision, options & money windows based on inn window

@selection.y = @inn_window.y + 64

@money.y = @inn_window.y

@selection.x = @inn_window.width - @selection.width

@option.y = @inn_window.y + 64

@option.x = @inn_window.width - @option.width

@option.y = @selection.y

# Execute transition

Graphics.transition

# Main loop

loop do

# Update game screen

Graphics.update

# Update input information

Input.update

# Frame update

update

# Abort loop if screen is changed

if $scene != self

break

end

end

# Refresh map

$game_map.refresh

# Prepare for transition

Graphics.freeze

# Dispose of spriteset background

@spriteset.dispose

# Dispose of windows

@inn_window.dispose

@selection.dispose

@option.dispose

@money.dispose

end

 

#--------------------------------------------------------------------------

# * Frame Update

#--------------------------------------------------------------------------

def update

# Update spriteset

@spriteset.update

# Update windows

@inn_window.update

@selection.update

@option.update

@money.update

# If selection window is active: update_selection

if @selection.active

update_selection

return

end

# If option window is active: update_options

if @option.active

update_options

return

end

end

 

#--------------------------------------------------------------------------

# * Selection Update

#--------------------------------------------------------------------------

def update_selection

# If B button is pressed

if Input.trigger?(Input::B)

# Play cancel SE

$game_system.se_play($data_system.cancel_se)

# Pause for some time

delay(25)

# Switch to map

$scene = Scene_Map.new

return

end

# If C button is pressed

if Input.trigger?(Input::C)

# Play decision SE

$game_system.se_play($data_system.decision_se)

# Choose based on decision

case @selection.index

# If choice is True / Yes

when 0

# Disable the selection window

@selection.visible = false

@selection.active = false

# Enable the option menu

@option.active = true

@option.visible = true

# Display the price text

@inn_window.set_text(@the_price,2)

@the_price = $game_temp.inn_message2

# If choice is False / No

when 1

# Pause for some time

delay(25)

# Switch to map

$scene = Scene_Map.new

end

end

end

 

#--------------------------------------------------------------------------

# * Options Update

#--------------------------------------------------------------------------

def update_options

# Get current gold

@value = $game_party.gold

# If B button is pressed

if Input.trigger?(Input::B)

# Play cancel SE

$game_system.se_play($data_system.cancel_se)

# Disable option menu

@option.active = false

@option.visible = false

# Enable selection menu

@selection.active = true

@selection.visible = true

# Return to inn menu

return

end

# If C button was pressed

if Input.trigger?(Input::C)

# Play decision SE

$game_system.se_play($data_system.decision_se)

# Choose based on decision

case @option.index

# If choice is true / Yes

when 0

# If gold is not enough

if @value < @price

# Play buzzer SE

$game_system.se_play($data_system.buzzer_se)

# Display money short message

@inn_window.set_text(@no_rest,3)

@no_rest = $game_temp.inn_message3

# Pause for some time

delay(25)

# Switch to map screen

$scene = Scene_Map.new

return

end

# If gold is enough

# Pay the inn

$game_party.lose_gold(@price)

@money.refresh

# Play inn melody

Audio.me_play("Audio/ME/" + $game_temp.inn_music, 80, 80)

# Pay the inn

$game_party.lose_gold(@price)

@money.refresh

# Restore actors at the inn

for i in 0...$game_party.actors.size

@actor = $game_party.actors

@actor.hp = @actor.maxhp

@actor.sp = @actor.maxsp

end

# Pause for some time

delay(15)

# Prepare for transition

Graphics.transition(40)

# Display goodnight message

@inn_window.set_text(@goodnight, 50)

# Pause for some time

delay(25)

# Switch to map scene

$scene = Scene_Map.new

# Success: Flag the inn's switch ON

$game_switches[@switch_id] = true

# If choice is false / No

when 1

# Display hard sale message

@inn_window.set_text(@hard_sale,4)

@hard_sale = $game_temp.inn_message4

# Disable option menu

@option.active = false

@option.visible = false

# Enable selection menu

@selection.active = true

@selection.visible = true

end

end

end

 

#--------------------------------------------------------------------------

# * Delay System

#--------------------------------------------------------------------------

def delay(wait)

count = Graphics.frame_count

while wait + count >= Graphics.frame_count

Graphics.update

end

end

 

#--------------------------------------------------------------------------

# * End of Class

#--------------------------------------------------------------------------

end

 

PROGETTI IN CORSO:

 

http://img88.imageshack.us/img88/8484/bannerfirmabetatester.jpg

 

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

In chat il mio nickname sarà Aleks o Al, mi pento ancora di essermi messo il nick tamarro di Aliuzz.ç_ç

 

http://img571.imageshack.us/img571/6659/alicei.png

membro ufficiale fondatore n4 di mrfruffolobatuffolo

http://img717.imageshack.us/img717/4789/mrfruffolobanner.jpg

 

 

Rudo:

Ti ringrazio. Ci misi tutto me stesso diversi anni fa per realizzare CrystalQuest. Sebbene la mia visione sia cambiata con il passare del tempo, ci sono molti aspetti che manterrei se dovessi (per assurdo) realizzare una nuova avventura oggi.

 

Questo non accade tutti i giorni,sono commosso.ç_ç

 

 

Orgoglioso membro del trio *o*

Link to comment
Share on other sites

ora funziona grazie mille! :sisi:

Ok,perfetto.^_^

PROGETTI IN CORSO:

 

http://img88.imageshack.us/img88/8484/bannerfirmabetatester.jpg

 

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

In chat il mio nickname sarà Aleks o Al, mi pento ancora di essermi messo il nick tamarro di Aliuzz.ç_ç

 

http://img571.imageshack.us/img571/6659/alicei.png

membro ufficiale fondatore n4 di mrfruffolobatuffolo

http://img717.imageshack.us/img717/4789/mrfruffolobanner.jpg

 

 

Rudo:

Ti ringrazio. Ci misi tutto me stesso diversi anni fa per realizzare CrystalQuest. Sebbene la mia visione sia cambiata con il passare del tempo, ci sono molti aspetti che manterrei se dovessi (per assurdo) realizzare una nuova avventura oggi.

 

Questo non accade tutti i giorni,sono commosso.ç_ç

 

 

Orgoglioso membro del trio *o*

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...