Working on GUIs, and Need HELP! - JayRay - 12-27-2014
First, let me just say that DERVVULFMAN was very helpful to me before. Trying to create a WOW/MMORPG styled message window (images, compatible with Mousie) and each time I put this in, and start it up after firign up an event to load it up, I get a NoMethodError for the messagegui_update with []=
Here's the script thus far.
Code: #===============================================================================
# Message GUI Window Screen
#-------------------------------------------------------------------------------
# By JayRay 4/22/2014
#
# To begin, this will be a windowed 'Message' hud that I want to use with Mousie
# that comes up after certain variables are created, and a switch is turned on
#
# The screen will have variables change depending on events used on the screen
# for this map, while Game Switch 10, New Hero Game Switch is in operation.
#
# Game Variables 38-53 hold message data
# Game Variables 66-67 hold the window's initial x/y position
# Game Switch 25 sets its visiblity on/off
#
#
#==============================================================================
#==============================================================================
# ** Window_MessageGui
#------------------------------------------------------------------------------
# This window displays New Nero Data
#==============================================================================
class Window_MessageGui < Window_Base
#---------------------------------------------------------------------------
# * Object Initialization
#---------------------------------------------------------------------------
def initialize
super(0, 0, 640, 480)
self.contents = Bitmap.new(width - 32, height - 32)
self.back_opacity = 0
self.opacity = 0
self.z = 500000
refresh
end
#---------------------------------------------------------------------------
# * Refresh
#---------------------------------------------------------------------------
def refresh
self.contents.clear
# Acquire character info from variable data
rog_talkerface = $game_variables[38]
rog_talkertitle = $game_variables[39]
rog_messagetitle = $game_variables[40]
rog_messtext1 = $game_variables[41]
rog_messtext2 = $game_variables[42]
rog_messtext3 = $game_variables[43]
rog_messtext4 = $game_variables[44]
rog_messtext5 = $game_variables[45]
rog_messtext6 = $game_variables[46]
rog_messtext7 = $game_variables[47]
rog_reward1 = $game_variables[48]
rog_reward2 = $game_variables[49]
rog_reward3 = $game_variables[50]
rog_reward4 = $game_variables[51]
rog_goldreward = $game_variables[52]
rog_expreward = $game_variables[53]
# Acquire background from variable data
# Render character info
bitmap = RPG::Cache.picture("messagegui")
self.contents.blt(0 , 0, bitmap, Rect.new(0,0,250,480))
self.contents.draw_text( 0, 10, 200, 32, rog_talkerface.to_s)
self.contents.draw_text( 0, 40, 200, 32, rog_talkertitle.to_s)
self.contents.draw_text( 0, 70, 200, 32, rog_messagetitle.to_s)
self.contents.draw_text( 0, 100, 200, 32, rog_messtext1.to_s)
self.contents.draw_text( 0, 130, 200, 32, rog_messtext2.to_s)
self.contents.draw_text( 0, 160, 200, 32, rog_messtext3.to_s)
self.contents.draw_text( 0, 190, 200, 32, rog_messtext4.to_s)
self.contents.draw_text( 0, 220, 200, 32, rog_messtext5.to_s)
self.contents.draw_text( 0, 250, 200, 32, rog_messtext6.to_s)
self.contents.draw_text( 0, 280, 200, 32, rog_messtext7.to_s)
self.contents.draw_text( 0, 310, 200, 32, rog_reward1.to_s)
self.contents.draw_text( 0, 340, 200, 32, rog_reward2.to_s)
self.contents.draw_text( 0, 370, 200, 32, rog_reward3.to_s)
self.contents.draw_text( 0, 400, 200, 32, rog_reward4.to_s)
self.contents.draw_text( 0, 430, 200, 32, rog_goldreward.to_s)
self.contents.draw_text( 0, 460, 200, 32, rog_expreward.to_s)
# Render character background text
end
#---------------------------------------------------------------------------
# * Frame Update
#---------------------------------------------------------------------------
def update
super
refresh if self.visible == true
end
end
#==============================================================================
# ** Scene_Map
#------------------------------------------------------------------------------
# This class performs map screen processing.
#==============================================================================
class Scene_Map
#---------------------------------------------------------------------------
# * Alias Listings
#---------------------------------------------------------------------------
alias messagegui_main main
alias messagegui_update update
#---------------------------------------------------------------------------
# * Main processing
#---------------------------------------------------------------------------
def main
# Draw and position the window
@messageguiwindow = Window_MessageGui.new
@messageguiwindow.x = $game_variables[66]
@messageguiwindow.y = $game_variables[67]
@messageguiwindow.visible = false
# Perform the original call
messagegui_main
# Dispose of window
@messageguiwindow.dispose
end
#---------------------------------------------------------------------------
# * Frame Update
#---------------------------------------------------------------------------
def update
# Branch system visiblity based on variable
if $game_switches[25] == true
@messageguiwindow.x = 0
@messageguiwindow.y = 0
@messageguiwindow.visible = true
@messageguiwindow.update
else
@messageguiwindow.visible = false
@messageguiwindow.update
end
# Perform the original call
messagegui_update
end
end
RE: Working on GUIs, and Need HELP! - Zexion - 12-27-2014
Uh, I just plugged it in and turned on switch 25 and it works for me :s
http://puu.sh/dLLqD/9ab43c640a.png
If you're setting anything to nil and not handling every case of it in the script, that's the problem.
RE: Working on GUIs, and Need HELP! - JayRay - 01-02-2015
yep,dealt with... got it figured out, and have some stunning GUIs going so far...
|