-
Posts
166 -
Joined
-
Last visited
Content Type
Profiles
Forums
Calendar
Posts posted by Un_Insetto
-
-
Senza che riscarico sempre la demo che modifica hai apportato? Ovviamente devi teletrasportare l'eroe sul mare e poi farlo muovere piano piano verso il basso con fantasma ON per non farlo bloccare fino a farlo arrivare sulla scritta inizia.
^ ^
Il tuo problema è che hai una mappa grande e quindi se muovi l'eroe la telecamera lo seguirà sempre, prova a creare un'altra mappa di dimensione minima che mostra solo il fondo della mappa precedente ed una volta arrivato in basso teletrasporta l'eroe nella nuova mappa e lì metti le opzioni.
^ ^
ok risolto grazie mille. ah comunque i miniscript per "inizia" e "carica" che mi hai dato non funzionano tranne quello che mi fa uscire
-
@Un: il problema è che tu hai usato un teletrasporto all'inizio dopo il muovi mappa e poi intorno alle opzioni. Quando tu hai fatto fermare l'evento ad inizio automatico con il ferma evento (elimina evento), questo non si disattiva per sempre, ma se rientri nella mappa rinizia. Qui il problema, tu ti teletrasporti di nuovo nella mappa, tutto quindi ricomincia e così l'inizio automatico che si ripete all'infinito avendo un teletrasporto dentro. O metti una switch al posto del ferma evento per terminare l'inizio automatico oppure utilizzi salta e muovi eroe al posto del teletrasporto. Considera poi che puoi mettere dissolvenza nessuna per il teletrasporto così non hai sempre l'effetto nero fastidioso.
^ ^
@Go: sì, ma dovrebbe essere solo il primo nil, cioè quello tra ####, l'altro dice appunto se il video non è nil allora fai questo, ma se tu gli metti se il video non è nome video allora ovviamente ti salta tutto! XD
^ ^
grazie però ora l'intro parte dalla scritta inizia e non come prima dal mare
http://www.mediafire.com/download/56c677o237ws5ot/Titolo_da_mettere.exe
-
Ah allora son semplici ti manca in pratica l'esci dal gioco ed il nuovo gioco che sono rispettivamente:
SceneManager.exit
SceneManager.goto(Scene_Map)
Puoi ricavarli facilmente osservando la scene_title, inizia un po' così a toccare gli script, ti sarà utile.
^ ^
ok grazie mille :) comunque ho sviluppato un piccolo sistema ad eventi per il menù, però ho un problema all'avvio del gioco. (se volete date un'occhiata pure al sistema che ho fatto per segnalarmi eventuali errori)
http://www.mediafire.com/download/56c677o237ws5ot/Titolo_da_mettere.exe
-
No intendo quelli che sono tipo $game_load.new (per la schermata dove carica la partita) praticamente i 3 script che ci sono nel title screenNon so se intendi questa. E' la discussione recente con tutti i codici utili per i call script.
^ ^
Forse i comandi per saltare il title non ci sono, ti servivano solo quelli? ^ ^
-
premetto che ho già cercato sul forum con il tasto "cerca" quella discussione, ma non l'ho trovata. voi sapete dov'è quella discussione che parla di "miniscript" per esempio come creare un nuovo gioco oppure come aprire la schermata di salvataggio, insomma i comandi del menù
-
1-I "Seguaci". Sono gli altri membri del party che ti seguono in giro, li trovi sulla seconda pagina dei comandi
2-Da "Muovi Evento" - Giocatore. In VX Ace non si può dare ad un evento la proprietà "In primo piano"...ma finchè sulla finestra non ci sono tileset complessi, non sarà un problema.
l'ho fatto ma comunque se possibile scarica la "demo" che ho messo prima per guardian per capire cosa sto facendo, perchè usare il player come cursore mi sembra alquanto strano/difficile
-
1-Cambi la grafica dell'eroe in quella di una manina, una freccia o quello che vuoi, disabilitando i follower se necessario
2-Gli dai le proprietà Attraversa e Sempre in Primo piano
3-Al posto dei pulsanti metti eventi con comando Azione sotto l'eroe.
.......eh?
1 cosa sono e come si disabilitano i "follower"
2 come cambio le proprietà
o.o"
-
dato che non trovo script per mouse che mi piacciono tantissimo, potresti/e spiegarmi come usare il player come cursore?
-
Oppure cosa più facile, un convertitore online!ho trovato uno script che permette di interrompere o mettere in pausa qualsiasi video, ma c'è scritto che ha bisogno dei video .avi. Quindi volevo sapere se esistesse tale script, io al momento nn l'ho trovato.. invece lo script di cui ti parlo, si trova nel topic che ho aperto giorni fà
http://www.zamzar.com/convert/avi-to-ogg/
Ora scrivo dal cell quindi non sono riuscito a provarlo, fammi sapere :)
-
Ehm... l'errore è dato dal call script del primo evento nella mappa Introduzione, quello in mezzo al mare, c'è difatti scritto enable in quel call script, se lo cancelli funziona ^ ^"
ah già comunque non so se hai notato ma quando c'è il menù se con il puntatore clicchi per esempio sulla terra la mappa si sposta D: (questo script l'ho messo 1 perchè non sapevo come usare il player come cursore 2 perchè credo sia più bello con il mouse)
-
Ok, se puoi postarlo postalo, il peso lo chiedevo per te, se ad upparlo ci mettevi molto, poi bisogna vedere se vuoi spoilerare quello che c'è finora, insomma, vedi te se vale la pena di postarlo.
^ ^
ok ora modifico e posto. all'inizio non volevo però alla fine e solo una intro quindi non svelo niente
http://www.mediafire.com/download/56c677o237ws5ot/Titolo_da_mettere.exe
-
Il progetto pesa molto? Potresti postarlo?
Quell'errore solitamente è dato da call script, ovviamente se in un progetto senza script funziona e se nel tuo progetto senza script non funziona il problema deve essere negli eventi.
^ ^
pesa 22,3 MB (sono andato nella cartella del gioco e ho cliccato proprietà credo sia questo il suo peso)
-
Allora se in un nuovo progetto con tutti gli script che usi funziona e nel tuo no deve per forza esserci un call script da qualche parte che dà quell'errore, prova vedere bene tutti gli eventi e gli eventi comuni.
^ ^
il problema è che l'ho già fatto :/ se vuoi te li dico, avevo dei commenti che rimandavano ad uno script, io, per sicurezza, ho tolto sia quei commenti sia lo script a cui portavano. poi avevo anche (quello che ti ho detto prima) un call script o script call come diavolo si dice, che mandava ad un menù di salvataggio diverso da quello di default
-
Cioè rimane l'errore? Ma ora sei sicuro che nel tuo gioco c'è solo lo script nuovo che vuoi inserire? Hai provato su un nuovo progetto? > <
si. e di nuovo si ho provato anche su un nuovo progetto mettendo uno script alla volta e una volta visto che funzionava ho deciso di trasportare tutti i file del gioco originale in quel test, una volta riprovato mi ha dato ancora quel errore
-
@Un: come c'è scritto nello script call? Chiama uno degli script che hai tolto? Devi togliere tutti gli script ad uno ad uno per vedere se il problema è la compatibilità con lo script nuovo, ovviamente se togli tutti gli script devi togliere anche i call script relativi.
^ ^
ho provato sia a togliere quello script che il suo script call ma non ha funzionato :/
-
@Un: credo tu abbia uno script call che è rimasto usato nel gioco. Prova acontrollare gli eventi.
^ ^
@Michele: non ti basta cambiare la grafica e la velocità dell'eroe? ^ ^
si ma mi serve perchè è una schermata di salvataggio diversa da quella normale che necessita di uno script call. devo per forza toglierla? :/
-
Quando c'è un errore nello script, aprendo lo script vieni automaticamente mandato alla parte del codice che ha causato il crash. Posta anche quella.
eval(script)
è nella sezione Game_Interpreter
-
ieri ho inserito nel progetto lo script Mouse system button di Falcao
|
|
|
\/
#===========================================================================#
# #*****************# #
# #*** By Falcao ***# Mouse System Buttons 2.5 #
# #*****************# This is a button based mouse script, allow #
# create as many buttons you want to the map #
# screen or map ground, also provide you full #
# RMVXACE mouse interaction within the game play #
# #
# #
# Falcao RGSS site: http://falcaorgss.wordpress.com #
# Falcao Forum site: http://makerpalace.com #
# #
#===========================================================================#
#----------------------------------------------------------------------------
# * Version 2.5 change log (Date: June 9 2013)
#
# Fixed non-refreshing item description bug
# Fixed Save file selection issue
# Added ability to start events even if the player is no facing the event
# Removed option to display arrow selector on save file
# Added compatibility for multiples game resolutions
# Item selection with mouse is now more occurate
# Fixed issue with pearl skillbar (when clicking any tool perform path finding)
# Cleaned up some code
#
#----------------------------------------------------------------------------
# * Version 2.0 change log (Date: January 13 2013)
#
# - Added path finding, now the game player is able to move using the mouse
# - Now you are able to change the mouse cursor icon in game
# - Two new notetags added to change the mouse cursor by event comment tags
# - Fixed crash when pointing a notetagged event with a valid condition
#----------------------------------------------------------------------------
# * Version 1.6 change log (Date: November 21 2012)
#
# - Added compatibility for any game screen resolution
# - System optimized to consume less cpu than before
# - Added extra compatibility for Pearl ABS Liquid
# - Removed the font fix
# - Added the imported bolean
#----------------------------------------------------------------------------
# * Version 1.5 change log
#
# - Fixed cursor sound over loading on selectable windows
# - Fixed bug when selecting event graphic tileset that have mouse comment tag
# - FIxed minor bug when transfering (event name now erase completely)
# - Added option to turn on / off arrow selector on save file
# - Important! changes on mouse comment tags!
# ~ CLICK START change to MOUSE START
# ~ ANIMATION change to MOUSE ANIMATION
# ~ NAME change to MOUSE NAME
#
#---------------------------------------------------------------------------
# * installation
#
# Copy and paste this script above main done!
#
# * Mouse triggers
# - Left click: Action button
# - Right click: Cancel button, close windows
# - Mouse wheel middle button: DASH
#
#---------------------------------------------------------------------------
# * Main features
#
# - Allow you create buttons and configure them to do something
# - Events can be buttons too, map ground buttons! for some puzzles etc.
# - Allow you display event name
# - Full mouse interaction
# - WASD movement optional
# - Path finding feature, player is able to move using the mouse
# - Mouse cursor changing in-game enabled
#---------------------------------------------------------------------------
# * Event buttons commands
#
# Write this lines on event comments tags
#
# MOUSE START - Event start when you click the event
# MOUSE ANIMATION x - Show animation when mouse is over event,
# ex: MOUSE ANIMATION 1
# MOUSE NAME x - Display event name when mouse is over event,
# ex: MOUSE NAME Falcao
# MOUSE ICON x - change the mouse cursor icon when it is over the event
# change x for the icon index to display
# MOUSE PIC X - Change the mouse cursor when is over an event but in this
# case it display a picture graphic name, change x for the
# picture name
#------------------------------------------------------------------------------
# * Script calls
#
# Call this line to turn off/on the mouse cursor within the game true/false
# Mouse.show_cursor(false)
#
# If you want to change the mouse cursor manually use the following script calls
# Mouse.set_cursor(:iconset, x) - change x for any icon index
#
# if you want to show a picture instead iconset use the next script call
# Mouse.set_cursor(:picture, name) - change name for picture name
#-----------------------------------------------------------------------------
module Map_Buttons
# You can easily insert as many buttons you want to the map screen
# define here below your buttons parameters
Insert = {
#-----------------------------------------------------------------------------
# A => [b, C, D, E, F]
#
# A = Button number
#
# B = Name
# C = X position in screen tile
# D = Y position in screen tile
# E = Icon, if you want a picture write picture 'name' otherwise icon index
# F = What this button gonna do?, you have two options, call scene or call
# common event, if you want scene put scene name, if you want common event
# put common event ID
# This button call the menu screen
1=> ["Menu", 16, 11, 117, Scene_Menu],
# This button call a common event ID 1
2=> ["Bestiary", 16, 12, 121, 1],
}
# * General configutration
# Mouse cursor icon, if you want a picture write pic 'name' otherwise icon index
CursorIcon = 386
# Switch ID to turn off/on the icons on the screen
Switch = 100
# Allow movement with W A S D keys true/false
WASD_Movement = true
# When you click on event, do you want the player to ignore the self movement?
IgnoreEventPath = true
# Switch id to enable or disable the path finding feature
PathFinderSwitch = 500
#
#----------------------------------------------------------------------------
#
# * License
#
# You can use this script in non comercial games, in you need it for comercial
# games let me know. falmc99@gmail.com
#-----------------------------------------------------------------------------
def self.check_value(value)
return 'numeric' if value.is_a? Fixnum
return 'string'
end
end
($imported ||= {})[:Mouse_System_Buttons] = 2.0
# This class create all screen and event buttons on game screen
class Interactive_Buttoms
attr_reader :cursoring
def initialize
create_screen_buttoms
@ani_delay = 0
@pearl_abs = $imported["Falcao Pearl ABS Liquid"]
end
def create_screen_buttoms
@buttons_sprites = []
for i in Map_Buttons::Insert.values
@buttons_sprites.push(Sprite_Buttons.new(i[0], i[1], i[2], i[3], i[4]))
end
end
def create_button_text
if @button_text.nil?
@button_text = Sprite.new
@button_text.bitmap = Bitmap.new(100, 32)
@button_text.z = 50
@button_text.bitmap.font.size = 16
end
end
def dispose_screen_buttons
for button in @buttons_sprites
button.dispose
end
@buttons_sprites = []
end
def dispose_button_text
if not @button_text.nil?
@button_text.dispose
@button_text.bitmap.dispose
@button_text = nil
end
end
def dispose
dispose_screen_buttons
dispose_button_text
end
def update
if $game_switches[Map_Buttons::Switch] and not @buttons_sprites.empty?
dispose_screen_buttons
elsif not $game_switches[Map_Buttons::Switch] and @buttons_sprites.empty?
create_screen_buttoms
end
update_buttons
update_event_selection
end
# path update
def update_path
return if $game_switches[Map_Buttons::PathFinderSwitch]
return if $game_message.busy?
return unless $game_player.normal_walk?
@mxx, @myy = Mouse.map_grid[0], Mouse.map_grid[1]
if Map_Buttons::IgnoreEventPath
$game_map.events.values.each do |event|
return if event.x == @mxx and event.y == @myy
end
end
$game_player.find_path(@mxx, @myy) unless on_toolbar?
end
def on_toolbar?
return false unless @pearl_abs
9.times.each {|x| return true if @mxx == PearlSkillBar::Tile_X + x and
@myy == PearlSkillBar::Tile_Y}
return false
end
def update_buttons
for button in @buttons_sprites
button.update
if button.zooming
@screen_b = true
create_button_text
if button.x > 272
x, y = button.px * 32 - 98, button.py * 32
draw_button_text(x, y, button.name, 2)
elsif button.x < 272
x, y = button.px * 32 + 31, button.py * 32
draw_button_text(x, y, button.name, 0)
end
end
end
if @screen_b != nil
unless mouse_over_button?
dispose_button_text
@screen_b = nil
end
end
end
def reset_cursor
if Map_Buttons::check_value(@cursoring[1]) == 'numeric'
Mouse.set_cursor(:iconset, @cursoring[1], true)
else
Mouse.set_cursor(:picture, @cursoring[1], true)
end
@cursoring = nil
end
def apply_iconchanging(sym, operand, event)
cursor = $game_system.cursorr
cursor = Map_Buttons::CursorIcon if cursor.nil?
@cursoring = [event, cursor]
Mouse.set_cursor(sym, operand, true)
end
def update_event_selection
return if @screen_b #disable event buttom if mouse over screen buttom
update_path if Mouse.trigger?(0)
for event in $game_map.events.values
next if event.page.nil?
if event.x == Mouse.map_grid[0] and event.y == Mouse.map_grid[1]
if event.mouse_start
if Mouse.trigger?(0) and !$game_map.interpreter.running?
event.start
end
end
if event.square_size?($game_player, 2)
if Mouse.trigger?(0) and !$game_map.interpreter.running?
event.start
end
end
anime = event.mouse_animation
if anime != 0
@ani_delay += 1
event.animation_id = anime if @ani_delay == 1
@ani_delay = 0 if @ani_delay > 16
end
name = event.mouse_name
if name != ""
@eve = [event.x, event.y, event, name]
create_button_text
end
icon = event.mouse_iconset
picture = event.mouse_picture
if !icon.nil? and icon != 0 and @cursoring.nil?
apply_iconchanging(:iconset, icon, event)
elsif !picture.nil? and picture != "" and @cursoring.nil?
apply_iconchanging(:picture, picture, event)
end
end
end
if @cursoring != nil
reset_cursor if not mouse_over_event?(@cursoring[0].x, @cursoring[0].y)
end
if @eve != nil
@eve[2].ch_oy.nil? ? event_oy = 32 : event_oy = @eve[2].ch_oy
if event_oy > 32
draw_button_text(@eve[2].screen_x - 49,
@eve[2].screen_y - event_oy / 2 - 50, @eve[3], 1)
else
draw_button_text(@eve[2].screen_x - 49,
@eve[2].screen_y - event_oy / 2 - 36, @eve[3], 1)
end
if not mouse_over_event?(@eve[0], @eve[1])
dispose_button_text
@eve = nil
end
end
end
def draw_button_text(x, y, text, a=0)
return if @button_text.nil?
@button_text.x = x
@button_text.y = y
return if @old_name == text
@button_text.bitmap.clear
@button_text.bitmap.draw_text(2, 0, @button_text.bitmap.width, 32, text, a)
@old_name = text
end
def mouse_over_button?
for button in @buttons_sprites
if Mouse.object_area?(button.x, button.y - 6, button.width, button.height)
return true
end
end
@old_name = nil
return false
end
def mouse_over_event?(event_x, event_y)
if Mouse.map_grid[0] == event_x and Mouse.map_grid[1] == event_y
return true
end
@old_name = nil
return false
end
end
# Set buttons sprites
class Spriteset_Map
alias falcao_insert_buttuns_view create_viewports
def create_viewports
@interact_buttoms = Interactive_Buttoms.new
falcao_insert_buttuns_view
end
alias falcao_insert_buttuns_dis dispose
def dispose
@interact_buttoms.reset_cursor if @interact_buttoms.cursoring != nil
@interact_buttoms.dispose
falcao_insert_buttuns_dis
end
alias falcao_insert_buttuns_up update
def update
if $game_player.clear_mousepointers
@interact_buttoms.dispose
$game_player.clear_mousepointers = nil
end
@interact_buttoms.update
falcao_insert_buttuns_up
end
end
# comments definition
class Game_Event < Game_Character
attr_reader :mouse_start, :mouse_animation, :mouse_name, :mouse_iconset
attr_reader :mouse_picture, :page
alias falcaomouse_setup setup_page_settings
def setup_page_settings
falcaomouse_setup
@mouse_start = check_comment("MOUSE START")
@mouse_animation = check_value("MOUSE ANIMATION")
@mouse_name = check_name("MOUSE NAME")
@mouse_iconset = check_value("MOUSE ICON")
@mouse_picture = check_name("MOUSE PIC")
end
def check_comment(comment)
return false if @list.nil? or @list.size <= 0
for item in @list
if item.code == 108 or item.code == 408
if item.parameters[0].include?(comment)
return true
end
end
end
return false
end
def check_value(comment)
return 0 if @list.nil? or @list.size <= 0
for item in @list
if item.code == 108 or item.code == 408
if item.parameters[0] =~ /#{comment}[ ]?(\d+)?/
return $1.to_i
end
end
end
return 0
end
def check_name(comment)
return "" if @list.nil? or @list.size <= 0
for item in @list
next unless item.code == 108 or item.code == 408
if item.parameters[0] =~ /#{comment} (.*)/
return $1.to_s
end
end
return ""
end
def square_size?(target, size)
distance = (@x - target.x).abs + (@y - target.y).abs
enable = (distance <= size-1)
return true if enable
return false
end
end
# Create screen buttons sprites
class Sprite_Buttons < Sprite
attr_reader :px
attr_reader :py
attr_reader :name
attr_reader :zooming
def initialize(name, px, py, icon_index, action=nil)
super()
self.z = 50
@icon_index = icon_index
@px = px
@py = py
@action = action
@object_zooming = 0
@zooming = false
@name = name
set_bitmap
update
end
def update
super
if Mouse.object_area?(self.x, self.y - 4, self.bitmap.width,
self.bitmap.height)
@zooming = true
@object_zooming += 1
case @object_zooming
when 1..10 ; self.zoom_x -= 0.02 ; self.zoom_y -= 0.02
when 11..20 ; self.zoom_x += 0.02 ; self.zoom_y += 0.02
when 21..30 ; self.zoom_x = 1.0 ; self.zoom_y = 1.0
@object_zooming = 0
end
if Mouse.trigger?(0) and @action != nil
unless $game_map.interpreter.running?
Sound.play_ok
if @action == Scene_Menu and not $game_system.menu_disabled
SceneManager.call(@action)
Window_MenuCommand::init_command_position
return
end
if Map_Buttons::check_value(@action) == 'numeric'
$game_temp.reserve_common_event(@action)
else
SceneManager.call(@action)
end
end
end
elsif @object_zooming > 0
self.zoom_x = 1.0
self.zoom_y = 1.0
@object_zooming = 0
else
@zooming = false
end
end
def set_bitmap
if Map_Buttons::check_value(@icon_index) == 'numeric'
self.bitmap = Bitmap.new(24, 24)
bitmap = Cache.system("Iconset")
rect = Rect.new(@icon_index % 16 * 24, @icon_index / 16 * 24, 24, 24)
self.bitmap.blt(0, 0, bitmap, rect)
else
self.bitmap = Cache.picture(@icon_index)
end
self.x = @px * 32 + 4
self.y = @py * 32 + 4
end
end
# Game_character new variable
class Game_CharacterBase
attr_accessor :ch_oy
end
# Sprite character
class Sprite_Character < Sprite_Base
alias falcaoadd_oxy_set_character_bitmap set_character_bitmap
def set_character_bitmap
falcaoadd_oxy_set_character_bitmap
@character.ch_oy = self.oy
end
end
class Game_System
attr_accessor :current_cursor
def cursorr
return Map_Buttons::CursorIcon if @current_cursor.nil?
return @current_cursor
end
end
# Mouse module
module Mouse
GetKeyState = Win32API.new('user32', 'GetAsyncKeyState', 'i', 'i')
GetCursorPos = Win32API.new('user32', 'GetCursorPos', 'p', 'i')
GetClientRect = Win32API.new('user32', 'GetClientRect', %w(l p), 'i')
ShowCursor = Win32API.new('user32', 'ShowCursor', 'i', 'l')
ScreenToClient = Win32API.new('user32', 'ScreenToClient', %w(l p), 'i')
Findwindow = Win32API.new('user32', 'FindWindowA', %w(p p), 'l')
GetPrivatePro = Win32API.new('kernel32', 'GetPrivateProfileStringA',
%w(p p p p l p), 'l')
ShowCursor.call(0)
@triggers = [[0, 1], [0, 2], [0, 4]]
@old_pos = 0
# Mouse Sprite
def self.set_cursor(sym, operand, write=false)
case sym
when :iconset
$mouse_cursor.bitmap = Bitmap.new(24, 24)
bitmap = Cache.system("Iconset")
rect = Rect.new(operand % 16 * 24, operand / 16 * 24, 24, 24)
$mouse_cursor.bitmap.blt(0, 0, bitmap, rect)
when :picture then $mouse_cursor.bitmap = Cache.picture(operand)
end
$game_system.current_cursor = operand if write
end
$mouse_cursor = Sprite.new
icon = Map_Buttons::CursorIcon
if Map_Buttons::check_value(icon) == 'numeric'
set_cursor(:iconset, icon)
else
set_cursor(:picture, icon)
end
$mouse_cursor.z = 10001
$mouse_cursor.x = $mouse_cursor.y = 1000
$mouse_cursor.ox = 4
def self.show_cursor(value)
unless value
@pos[0] = @pos[1] = 600
end
$mouse_cursor.visible = value
end
def self.map_grid
return nil if @pos == nil
x = ($game_map.display_x).to_i + (@pos[0] / 32)
y = ($game_map.display_y).to_i + (@pos[1] / 32)
return [x, y]
end
def self.standing?
return false if @old_px != @pos[0]
return false if @old_py != @pos[1]
return true
end
def self.input_keys
$game_arrows.mode_on ? type = $game_arrows.in_type : type = Input::C
keys = {0 => type, 1 => Input::B, 2 => Input::A}
return keys
end
def self.object_area?(x, y, width, height)
return false if @pos.nil?
return @pos[0].between?(x, width + x) && @pos[1].between?(y, height + y)
end
def self.position
return @pos == nil ? [0, 0] : @pos
end
def self.global_pos
pos = [0, 0].pack('ll')
return GetCursorPos.call(pos) == 0 ? nil : pos.unpack('ll')
end
def self.screen_to_client(x=0, y=0)
pos = [x, y].pack('ll')
return ScreenToClient.call(self.hwnd, pos) == 0 ? nil : pos.unpack('ll')
end
def self.pos
global_pos = [0, 0].pack('ll')
gx, gy = GetCursorPos.call(global_pos) == 0 ? nil : global_pos.unpack('ll')
local_pos = [gx, gy].pack('ll')
x, y = ScreenToClient.call(self.hwnd,
local_pos) == 0 ? nil : local_pos.unpack('ll')
begin
if (x >= 0 && y >= 0 && x <= Graphics.width && y <= Graphics.height)
@old_px, @old_py = x, y
return x, y
else
return -20, -20
end
rescue
return 0, 0
end
end
def self.update
old_pos = @pos
@pos = self.pos
self.input_keys
if !$mouse_cursor.visible && old_pos != @pos
$mouse_cursor.visible = true
end
if old_pos != [-20, -20] && @pos == [-20, -20]
ShowCursor.call(1)
elsif old_pos == [-20, -20] && @pos != [-20, -20]
ShowCursor.call(0)
end
for i in @triggers
n = GetKeyState.call(i[1])
if [0, 1].include?(n)
i[0] = (i[0] > 0 ? i[0] * -1 : 0)
else
i[0] = (i[0] > 0 ? i[0] + 1 : 1)
end
end
end
# trigger definition
def self.trigger?(id = 0)
pos = self.pos
if pos != [-20,-20]
case id
when 0
return @triggers[id][0] == 1
when 1
if @triggers[1][0] == 1 && !$game_system.menu_disabled
return @triggers[id][0] == 1
end
when 2
return @triggers[id][0] == 1
end
end
end
# repeat definition
def self.repeat?(id = 0)
if @triggers[id][0] <= 0
return false
else
return @triggers[id][0] % 5 == 1 && @triggers[id][0] % 5 != 2
end
end
#press definition
def self.press?(id = 0)
if @triggers[id][0] <= 0
return false
else
return true
end
end
def self.screen_to_client(x=0, y=0)
pos = [x, y].pack('ll')
return ScreenToClient.call(self.hwnd, pos) == 0 ? nil : pos.unpack('ll')
end
def self.hwnd
if @hwnd.nil?
game_name = "\0" * 256
GetPrivatePro.call('Game', 'Title', '', game_name, 255, ".\\Game.ini")
game_name.delete!("\0")
@hwnd = Findwindow.call('RGSS Player', game_name)
end
return @hwnd
end
def self.client_size
rect = [0, 0, 0, 0].pack('l4')
GetClientRect.call(self.hwnd, rect)
right, bottom = rect.unpack('l4')[2..3]
return right, bottom
end
end
# Input module aliased
class << Input
unless self.method_defined?(:falcao21_mouse_update)
alias_method :falcao21_mouse_update, :update
alias_method :falcao21_mouse_trigger?, :trigger?
alias_method :falcao21_mouse_repeat?, :repeat?
alias_method :fal_mouse_input_press?, :press?
end
def update
if $mouse_cursor.visible
Mouse.update
$game_arrows.update
mx, my = *Mouse.position
$mouse_cursor.x = mx unless mx.nil?
$mouse_cursor.y = my unless my.nil?
end
falcao21_mouse_update
end
# trigger
def trigger?(constant)
return true if falcao21_mouse_trigger?(constant)
unless Mouse.pos.nil?
if Mouse.input_keys.has_value?(constant)
mouse_trigger = Mouse.input_keys.index(constant)
return true if Mouse.trigger?(mouse_trigger)
end
end
return false
end
# press
def press?(constant)
return true if fal_mouse_input_press?(constant)
unless Mouse.pos.nil?
if Mouse.input_keys.has_value?(constant)
mouse_trigger = Mouse.input_keys.index(constant)
return true if Mouse.press?(mouse_trigger)
end
end
return false
end
# repeat
def repeat?(constant)
return true if falcao21_mouse_repeat?(constant)
unless Mouse.pos.nil?
if Mouse.input_keys.has_value?(constant)
mouse_trigger = Mouse.input_keys.index(constant)
return true if Mouse.repeat?(mouse_trigger)
end
end
return false
end
end
# Here your best friend, you can call this script within the game, scene etc.
# $game_arrows.create_arrows(x, y), create it, $game_arrows.dispose, delete it
class Game_Arrow_Selector
attr_accessor :mode_on
attr_accessor :in_type
def initialize
@mode_on = false
end
def create_arrows(x, y)
return unless @arrows_sprites.nil?
buttons = {1=> 'UP', 2=> 'RIGHT', 3=> 'DOWN',
4=> 'LEFT', 5=> 'OK', 6=> 'Cancel'}
@arrows_sprites = []
for i in buttons.values
@arrows_sprites.push(Garrows_Sprites.new(i, x, y))
end
end
def dispose
return if @arrows_sprites.nil?
for arrow in @arrows_sprites
arrow.dispose
end
@arrows_sprites = nil
@mode_on = false
end
def update
return if @arrows_sprites.nil?
for arrow in @arrows_sprites
arrow.update
end
end
end
class Garrows_Sprites < Sprite
def initialize(name, x, y)
super()
self.z = 1000
@px, @py = x, y
@name = name
@object_zooming = 0
@zooming = false
set_bitmap
update
end
def update
super
if Mouse.object_area?(self.x + @fix[0], self.y + @fix[1],
self.bitmap.width + @fix[2], self.bitmap.height + @fix[3])
$game_arrows.mode_on = true
$game_arrows.in_type = Input::UP if @name == 'UP'
$game_arrows.in_type = Input::DOWN if @name == 'DOWN'
$game_arrows.in_type = Input::LEFT if @name == 'LEFT'
$game_arrows.in_type = Input::RIGHT if @name == 'RIGHT'
$game_arrows.in_type = Input::C if @name == 'OK'
$game_arrows.in_type = Input::B if @name == 'Cancel'
@object_zooming += 1
@zooming = true
case @object_zooming
when 1..10 ; self.zoom_x -= 0.01 ; self.zoom_y -= 0.01
when 11..20 ; self.zoom_x += 0.01 ; self.zoom_y += 0.01
when 21..30 ; self.zoom_x = 1.0 ; self.zoom_y = 1.0
@object_zooming = 0
end
elsif @object_zooming > 0
self.zoom_x = 1.0
self.zoom_y = 1.0
@object_zooming = 0
elsif @zooming
@zooming = false
$game_arrows.mode_on = false
end
end
def set_bitmap
self.bitmap = Bitmap.new(24, 15) if @name != 'Cancel'
case @name
when 'UP'
self.x = @px + 25 ; self.y = @py - 2
self.angle = 182 ; @fix = [-23, -18, 0, 0]
when 'DOWN'
self.x = @px + 1 ; self.y = @py + 26
@fix = [0, -4, 0, 0]
when 'LEFT'
self.x = @px ; self.y = @py + 1
self.angle = - 92 ; @fix = [-14, -4, - 9, 9]
when 'RIGHT'
self.x = @px + 26 ; self.y = @py + 26
self.angle = + 92 ; @fix = [0, - 26, - 9, 9]
when 'OK'
self.x = @px + 1 ; self.y = @py + 6
@fix = [0, -4, 0, 0]
self.bitmap.font.size = 20
self.bitmap.draw_text(4, -7, self.bitmap.width, 32, @name)
return
when 'Cancel'
self.x = @px - 11 ; self.y = @py + 42
@fix = [0, -4, 0, 0]
self.bitmap = Bitmap.new(50, 15)
self.bitmap.font.size = 20
self.bitmap.draw_text(2, -7, self.bitmap.width, 32, @name)
return
end
draw_crappy_triangle(0, 0)
end
# This method create a crappy triangle pointing down
def draw_crappy_triangle(px, py)
color = Color.new(192, 224, 255, 255)
x, y, w, = 0, 4, 24
self.bitmap.fill_rect(px + 1, py, 22, 1, color)
self.bitmap.fill_rect(px, py + 1, 24, 4, color)
for i in 1..10
x += 1; y += 1; w -= 2
self.bitmap.fill_rect(px + x, py + y, w, 1, color)
end
end
end
$game_arrows = Game_Arrow_Selector.new
# Arrow selector is displayed when Input number is on
class Game_Interpreter
alias falcao_setup_num_input setup_num_input
def setup_num_input(params)
falcao_setup_num_input(params)
$game_arrows.create_arrows(256, 194) if $game_message.position == 0
$game_arrows.create_arrows(256, 340) if $game_message.position == 1
$game_arrows.create_arrows(256, 180) if $game_message.position == 2
end
end
# Arrow selector is disposed when press ok
class Window_NumberInput < Window_Base
alias falcao_process_ok process_ok
def process_ok
falcao_process_ok
$game_arrows.dispose
end
end
# WASD Movements
module Input
class << self
if !method_defined?('vxe_dir4')
alias vxace_dir4 dir4
end
def dir4
if Map_Buttons::WASD_Movement
return 2 if (Input.press?(Input::Y))
return 4 if (Input.press?(Input::X))
return 6 if (Input.press?(Input::Z))
return 8 if (Input.press?(Input::R))
end
return vxace_dir4
end
end
end
# If event start with mouse
class Game_Player < Game_Character
alias falcao_start_map_event start_map_event
def start_map_event(x, y, triggers, normal)
$game_map.events_xy(x, y).each do |event_click|
return if event_click.check_comment("MOUSE START")
end
falcao_start_map_event(x, y, triggers, normal)
end
end
# clear pointers when tranfering
class Game_Player < Game_Character
attr_accessor :clear_mousepointers
alias falcaomouse_perform_transfer perform_transfer
def perform_transfer
@clear_mousepointers = true if $game_map.map_id != @new_map_id
falcaomouse_perform_transfer
end
end
# Path find
class Game_Character < Game_CharacterBase
attr_accessor :map, :runpath
alias pathfind1_ini initialize
def initialize
pathfind1_ini
@map = nil
@runpath = false
end
alias pathfind1_up update
def update
run_path if @runpath == true
pathfind1_up
end
def run_path
return if moving?
step = @map[@x,@y]
if step == 1
@map = nil
@runpath = false
return
end
dir = rand(2)
case dir
when 0
move_straight(6) if @map[@x+1,@y] == step - 1 && step != 0
move_straight(2) if @map[@x,@y+1] == step - 1 && step != 0
move_straight(4) if @map[@x-1,@y] == step - 1 && step != 0
move_straight(8) if @map[@x,@y-1] == step - 1 && step != 0
when 1
move_straight(8) if @map[@x,@y-1] == step - 1 && step != 0
move_straight(4) if @map[@x-1,@y] == step - 1 && step != 0
move_straight(2) if @map[@x,@y+1] == step - 1 && step != 0
move_straight(6) if @map[@x+1,@y] == step - 1 && step != 0
end
end
def find_path(x,y)
sx, sy = @x, @y
result = setup_map(sx,sy,x,y)
@runpath = result[0]
@map = result[1]
@map[sx,sy] = result[2] if result[2] != nil
end
def clear_path
@map = nil
@runpath = false
end
def setup_map(sx,sy,ex,ey)
map = Table.new($game_map.width, $game_map.height)
map[ex,ey] = 1
old_positions = []
new_positions = []
old_positions.push([ex, ey])
depth = 2
depth.upto(100){|step|
loop do
break if old_positions[0] == nil
x,y = old_positions.shift
return [true, map, step] if x == sx and y+1 == sy
if $game_player.passable?(x, y, 2) and map[x,y + 1] == 0
map[x,y + 1] = step
new_positions.push([x,y + 1])
end
return [true, map, step] if x-1 == sx and y == sy
if $game_player.passable?(x, y, 4) and map[x - 1,y] == 0
map[x - 1,y] = step
new_positions.push([x - 1,y])
end
return [true, map, step] if x+1 == sx and y == sy
if $game_player.passable?(x, y, 6) and map[x + 1,y] == 0
map[x + 1,y] = step
new_positions.push([x + 1,y])
end
return [true, map, step] if x == sx and y-1 == sy
if $game_player.passable?(x, y, 8) and map[x,y - 1] == 0
map[x,y - 1] = step
new_positions.push([x,y - 1])
end
end
old_positions = new_positions
new_positions = []
}
return [false, nil, nil]
end
end
class Game_Player
alias pathfind_player_update update
def update
clear_path if Input.dir4 != 0
pathfind_player_update
end
alias findpath_perform_transfer perform_transfer
def perform_transfer
clear_path if $game_map.map_id != @new_map_id
findpath_perform_transfer
end
end
# Window selectable (Thanks wora for some lines here)
class Window_Selectable < Window_Base
alias mouse_selection_ini initialize
def initialize(*args)
mouse_selection_ini(*args)
@scroll_wait = 0
@cursor_wait = 0
@sdelay = 0
end
alias mouse_selection_update update
def update
update_mouse_selection if self.active and self.visible
@sdelay -= 1 if @sdelay > 0
mouse_selection_update
end
def update_mouse_selection
@cursor_wait -= 1 if @cursor_wait > 0
plus_x = self.x + 16 - self.ox
plus_y = self.y + 8 - self.oy
unless self.viewport.nil?
plus_x += self.viewport.rect.x - self.viewport.ox
plus_y += self.viewport.rect.y - self.viewport.oy
end
(0..self.item_max - 1).each do |i|
irect = item_rect(i)
move_cursor(i) if Mouse.object_area?(
irect.x + plus_x, irect.y + plus_y, irect.width, irect.height)
update_cursor
end
end
def move_cursor(index)
return if @index == index
@scroll_wait -= 1 if @scroll_wait > 0
row1 = @index / self.col_max
row2 = index / self.col_max
bottom = self.top_row + (self.page_row_max - 1)
if index != @index and @sdelay == 0
Sound.play_cursor
@sdelay = 5
end
if row1 == self.top_row and row2 < self.top_row
return if @scroll_wait > 0
@index = [@index - self.col_max, 0].max
@scroll_wait = 30
elsif row1 == bottom and row2 > bottom
return if @scroll_wait > 0
@index = [@index + self.col_max, self.item_max - 1].min
@scroll_wait = 30
else
@index = index
end
select(@index)
return if @cursor_wait > 0
@cursor_wait += 2
end
end
class Window_NameInput
def item_max
return 90
end
end
class Scene_File < Scene_MenuBase
alias mouse_top_index top_index=
def top_index=(index)
@scroll_timer = 0 if @scroll_timer.nil? ; @scroll_timer -= 1
return if @scroll_timer > 0
mouse_top_index(index) ; @scroll_timer = 35
end
alias mouse_sb_update update
def update
(0..self.item_max - 1).each do |i|
ix = @savefile_windows.x
iy = @savefile_windows.y + 40 - @savefile_viewport.oy
iw = @savefile_windows.width
ih = @savefile_windows.height
if Mouse.object_area?(ix, iy, iw, ih)
@savefile_windows[@index].selected = false
@savefile_windows.selected = true
@index = i
end
ensure_cursor_visible
end
mouse_sb_update
end
endma mi dà questo errore
http://i.imgur.com/k6UTe7j.png
ho già provato a togliere uno per uno li script ma niente :/
-
ragazzi tranquilli ho risolto, grazie comunque a tutti :)
-
Che script stai usando per l'intro?
E' possibile cambiare la mappa dell'intro?
Ma anche se fosse, basta creare una seconda mappa (#002) e piazzarci lì il pg, tutta nera e dal database setti la trasparenza iniziale del pg su on.
Sempre dalla mappa #002 crei un'evento con inizio automatico e metti dissolvi schermo e teletrasporto alla mappa #001 (L'intro)
anche lì un evento con inizio automatico: metti la tinta, mostra schermo e cancella evento.
Se l'intro funziona ad eventi aggiusta con le switch, prima del cancella evento ne attivi una che ti attiva l'intro.
questo è lo script per togliere il menù a titoli e passare subito alla mappa iniziale (fornito da Guardian)
http://www.rpgmakervxace.net/topic/271-skip-title-screen/
il resto... va beh è come sto facendo io cioè un menù completamente personalizzato in una mappa del gioco
comunque grazie mille ha funzionato :)
-
E tu crea allora una mappa prima tutta nera, usa quel codice e poi vai alla prima mappa.
^ ^
però nella prima mappa c'è l'intro e non posso spostare l'eroe altrimenti l'annullerei
-
http://i.imgur.com/kxuvYY4.png
Un bel respiro...passo-passo:
-Sistema così l'evento che ti teletrasporta nella mappa (NON nella mappa stessa):
--Dissolvi schermo
--Trasporta giocatore
--Cambia colore dello schermo
--Mostra schermo
Gli eventi che portano dalle mappe ricolorate a quelle "naturali", sistemali allo stesso modo.
ma non c'è nessuna nessuna mappa prima, questo è la intro iniziale nella prima mappa
-
@Un: esatto, però il fade in mettilo prima di teletrasportarti nella mappa, così non dovresti avere problemi.
^ ^
http://i.imgur.com/3aJ4MDw.png?
-
Appunto ti ho detto in quel caso di usare il metodo di Return, quello con i dissolvi schermo, messaggio 4287:
^ ^
http://i.imgur.com/IL4JVHB.png?

Sportello aiuti veloci VX-Ace
in Supporto VX e VX-Ace
Posted