Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - bigace

1
Thanks, I'll test that in a bit, I was thinking of something similar before in the Window_Message, but I kept getting an error which why I post here right after.

Edit:

But what you did work, so time to move onto the next thing.
2
I fixed the script up above, my math was wrong apparently :<_<:. The script should be plug and play.

Anyways, I know that the message disappears after you click it that is not the issue, I apologize if that was not clear. If you click enter instead of going to the next command it will first remove the message window and then you will have to click enter again to click the command.

Hope the screenshot below makes more sense:
3
The help window and the message window are to different windows, so not really. As you see in the screenshot gif the words appear on screen character by character like the message system does. The help window does not do that. I've been trying to sync the command windows to the message_window, but I kept running into issues.
4
So I need a little help on this as I'm kind of stuck. So far I have this:

module MenuManager

MENU_DESCRIPTIONS ={ main_message: 'What will you do?', } 

def self.method_wait_for_message=(method)
@method_wait_for_message = method
end
def self.wait_for_message
@method_wait_for_message.call if @method_wait_for_message
end
def self.menu_open
$game_message.add(MENU_DESCRIPTIONS[:main_message])
wait_for_message
end
end
#■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
#==============================================================================
# ** Window_MenuStatus
#------------------------------------------------------------------------------
#  This window displays party member status on the menu screen.
#==============================================================================

class Window_MenuStatus < Window_Selectable
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_reader   :pending_index            # Pending position (for formation)
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize(x, y)
    super(x, y, window_width, window_height)
    @pending_index = -1
    refresh
  end
  def window_width
    Graphics.width
  end
  def window_height
    fitting_height(6)
  end
  def item_max
    $game_party.members.size
  end
def item_height
(height - standard_padding * 2) / 6
end
def draw_item(index, *args)
actor_id = index
return unless actor_id
actor = $game_party.members[actor_id]
rect = item_rect(index)
draw_actor_simple_status(actor, rect.x, rect.y)
end
def draw_actor_simple_status(actor, x, y)
draw_actor_name(actor, x+25, y)
draw_actor_icons(actor, x+120, y + 1, 122)
draw_actor_hp(actor, x + 260, y - 3)
draw_actor_mp(actor, x + 390, y - 3)
end
end

#■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
class Window_MenuMessage < Window_Message
def window_height
fitting_height(9)
end
def update_placement
self.y = fitting_height(7) + 4
self.opacity = 0
end
end
#■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
class Scene_Menu
def start
super
create_all_windows
init_windows
MenuManager.method_wait_for_message = method(:wait_for_message)
end
def post_start
super
MenuManager.menu_open
end
def update_for_wait
update_basic
end
def wait_for_message
@message_window.update
update_for_wait while $game_message.visible
end
def create_all_windows
create_status_window
create_message_window
create_info_window
create_command_window
end
def init_windows
end
def create_status_window
@status_window = Window_MenuStatus.new(0, 0)
end
def create_message_window
@message_window = Window_MenuMessage.new
@message_back = Window_Base.new(0, @status_window.height+24, Graphics.width, 56)
end
def create_info_window
@info_viewport = Viewport.new
@info_viewport.rect.y = Graphics.height - @status_window.height
@info_viewport.rect.height = @status_window.height
@info_viewport.z = 100
@info_viewport.ox = 64
@status_window.viewport = @info_viewport
end
#--------------------------------------------------------------------------
def create_command_window
@command_window = Window_MenuCommand.new
@command_window.set_handler(:cancel,    method(:return_scene))
end
end


My problem is that if I click enter to select a command, it will first remove the message window. Then if you click again then the command window will select the command. This is obviously what it is pre-programmed to do. I need it so that it does this:



As you can see from the gif above, both the message window and command window are both sync instead of how it is in the script above.

So if that made sense, just need help on how to proceed with recreating that menu system.
5
Thanks that does makes sense, I forgot that Graphics doesn't have the forwards slash in front of it.
6
Engine: RGSS3

So i was trying to count the amount of files in the movie folder:

module ACE_Manger
def self.folder_size(dir)
Dir.glob(File.join(dir, '**', '*')).select { |file| File.file?(file) }.count
end
end

class Scene_Title
alias :ace_start :start
def start
ace_start
puts ACE_Manger.folder_size("/Movies")
end
end


but when I start the game up it says I have 0 files in the folder when there is actually 4. However if I change the directory name to this:

class Scene_Title
alias :ace_start :start
def start
ace_start
puts ACE_Manger.folder_size("D:/Dropbox/Last Bible I - Revelations The Demon Slayer/Game Mechanics/Title Scene/Movies")
end
end


Then the game will print that there is 4 files within the folder. Can anyone figure out why this happens.
7
Just to let you know, the demo link is broken
8
Cool thanks drago, it works. Now all I have to finish is when the player hits no instead of yes it erases the highlights and numbers. That shouldn't be too hard now, so thank you for your's and KK20's help.
9
Just a heads up I changed the parent class of Scene_Menu so it's not going to be easily imported without the whole thing and:

Quotejust glanced on your script, you should draw the number in the different sprite so you can delete & redraw it freely without affecting the others


I don't get it?
10
So this is what I have so far:
Spoiler: ShowHide

class Game_Party < Game_Unit
  def set_party_order_to_array(array)
    @battle_party = Array.new(array)
    refresh_actors
  end
  def refresh_actors
    $game_player.refresh
    $game_map.need_refresh = true
  end
end
#■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
class Window_MenuStatus < Window_Selectable
  def initialize(x, y)
    super(x, y, window_width, window_height)
    @pending_index = []
    refresh
  end
  def draw_item(index, *args)
    actor_id = $game_party.battle_party[index]
    return unless actor_id
    actor = $game_actors[actor_id]
    rect = item_rect(index)
    draw_item_counter(rect, index)
    draw_actor_simple_status(actor, rect.x, rect.y + 1.5 / 2)
  end
  def draw_item_counter(rect, index)
    if index == @pending_index[0]
        contents.font.bold = true
        contents.fill_rect(item_rect(index), pending_color)
        draw_text(rect.x+6, rect.y, rect.width, rect.height, @pending_index[1])
        contents.font.bold = false
    end
  end
  def pending_index=(index)
    @pending_index = index
    redraw_item(@pending_index[0])
  end
end
#■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
class Scene_Menu < Scene_ItemBase
def start
super
    @actor_array = []
  end
def command_formation
@status_window.select_last
@status_window.activate
@status_window.set_handler(:ok,     method(:on_formation_ok))
@status_window.set_handler(:cancel, method(:on_formation_cancel))
refresh_help_window
end
def on_formation_ok
if @actor_array.size < @status_window.item_max
unless @actor_array.include?(user.id)
@actor_array << user.id
@status_window.pending_index = [@status_window.index, @actor_array.size]
end
if @actor_array.size == @status_window.item_max-1
(@status_window.item_max+1).times do |i|
unless @actor_array.include?(i) || i <= 0
@actor_array << i
@status_window.pending_index = [i-1, @actor_array.size]
end
break if @actor_array.size == @status_window.item_max
end
if @actor_array.size == @status_window.item_max
@window_question.set_handler(:yes,    method(:on_order_ok))
@window_question.set_handler(:no,     method(:on_order_cancel))
@window_question.set_handler(:cancel, method(:on_order_cancel))
@window_question.question = 'Is this ok?'
@window_question.activate.show.select(1)
end
else
@status_window.activate
end
end
end
def on_order_ok
$game_party.set_party_order_to_array(@actor_array)
on_order_cancel
party_refresh
end
def on_order_cancel
@status_window.pending_index.clear
@actor_array.clear
@window_question.deactivate.hide
@status_window.unselect
@sort_window.activate
end
def on_formation_cancel
if @actor_array.size > 0
@actor_array.pop
@status_window.redraw_item(@status_window.index)
if @actor_array.size == 0
@status_window.unselect
@sort_window.activate
else
        @status_window.activate
end
else
@status_window.unselect
@sort_window.activate
end
refresh_help_window
end
def party_refresh
@monster_list.refresh
@windows.each {|x| x.refresh unless x.visible == false}
$game_party.refresh_actors
end
end




So far I am able to get the numbers to appear after every time I click on an actor and then disappear after the new party order has been created but I still don't really have any ideal how to go backwards (Pressing :B) and removing the previous selected actor. I can remove it from the array as you can in the code above but not the highlight or number.
11
I believe I figured it out and I post my findings when its done, but I'm pretty sure it involves editing the pending_index=(index) and draw_item_background(index) methods in class Window_MenuStatus.
12
Hopefully the title makes sense, so anyways so far I've created the re order part in the gif below:
Spoiler: ShowHide


But in this next gif you will notice that I'm missing one key component (not including the yes/no question at the end), which is the numbers that will appear next to the actors names after the player clicks on them.

This is a gif of the OG version menu in the game Revelations Demon Slayer to show what I am talking about:
Spoiler: ShowHide


So in that second gif you should hopefully see what I was talking about on the left side of the status window. The problem is that I have no clue how to write that at the moment and was hoping someone had an ideal on how to go about this.

If you need anything else don't hesitate to ask!
13
Ya it does work, but for some reason it wasn't typed into that sentence I wrote in the last post so it looks like the code doesn't work. Well actually the code I posted before yours worked as well even if you didn't like the format. Also Input.update isn't being called twice according to VXACE.
14
Actually the button doesn't cycle through when held because in this class:
class Window_TradeStatus < Window_Selectable
def process_handling
return unless open? && active
return process_change if Input.trigger?(:LEFT) || Input.trigger?(:RIGHT)
super
end
def process_change
Input.update
call_handler(:change)
end
end

It is already telling the code to cycle through each window with each click.

However the method we both just posted:

def on_status_change
 last_index = @index
 if Input.press?(:RIGHT)
   @index = @index == (@item_max - 1) ? 0 : (@index + 1)
 elsif Input.press?(:LEFT)
   @index = @index == 0 ? (@item_max - 1) : (@index - 1)
 end
 if @index != last_index
   @status_windows[last_index].deactivate.unselect
   @status_windows[@index].activate.select(0)
 end
end




Also if I do:

def on_status_change
 last_index = @index
 if Input.trigger?(:RIGHT)
   @index = @index == (@item_max - 1) ? 0 : (@index + 1)
 elsif Input.trigger?(:LEFT)
   @index = @index == 0 ? (@item_max - 1) : (@index - 1)
 end
 if @index != last_index
   @status_windows[last_index].deactivate.unselect
   @status_windows[@index].activate.select(0)
 end
end


It doesn't switch windows at all and turning
elsif Input.trigger?(:LEFT)
into just
else
the code will just cycle RIGHT, but not Left.
15
Thanks, I tried something like that earlier but I accidentally used Input.trigger? instead of Input.press?. so it didn't work.

	def on_status_change
last_index = @index
@index = (if Input.press?(:RIGHT) then @index == (@item_max - 1) ? 0 : (@index + 1)
else @index = @index == 0 ? (@item_max - 1) : (@index - 1)
end)
if @index != last_index
@status_windows[last_index].deactivate.unselect
@status_windows[@index].activate.select(0)
end
end
16

class Window_TradeStatus < Window_Selectable
def process_handling
return unless open? && active
return process_change if Input.trigger?(:LEFT) || Input.trigger?(:RIGHT)
super
end
def process_change
Input.update
call_handler(:change)
end
end

class Scene_ActorTrade < Scene_Base
MAIN_CHAR.each_with_index do |a, b|
eval("#{b += 1}
def create_#{a}_status_window(*args)
@status_actor#{b} = Window_TradeStatus.new(*args)
@status_actor#{b}.set_handler(:cancel, method(:return_scene))
@status_actor#{b}.set_handler(:change, method(:on_status_change))
@status_actor#{b}.help_window = @help_window
end
def create_#{a}_trade_window(dx)
dy = @status_actor1.y + @status_actor1.height
dw = @status_actor1.width
dh = Graphics.height - dy
@trade_actor#{b} = Window_TradeItemList.new(dx, dy, dw, dh)
@trade_actor#{b}.help_window = @help_window
@status_actor#{b}.item_window = @trade_actor#{b}
end")
end
end
17
I've been having an issue all day trying to figure out why I can't get my cursor to go left or right. So far it picks one direction and regardless of which button you click it will still go in that direction.

This is suppose to change it so the script would switch between windows depending on which button (:left or :right) you click. However all it does is jump to window #1 and then shift between window #1 and #2 without even going back to window #0

def on_status_change
last_index = @index
@index = (if @index < 3 then (@index + 1) % @item_max
elsif @index > 0 then (@index +) % @item_max
end)
if @index != last_index
@status_windows[last_index].deactivate.unselect
@status_windows[@index].activate.select(0)
end
end


This method shifts through all the windows but only in one direction regardless of which key I click (:left or :right)

def on_status_change
last_index = @index
@index = @index == (@item_max - 1) ? 0 : (@index + 1)
@index = @index == 0 ? (@item_max - 1) : (@index - 1)
if @index != last_index
@status_windows[last_index].deactivate.unselect
@status_windows[@index].activate.select(0)
end
end


If you need any additional information or clarification I'll add it.

Thanks
18
Script Troubleshooting / Re: Stack level too deep
February 07, 2015, 01:47:49 am
I found the error using Krosk - Exception Logger [VX Ace]. I screwed up with one of my methods in Game_BattlerBase.
19
Script Troubleshooting / Stack level too deep
February 06, 2015, 11:27:53 pm
Can anyone tell me what way I can figure out how to stop a SystemStackError from occurring or at least a code that can backtrace a couple of steps to figure out what is causing the problem. Because no matter what I do I seem to keep getting this error.
20
Quote from: gameus on July 27, 2014, 11:01:06 am
I understand you're trying to get your website a bit more attention, but don't force it onto people. If he wants to request support here because there are more members and it's a bit more active, then so be it.

Quote from: bigace on July 26, 2014, 05:04:36 pm
So... I guess bump once again? :???:


I just tested this in XP Ace. The code is:

website = [
 'http://forum.chaos-project.com/'
]
 Thread.new { system("start #{website[0]}") }


And here's a GIF showing it.

Large GIF: ShowHide


If you're using RPG Maker XP 1.05, it likes to overwrite the RGSS104E.dll in your project folder every time you playtest it through the editor.


Thanks for the reply, but that still doesn't work either the game just closes or it gives me an error telling me that 'system' is an undefined method. I also am using RGSS102E not 104 I don't get that issue.