RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
Advanced Text System 3.0c

0 Members and 4 Guests are viewing this topic.

**
I'm a liar.
Rep:
Level 73
I am the Epic awesome; I am the Awesom epic
Thanks for the demo recommendation. It cleared up a few things, but not the scrolling problem that I have. This could possibly be a bug of some sort. Perhaps it's occurring because of the Scripts that I am using.
In the demo, way too much text just continued to flow until it was done. Afterwards, I was free to either scroll back up or continue to the next message.
In my Play Testing, too much text is shown in the message window (as much that will fit). However, it does not continue downward (scroll) with the rest of the text I simply never get it and when I press Enter or Space Bar it just goes to the next message box. What can I do from within the script to fix this?

I'm using Reedo's Common Code, Ultimate Quest System (not set-up yet), Read!, Pause Script, HK's Animated Title Screen, Yanfly Engion Melody (the latest version from the demo), and your script.
Is it illegal to kill a man because it's a sin, or because war weren't declared?

And is this how you would treat an "idiot", dear sir, or is it just how you troll?

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
Well, it might be that you have the message system from YEM. You would have to get rid of that or else it will probably interfere.

**
Rep:
Level 74
Fallen Angel
Hey there MA, I'm getting a weird error with nameboxes, namely that they aren't long enough. Here's a screenshot:

Spoiler for:

This only happens if I use \nb[Mama]. Interestly enough, the other names I'm using (Login, Router, Yufia, Lucia, Eclair) all show up fine. I tried setting the character's name in the database and used \n[ x], but it still appears cut off like that.

Do you have any idea why this is happening?

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
Well, the text_size method in Bitmap doesn't work very well for some fonts, so that's probably the problem. I was working on a little fix type thing for that, but I don't know when that will be ready. For now, try just putting extra spaces in it and see if that works, like:

\nb[Mama   ]

**
Rep:
Level 74
Fallen Angel
*Headdesk* That was a simple workaround. It doesn't seem like anything else in my project is effected, so that should be all for now. Cheers, MA.

**
I'm a liar.
Rep:
Level 73
I am the Epic awesome; I am the Awesom epic
I don't have that one on my script list. Oh wellies, I guess. Maybe it's a bug?
The message starting from the top ends with "what happened to them" from the next downward. Afterwards, it continues on the next message.
Is it illegal to kill a man because it's a sin, or because war weren't declared?

And is this how you would treat an "idiot", dear sir, or is it just how you troll?

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
Hmm - yeah I guess its a bug. Can you send me a project with the error recreated? Just paste the ATS as you have it configured and that event into a new project and try it out. If it works, then its an incompatibility and you'll need to include your other scripts. If it doesn't work, you only need to include the ATS. In any case, compress game data (leave it unencrypted), and upload it in a post.

***
Rep:
Level 75
Sure, just grab the Window Pause Sprite Hijacked script and place it above the ATS.
Ah, I remember seeing that script some times ago but I didn't fully understand what its purpose was.
It works, tough I have a minor bug to report.

Thanks (:

**
I'm a liar.
Rep:
Level 73
I am the Epic awesome; I am the Awesom epic
I tried it with only ATS and that one event. I still had the same problem, though.
Can you give me any advice on making a bridge in the game or an example (screenshot) of one? I can't shake the feeling that the one I made is really crappy, but that's the best that I've figured out how to do.  :-[
Is it illegal to kill a man because it's a sin, or because war weren't declared?

And is this how you would treat an "idiot", dear sir, or is it just how you troll?

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
OK, you set MAX_LINES to 10 - that is your problem.

In the Config, around line 766, you have:

Code: [Select]
  MAX_LINES = 10                 # See line 376.

But your window size and font size means you can really only fit 4 lines. So change it to:

Code: [Select]
  MAX_LINES = 4                 # See line 376.

If you want to make the window bigger or the font size smaller, then you can make the max lines greater too.


As for the bridge - I'm not a mapper. As far as bridges go, the VX RTP is pretty limited. I probably wouldn't make it that long though. You can always grab resources to help make better bridges though, like this.

If you want better feedback, you can always post in the Screenshot Thread
« Last Edit: January 03, 2011, 04:08:01 AM by modern algebra »

**
I'm a liar.
Rep:
Level 73
I am the Epic awesome; I am the Awesom epic
Thank you for the help.
Is it illegal to kill a man because it's a sin, or because war weren't declared?

And is this how you would treat an "idiot", dear sir, or is it just how you troll?

****
Rep:
Level 84
3...2...1...
Only a tiny problem. Shouldn't be hard to fix.

I have the boxes fit to the text lenght, and I also have this script:
Code: [Select]
#==============================================================================
# Chest Item Pop-Up
#==============================================================================
# Author    : OriginalWij
# Edited By : Mac Malone (Dr. ?)
# Version   : 3.0 - Dr. ? Edit v1.2
#==============================================================================

#==============================================================================
# v1.0
# - Initial release
# v1.1
# - Added description window
# v1.2
# - Bug fix and added forgotten aliases
# v1.3
# - Added option to only popup once for many of the same item
# v2.0
# - Reworked name popup window (won't show "1 x" if only one item)
# - Reworked gold display (more efficient)
# - Added option to turn popup sound on/off
# - Added option to turn popup text on/off
# - Added icon to name popup and the ability to turn it on/off
# - Added adjustable X & Y coordinates for name popup window
# - Added "call" feature - with and without adding the item to inventory
# - Added option to wait for button or time for popup name window
# - Added options to define button and time for popup name window wait
# - Added option to enable/disable the "close window" sound
# - Added options to define "close window" sound
# v2.1
# - Fixed moving event bug
# - Added option to have popup always active
# - Added option for overlay graphic
# - Added auto-adjust name window location, depending on actor X/Y
# v2.2
# - Several minor (non-bug) display fixes
# - Removed overlay option due to compatibility problems
# - Optimized script
# v3.0
# - Bugfix for when called from a common event
# - Reworked main popup scene for new X/Y determination
# - Added option for 2nd window cancellation button
# - Added option to center the text window or auto-move to not cover the player
# - Added option to popup items & gold after battle
# v3.0 - Dr. ? Edit
# - Added sound groups
# - Added ME compadibiltiy
# - Added Chest_Popup.new2 command
# - Added option to show or not show gold
# - Added option to show popup above event
# - Added Chest_Popup.new3 command
# - Added Popup_Data class (Incompadible with old save files)
# v3.0 - Dr. ? Edit v1.1
# - Bugfix for $popup.show_above_event
# v3.0 - Dr. ? Edit v1.2
# - Bugfix for save bug in lines 339-353 (now lines 341-355)
#==============================================================================

#==============================================================================
# To use:
#
#   Normal Mode    : turn on the switch (designated below) BEFORE
#                    each gold/item addition
#   Automatic Mode : turn on the switch (designated below) if you DON'T want
#                    popups and then turn the switch off when done
#
# To call manually:
#
#   (useful if using a break-limits script and popping-up 100+ of one item)
#
#   $scene = Chest_Popup.new(type, amount, index, add = false, x = pX, y = pY, sound_group = nil)
#          type : 0 :gold, 1 :items, 2 :weapons, 3 :armor
#        amount : number of items "gaining"
#         index : item ID
#           add : adds item(s) shown into inventory if true (default = false)
#             x : custom X coordinate to pop-up at (default = player X)
#             y : custom Y coordinate to pop-up at (default = player Y)
#   sound_group : play different sounds; an array containing [SI, VI, PI] look
#               : at PLAY_P_SOUND for more. (default = nil) - Dr.? Edit
#==============================================================================

#==============================================================================
# NOTE: when adding multiple (different) items in an event, insert a WAIT(1)
#       between them (insert the WAIT(1) even if in AUTOMATIC mode)
#==============================================================================
# NOTE: the switch turns itself off after each "add item/gold" event command
#       UNLESS in automatic mode (you MUST turn it off MANUALLY in auto-mode)
#==============================================================================
# NOTE: insert a WAIT(7) between a text message and adding items in events
#       (allows time for the message window to close)
#==============================================================================

  #-----------------------------------------------------------------------------
  # Popup Controls
  #-----------------------------------------------------------------------------
  # Automatic popup mode
  # (true = ALWAYS popup UNLESS $game_switches[POPUP_SWITCH] is on)
  AUTO_POPUP = true
  # Switch to activate/deactivate popups
  # (activate if AUTO_POPUP = false) (deactivate if AUTO_POPUP = true)
  POPUP_SWITCH = 1
  # Popup gold
  GOLD_POP = true
    # "Gold" icon index
    # (if GOLD_POPUP = true)
    GOLD_ICON = 205
  # Only popup once (if many of the same item)
  ONLY_SHOW_ONE = true
  # Popup gold/items gained in battle (pops-up after battle)
  BATTLE_POP = false
    # Battle reward prefix text for popup text window
    # (if BATTLE_POP = true)
    BATTLE_REWARD = 'Battle Reward: '
  # Show the Popup icon above the event which gave you the item.
  SHOW_ABOVE_EVENT = false
 
  #-----------------------------------------------------------------------------
  # Sound Groups (Dr. ?)
  #-----------------------------------------------------------------------------
  # With this edit you can play multiple sounds depending on what you pick up.
  # You can also play custom sounds when an important item is gained.
  #
  # Defining your Sounds, Volumes, and Pitches:
  # ===========================================
  # To set up your volumes, pitchs, and sound files you put a new pitch, volume,
  # and or sound into the 3 constants below (P_SND, P_SND_V, P_SND_P).
  #
  # Sounds:
  # -------
  # For sounds you can either play a SE or a ME.
  # To add a new sound simply add new index to P_SND like so:
  #
  # old:
  # P_SND = ['Audio/SE/Chime2']
  # new:
  # P_SND = ['Audio/SE/Chime2', 'Audio/SE/Item1'] # Added a new SE called Item1
  #
  # Volumes:
  # --------
  # To add a new volume add a new index to P_SND_V like so:
  #
  # old:
  # P_SND_V = [100]
  # new:
  # P_SND_V = [100, 80] # Added a volume with a percentage of 80. The precentage can be 0 - 100
  #
  # Pitchs:
  # -------
  # Same as with volumes except you add it to P_SND_P. The precentage can be 0 - 150.
  # Examples: [150] # Pitch of 150
  #
  # Defining your Sound Groups:
  # ===========================
  # A sound group is an array cosisting of a Sound Index (SI), a Volume Index (VI),
  # and a Pitch Index (PI). So the format is: [SI, VI, PI]. A sound index is the
  # index of one of your defined sounds, a volume index is the index of one of
  # your defined volumes, and a pitch index is the index of one of your defined
  # pitchs. Here are some examples (Using the values above):
  #
  # [0, 0, 0] # This would be the SE, Chime2, with a volume of 100 and a pitch of 150.
  # [1, 1, 0] # This would be the SE, Item1, with a volume of 80 and a pitch of 150.
  #
  # I hope you understood that.
  #
  # Using Sound Groups:
  # ===================
  # There are two ways to use sound groups. The GOLD_SOUND, WEAPON_SOUND, etc.
  # constants and via Chest_Popup.new or Chest_Popup.new2 commands.
  #
  # GOLD_SOUND, ITEM_SOUND, WEAPON_SOUND, etc.:
  # -------------------------------------------
  # To use a sound group in these constants simply write: GOLD_SOUND = [0, 0, 0]
  # or whatever your sound group is. These constants mean what sounds will play
  # when gold is gained, when a weapon is gained, etc. It should be evident, but
  # it does tell you what each one is beside the constant definition. Examples:
  #
  # GOLD_SOUND = [0, 0, 0] # This would play the SE, Chime2, with a volume of 100
  # and a pitch of 150 when gold is gained.
  # ITEM_SOUND = [1, 1, 0] # This would play the SE, Item1, witha volume of 80
  # and a pitch of 150 when an item is gained.
  #
  # Chest_Popup.new and Chest_Popup.new2 Commands:
  # ----------------------------------------------
  # Use this to make special music play when you get a special item.
  #
  # Example:
  # Let's say we get a very special item (Like a crystal) and we want it to
  # popup and play the ME Fanfare1 with the defualt volume and pitch (100, 150).
  # So here is what we would do. We would first add that ME into P_SND like so:
  #
  # P_SND = ['Audio/SE/Chime2', 'Audio/SE/Item1', 'Audio/ME/Fanfare1']
  #
  # Then we would make our event with Quick Event Creation > Treasure Chest,
  # select our chest character set and choose our crystal item from the drop-down.
  # Then we open up the event. We delete the second to last event on the first
  # page, the one that adds the a item. Then We replace it with a script event.
  # If the index of the crystal was 8 it would look like this:
  #
  # $scene=Chest_Popup.new(1,1,8,true,nil,nil,[2,0,0]) # See the 8 in this command?
  # That is the index of the item in the database.
  #
  # Note: This WON'T fit one just one line, and I'm not sure if that's going to
  # be a problem or not. If you want the command to fit on one line you could
  # ethier use the new2 command or do this:
  #
  # sg = [2,0,0] # sound group
  # t = true     # add value
  # $scene=Chest_Popup.new(1,1,8,t,nil,nil,sg)
  #
  # This would end up taking 3 lines but all of the commands would fit on one
  # line.
  #
  # After that, click OK and you are done.
  #
  # About New2:
  # -----------
  # The Chest_Popup.new2 is a command made just for the sound group purpose. It
  # shortens the new command by rearrganing it and removing the x, y settings.
  # In the example above the new2 command would have made the script look like
  # this:
  #
  # $scene = Chest_Popup.new2(1, 1, 10, [2,0,0])
  #
  # Thus, it would fit on one line. The syntax for this command is:
  #
  # $scene = Chest_Popup.new2(type, amount, index, sound_group=nil, add=true)
  #
  # Each of them have the same meaning the same as their counterparts in the
  # Chest_Popup.new command explained at the top of this script, with the
  # exception of the defualt of add now being true.
  #
  # Notes:
  # ======
  # PLAY_P_SND must be true for any of this to work.
  #
  #-----------------------------------------------------------------------------
  # Play sound on popup?
  PLAY_P_SND = true
    #######################################################
    # 3 options below are valid ONLY if PLAY_P_SND = true #
    #######################################################
    # Sound to play upon popup
    # Can be a list of sounds, volumes, and pitchs, but must be surrounded in []
    P_SND = ['Audio/SE/Chime2', 'Audio/SE/Chime1', 'Audio/ME/Fanfare1']
    P_SND_V = [100]
    P_SND_P = [150]
   
  # Which sound to play from P_SND at certain occasions.
  # SI = Sound Index, VI = Volume Index, PI = Pitch Index
  #                SI VI PI
  GOLD_SOUND    =  [1, 0, 0]      # Sound to play if gold
  ITEM_SOUND    =  [0, 0, 0]      # Sound to play if item
  ARMOR_SOUND   =  [1, 0, 0]      # Sound to play if armour
  WEAPON_SOUND  =  [1, 0, 0]      # Sound to play if weapon
  DEFAULT_SOUND =  [0, 0, 0]      # Sound to play if all others are nil
   
  # Play "close window" sound?
  # Sound Groups do not currently work with this sound.
  PLAY_C_SND = false
    #######################################################
    # 3 options below are valid ONLY if PLAY_C_SND = true #
    #######################################################
    # Sound to play upon popup close
    C_SND = 'Audio/SE/Cancel'
    C_SND_V = 80
    C_SND_P = 100
   
  #-----------------------------------------------------------------------------
  # Popup Text Controls
  #-----------------------------------------------------------------------------
  # Show popup text?
  SHOW_POPUP_TEXT = true
    ##############################################################
    # ALL options below are valid ONLY if SHOW_POPUP_TEXT = true #
    ##############################################################
    # Show icon with popup text?
    SHOW_POPUP_TEXT_ICON = true
    # Auto adjust window if over player
    TEXT_WINDOW_MOVE = true
    # Popup text window Y coordinate
    TEXT_WINDOW_Y = 180
    # Popup text window X coordinate offset
    # 0 (Zero)         : centered in the window
    # negative integer : offset left  (centered)
    # positive integer : offset right (centered)
    TEXT_WINDOW_X_OFFSET = 0
    # Wait for button to close? (false = wait for time)
    WAIT_FOR_BUTTON = false
      # Buttons to wait for
      # (if WAIT_FOR_BUTTON = true)
      # (Set both to the same button to check for only one)
      BUTTON_TO_WAIT_FOR1 = Input::C
      BUTTON_TO_WAIT_FOR2 = Input::B
      # Frames to wait
      # (if WAIT_FOR_BUTTON = false)
      WAIT_FOR_TIME = 40

#==============================================================================
# Popup_Data
#   - Added by Dr.?
#==============================================================================

class Popup_Data
 
  attr_accessor :gold_pop, :only_show_one, :show_above_event, :battle_pop, :play_p_snd, :play_c_snd,
  :c_snd, :c_snd_v, :c_snd_p, :show_popup_text, :show_popup_text_icon, :text_window_move,
  :text_window_y, :text_window_x_offset, :wait_for_button, :wait_for_time
 
  def initialize
    create_popup_data
  end
 
  def create_popup_data
    @gold_pop = GOLD_POP
    @only_show_one = ONLY_SHOW_ONE
    @battle_pop = BATTLE_POP
    @show_above_event = SHOW_ABOVE_EVENT
    @play_p_snd = PLAY_P_SND
    @play_c_snd = PLAY_C_SND
    @c_snd = C_SND
    @c_snd_v = C_SND_V
    @c_snd_p = C_SND_P
    @show_popup_text = SHOW_POPUP_TEXT
    @show_popup_text_icon = SHOW_POPUP_TEXT_ICON
    @text_window_move = TEXT_WINDOW_MOVE
    @text_window_y = TEXT_WINDOW_Y
    @text_window_x_offset = TEXT_WINDOW_X_OFFSET
    @wait_for_button = WAIT_FOR_BUTTON
    @wait_for_time = WAIT_FOR_TIME
  end
 
end

$popup = Popup_Data.new

#==============================================================================
# Scene_File
#   - Added by Dr.?
#==============================================================================

class Scene_File
 
  alias popup_save write_save_data
  def write_save_data(file)
    popup_save(file)
    Marshal.dump($popup, file)
  end
 
  alias popup_load read_save_data
  def read_save_data(file)
    popup_load(file)
    $popup = Marshal.load(file)
  end
 
end
     
#==============================================================================
# Game_System
#==============================================================================

class Game_System
  #--------------------------------------------------------------------------
  # Public Instance Variables (Added)
  #--------------------------------------------------------------------------
  attr_accessor :battle_pop       # holds items to popup after battle
  attr_accessor :battle_pop_gold  # holds gold to popup after battle
  attr_accessor :pop_event        # holds the event if SHOW_ABOVE_EVENT=true
  #--------------------------------------------------------------------------
  # Initialize (Mod)
  #--------------------------------------------------------------------------
  alias chest_pop_gs_initialize initialize unless $@
  def initialize
    chest_pop_gs_initialize
    @battle_pop = nil
    @battle_pop_gold = 0
    @pop_event = nil # Add by Dr. ?
  end
  #--------------------------------------------------------------------------
  # Get Battle Pop (New)
  #--------------------------------------------------------------------------
  def battle_pop
    return @battle_pop
  end
  #--------------------------------------------------------------------------
  # Set Battle Pop (New)
  #--------------------------------------------------------------------------
  def battle_pop=(items)
    @battle_pop = items
  end
  #--------------------------------------------------------------------------
  # Get Battle Pop Gold (New)
  #--------------------------------------------------------------------------
  def battle_pop_gold
    return @battle_pop_gold
  end
  #--------------------------------------------------------------------------
  # Set Battle Pop Gold (New)
  #--------------------------------------------------------------------------
  def battle_pop_gold=(gold)
    @battle_pop_gold = gold
  end
 
end

#==============================================================================
# Game_Interpreter
#==============================================================================

class Game_Interpreter
  #--------------------------------------------------------------------------
  # Change Gold (Mod)
  #--------------------------------------------------------------------------
  alias chest_pop_command_125 command_125 unless $@
  def command_125
    value = operate_value(@params[0], @params[1], @params[2])
    # Pop-up
    event = $game_map.events[@event_id]
    $game_system.pop_event = event
    if $game_switches[POPUP_SWITCH] != AUTO_POPUP and @params[0] == 0 and $popup.gold_pop
      if !$popup.show_above_event
        $scene = Chest_Popup.new(0, value, 1)
      elsif !@event_id.nil?
        $scene = Chest_Popup.new(0, value, 1, false, event.screen_x, event.screen_y)
      end
    end
    chest_pop_command_125   
  end
  #--------------------------------------------------------------------------
  # Change Items (Mod)
  #--------------------------------------------------------------------------
  alias chest_pop_command_126 command_126 unless $@
  def command_126
    value = operate_value(@params[1], @params[2], @params[3])
    # Pop-up
    event = $game_map.events[@event_id]
    $game_system.pop_event = event
    if $game_switches[POPUP_SWITCH] != AUTO_POPUP and @params[1] == 0
      if !$popup.show_above_event
        $scene = Chest_Popup.new(1, value, @params[0])
      elsif !@event_id.nil?
        $scene = Chest_Popup.new(1, value, @params[0], false, event.screen_x, event.screen_y)
      end
    end
    chest_pop_command_126
  end
  #--------------------------------------------------------------------------
  # Change Weapons (Mod)
  #--------------------------------------------------------------------------
  alias chest_pop_command_127 command_127 unless $@
  def command_127
    value = operate_value(@params[1], @params[2], @params[3])
    # Pop-up
    event = $game_map.events[@event_id]
    $game_system.pop_event = event
    if $game_switches[POPUP_SWITCH] != AUTO_POPUP and @params[1] == 0
      if !$popup.show_above_event
        $scene = Chest_Popup.new(2, value, @params[0])
      elsif !@event_id.nil?
        $scene = Chest_Popup.new(2, value, @params[0], false, event.screen_x, event.screen_y)
      end
    end
    chest_pop_command_127
  end
  #--------------------------------------------------------------------------
  # Change Armor (Mod)
  #--------------------------------------------------------------------------
  alias chest_pop_command_128 command_128 unless $@
  def command_128
    value = operate_value(@params[1], @params[2], @params[3])
    # Pop-up
    event = $game_map.events[@event_id]
    $game_system.pop_event = event
    if $game_switches[POPUP_SWITCH] != AUTO_POPUP and @params[1] == 0
      if !$popup.show_above_event
        $scene = Chest_Popup.new(3, value, @params[0])
      elsif !@event_id.nil?
        $scene = Chest_Popup.new(3, value, @params[0], false, event.screen_x, event.screen_y)
      end
    end
    chest_pop_command_128
  end
end

#==============================================================================
# Item Popup Window (New)
#==============================================================================

class Item_Popup_Window < Window_Base
  #--------------------------------------------------------------------------
  # Initialize
  #--------------------------------------------------------------------------
  def initialize(x, y)
    super(0, 0, 544, 416)
    self.opacity = 0
    # Adjust X/Y to proper origin
    @x, @y = x - 27, y - 60
  end
  #--------------------------------------------------------------------------
  # Pop-Up
  #--------------------------------------------------------------------------
  def pop_up(icon_index, x_offset, y_offset)
    self.contents.clear
    # Draw pop-up icon
    draw_icon(icon_index, @x + x_offset, @y + y_offset, true)
  end
end

#==============================================================================
# Name window (New)
#==============================================================================

class Name_Window < Window_Base
  #--------------------------------------------------------------------------
  # Initialize
  #--------------------------------------------------------------------------
  def initialize(x, y, desc, no_desc, index, gold = false, icon = 0)
    super(x, y, 56, WLH + 32)
    # Adjust window to content's size and center
    icon_x = self.contents.text_size(index).width + 6
    width = self.contents.text_size(desc).width
    self.width = width + 32
    self.x = ((544 - self.width) / 2) + $popup.text_window_x_offset
    create_contents
    # Draw pop-up text
    ix = no_desc ? 0 : icon_x
    item_check = $game_system.battle_pop
    gold_check = $game_system.battle_pop_gold
    if $popup.battle_pop and (item_check != nil or gold_check > 0) # If battle reward
      ix += self.contents.text_size(BATTLE_REWARD).width + 2
    end
    tx = gold ? 4 : 0
    draw_icon(icon, ix, 0) if $popup.show_popup_text_icon and !gold
    self.contents.draw_text(tx, 0, width, WLH, desc, 0)
    draw_icon(GOLD_ICON, width - 24, 0, true) if gold
  end
end

#==============================================================================
# Scene_Base
#==============================================================================

class Scene_Base
  #--------------------------------------------------------------------------
  # Initialize (New)
  #--------------------------------------------------------------------------
  def initialize
    @disable_blur = false
  end
  #--------------------------------------------------------------------------
  # Disable blur (New)
  #--------------------------------------------------------------------------
  def disable_blur=(enabled)
    @disable_blur = enabled
  end
  #--------------------------------------------------------------------------
  # Create Snapshot for Using as Background of Another Screen (Rewrite)
  #--------------------------------------------------------------------------
  def snapshot_for_background
    $game_temp.background_bitmap.dispose
    $game_temp.background_bitmap = Graphics.snap_to_bitmap
    # Don't blur if disabled
    $game_temp.background_bitmap.blur unless @disable_blur # changed
  end
end

#==============================================================================
# Scene_Map
#==============================================================================

class Scene_Map < Scene_Base
  #--------------------------------------------------------------------------
  # Start (Mod)
  #--------------------------------------------------------------------------
  alias chest_pop_start start unless $@
  def start
    chest_pop_start
    # Popup battle rewards
    if $popup.battle_pop
      if $game_system.battle_pop_gold > 0  # gold
        gold = $game_system.battle_pop_gold
        $game_system.battle_pop_gold = 0
        $scene = Chest_Popup.new(0, gold, 0, true)
      elsif $game_system.battle_pop != nil # items
        item = $game_system.battle_pop.shift
        if item == nil
          $game_system.battle_pop = nil
        else
          type = 1 if item.is_a?(RPG::Item)
          type = 2 if item.is_a?(RPG::Weapon)
          type = 3 if item.is_a?(RPG::Armor)
          $scene = Chest_Popup.new(type, 1, item.id, true)
        end
      end
    end
  end
end

#==============================================================================
# Scene_Battle
#==============================================================================

class Scene_Battle < Scene_Base
  #--------------------------------------------------------------------------
  # Display Gained Experience and Gold (Rewrite)
  #--------------------------------------------------------------------------
  def display_exp_and_gold
    # Save gold to popup after battle
    $game_system.battle_pop_gold = $game_troop.gold_total if $popup.battle_pop # added
    exp = $game_troop.exp_total
    gold = $popup.battle_pop && $popup.gold_pop ? 0 : $game_troop.gold_total # changed
    $game_party.gain_gold(gold) unless $popup.battle_pop  # changed
    text = sprintf(Vocab::Victory, $game_party.name)
    $game_message.texts.push('\|' + text)
    if exp > 0
      text = sprintf(Vocab::ObtainExp, exp)
      $game_message.texts.push('\.' + text)
    end
    if gold > 0
      text = sprintf(Vocab::ObtainGold, gold, Vocab::gold)
      $game_message.texts.push('\.' + text)
    end
    wait_for_message
  end
  #--------------------------------------------------------------------------
  # Display Gained Drop Items (Mod)
  #--------------------------------------------------------------------------
  alias chest_pop_display_drop_items display_drop_items unless $@
  def display_drop_items
    # Save items to popup after battle
    $game_system.battle_pop = $game_troop.make_drop_items if $popup.battle_pop
    return if $popup.battle_pop
    chest_pop_display_drop_items
  end
end

#==============================================================================
# Chest_Popup (New)
#==============================================================================

class Chest_Popup < Scene_Base
  #--------------------------------------------------------------------------
  # Initialize
  #--------------------------------------------------------------------------
  def initialize(type, amount, index, add = false, x = nil, y = nil, sound_group = nil)
    x = $game_player.screen_x if x == nil
    y = $game_player.screen_y if y == nil
    $game_switches[POPUP_SWITCH] = !AUTO_POPUP
    $scene.disable_blur = true
    @x, @y, @amount = x, y, amount
    @gold = @no_desc = false
    case type
    when 0 # Gold
      $game_party.gain_gold(amount) if add
      @icon = GOLD_ICON
      @desc_amount = ''
      @desc = @amount.to_s
      @amount = 1
      @gold = true
      @sound = GOLD_SOUND
    when 1 # Items
      $game_party.gain_item($data_items[index], amount) if add
      @icon = $data_items[index].icon_index
      @desc_amount = @amount.to_s + ' x'
      @desc_amount = '' if @amount == 1
      @no_desc = true if @amount == 1
      @desc = $data_items[index].name
      @amount = 1 if $popup.only_show_one
      @sound = ITEM_SOUND
    when 2 # Weapons
      $game_party.gain_item($data_weapons[index], amount) if add
      @icon = $data_weapons[index].icon_index
      @desc_amount = @amount.to_s + ' x'
      @desc_amount = '' if @amount == 1
      @no_desc = true if @amount == 1
      @desc = $data_weapons[index].name
      @amount = 1 if $popup.only_show_one
      @sound = WEAPON_SOUND
    when 3 # Armors
      $game_party.gain_item($data_armors[index], amount) if add
      @icon = $data_armors[index].icon_index
      @desc_amount = @amount.to_s + ' x'
      @desc_amount = '' if @amount == 1
      @no_desc = true if @amount == 1
      @desc = $data_armors[index].name
      @amount = 1 if $popup.only_show_one
      @sound = ARMOR_SOUND
    end
    # Check sound_group
    @sound = sound_group if !sound_group.nil?
    # Set index
    @index = @desc_amount
    # Add description to text
    if @gold
      @desc = @desc + '      '
    else
      if $popup.show_popup_text_icon
        @desc = @desc_amount + '      ' + @desc
      else
        @desc = @desc_amount + ' ' + @desc if @desc_amount != ''
      end
    end
    # If battle reward
    item_check = $game_system.battle_pop
    gold_check = $game_system.battle_pop_gold
    if $popup.battle_pop and (item_check != nil or gold_check > 0)
      @desc = BATTLE_REWARD + @desc
    end
  end
  #--------------------------------------------------------------------------
  # New2
  #   - Added by Dr.?
  #   - This is mostly used for controling sound groups
  #--------------------------------------------------------------------------
  def self.new2(type, amount, index, sound_group = nil, add = true)
    return Chest_Popup.new(type, amount, index, add, nil, nil, sound_group)
  end
  #--------------------------------------------------------------------------
  # New3
  #   - Added by Dr.?
  #   - This is mostly used for making the icon pop-up over an event
  #--------------------------------------------------------------------------
  def self.new3(type, amount, index, event, add = false, sound_group = nil)
    event = $game_map.events[event] if event.is_a?(Integer)
    return Chest_Popup.new(type, amount, index, add, event.screen_x, event.screen_y, sound_group)
  end
  #--------------------------------------------------------------------------
  # Start
  #--------------------------------------------------------------------------
  def start
    create_background
    # Create pop-up window
    @popup_window = Item_Popup_Window.new(@x, @y)
  end
  #--------------------------------------------------------------------------
  # Terminate
  #--------------------------------------------------------------------------
  def terminate
    # Dispose windows
    @popup_window.dispose
    @menuback_sprite.dispose
    @name_window.dispose if $popup.show_popup_text
  end
  #--------------------------------------------------------------------------
  # Return Scene
  #--------------------------------------------------------------------------
  def return_scene
    # Turn off blur and pop-up switch
    $scene.disable_blur = false
    $game_switches[POPUP_SWITCH] = false
    $scene = Scene_Map.new
  end
  #--------------------------------------------------------------------------
  # Update
  #--------------------------------------------------------------------------
  def update
    super
    # Update pop-up window
    @popup_window.update
    @menuback_sprite.update
    # Do the actual popping-up
    do_popup
  end
  #--------------------------------------------------------------------------
  # Update Basic
  #--------------------------------------------------------------------------
  def update_basic
    Graphics.update             
    Input.update                 
  end
  #--------------------------------------------------------------------------
  # Wait
  #--------------------------------------------------------------------------
  def wait(duration)
    # Wait for DURATION frames
    for i in 0..duration
      update_basic
    end
  end
  #--------------------------------------------------------------------------
  # Wait for close
  #--------------------------------------------------------------------------
  def wait_for_close
    count = 0
    loop do
      update_basic
      count += 1
      # Close if button 1 pressed
      break if Input.trigger?(BUTTON_TO_WAIT_FOR1) and $popup.wait_for_button
      # Close if button 2 pressed
      break if Input.trigger?(BUTTON_TO_WAIT_FOR2) and $popup.wait_for_button
      # Close if time elapsed
      break if count >= $popup.wait_for_time and !$popup.wait_for_button
    end
  end
  #--------------------------------------------------------------------------
  # Create Background
  #--------------------------------------------------------------------------
  def create_background
    # Create modified background
    @menuback_sprite = Sprite.new
    @menuback_sprite.bitmap = $game_temp.background_bitmap
    @menuback_sprite.update
  end
  #--------------------------------------------------------------------------
  # Show Name
  #--------------------------------------------------------------------------
  def show_name
    x = 272
    y = $popup.text_window_y
    py = $game_player.screen_y - 32
    cy = (py - y).abs
    # Offset Y if text box is above player's position
    if cy < 128 and $popup.text_window_move
      y = py < y ? y + (y / 2) : y - (y / 2)
    end
    # Create Window
    @name_window = Name_Window.new(x, y, @desc, @no_desc, @index, @gold, @icon)
    # Wait for button(s) or time
    wait_for_close
    # Play sound
    Audio.se_play($popup.c_snd, $popup.c_snd_v, $popup.c_snd_p) if $popup.wait_for_button and $popup.play_c_snd
  end
  #--------------------------------------------------------------------------
  # Do Pop-Up
  #--------------------------------------------------------------------------
  def do_popup
    # Set sound index - Dr.?
    @sound = DEFAULT_SOUND if @sound.nil?
    # Pop-up icon(s)
    for i in 1..@amount
      # Support for ME added - Dr.?
      if P_SND[@sound[0]].include?("/SE/")
        Audio.se_play(P_SND[@sound[0]], P_SND_V[@sound[1]], P_SND_P[@sound[2]]) if $popup.play_p_snd
      elsif P_SND[@sound[0]].include?("/ME/")
        Audio.me_play(P_SND[@sound[0]], P_SND_V[@sound[1]], P_SND_P[@sound[2]]) if $popup.play_p_snd
      end
      for i in 0..4
        @popup_window.pop_up(@icon, 0, i * -4)
        @popup_window.update
        wait(2)
      end
      wait(5) if i != @amount and !$popup.only_show_one
    end
    wait(5)
    # Pop-up text
    show_name if $popup.show_popup_text
    # Exit
    return_scene
  end
 
end

My issue is that even when I turn the wlh off with
Code: [Select]
$game_ats.fit_window_to_text = false
it still cuts off some text. Any way to fix it?

EDIT: It also places the box in random places on the map. How to fix that so that it'll be in the center of the screen all the time?
« Last Edit: January 12, 2011, 04:53:11 AM by DarkCodeZero »

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
It doesn't seem like that script uses the message window, so are you sure that it's doing those errors because of the ATS and is not inherent in that script? I don't see any reason why my script would interact with that one - it creates its own windows.

****
Rep:
Level 84
3...2...1...
The chest opens and the icon comes out of the chest, then a message window comes up and says what the item was. I can't turn off the window.

I've put this into the event before it does anything:
Code: [Select]
$game_ats.fit_window_to_text = false

And then put this back in to put the ATS back to how I use it:
Code: [Select]
$game_ats.fit_window_to_text = true

But it still acts strange.

Note for the attachment, I get 10 gold from the chest. But all I see is part of the 1 and then the icon.

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
OK, but is that a problem with the ATS or is it independent - IE does it happen if you do it in a project that doesn't have the ATS in it?

From what I could tell when I glanced at the script, it creates and uses its own windows - it doesn't piggyback on Window_Message and so I don't see how the ATS would be affecting it.

****
Rep:
Level 84
3...2...1...
It only does it when I have the ATS. What if I put the script above the ATS? I'll try it then edit this and let you know the results.

EDIT: It still cuts off the words. Not really cuts off the words, but puts the icon over the top of the words.
« Last Edit: January 16, 2011, 12:44:58 AM by DarkCodeZero »

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
Alright, can you send me a little demo with the error recreated and I will take a look. I would prefer if it wasn't your project demo, but anything is fine so long as I know where to call the event that creates the error.

****
Rep:
Level 84
3...2...1...
Sent. Had time to look at it?

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
not yet. I will get to it soon.

EDIT::

I just took a look - removing the ATS from the project does not fix the problem, so it is not the ATS. Why did you lie to me about testing that? The error is directly in the Chest Popup script and will thus occur even if there were no other scripts present - it takes poor account of font difference. In the future, I would ask that you take the steps that I ask of you when debugging a script before foisting it on me. In any case, I suppose there is no harm done and at least now I've taken the time to examine the problem.

A simple fix is to replace the method starting at line 513 with the following:

Code: [Select]
  #--------------------------------------------------------------------------
  # Initialize
  #--------------------------------------------------------------------------
  def initialize(x, y, desc, no_desc, index, gold = false, icon = 0)
    super(x, y, 56, WLH + 32)
    # Adjust window to content's size and center
    icon_x = self.contents.text_size(index).width
    width = self.contents.text_size(desc).width
    width += 10
    self.width = width + 32
    self.x = ((544 - self.width) / 2) + $popup.text_window_x_offset
    create_contents
    # Draw pop-up text
    ix = no_desc ? 0 : icon_x
    item_check = $game_system.battle_pop
    gold_check = $game_system.battle_pop_gold
    if $popup.battle_pop and (item_check != nil or gold_check > 0) # If battle reward
      ix += self.contents.text_size(BATTLE_REWARD).width + 2
    end
    tx = gold ? 4 : 0
    if !gold && desc[0, 1] != " "
      desc.insert (3, " ")
    elsif !gold
      tx += 10
    end
    draw_icon(icon, ix, 0) if $popup.show_popup_text_icon and !gold
    self.contents.draw_text(tx, 0, width, WLH, desc, 0)
    draw_icon(GOLD_ICON, width - 24, 0, true) if gold
  end

There is potentially another problem with the script when it comes to using different fonts. Instead of directly calculating whether an icon is used or not, the scripter decided to just put a set number of spaces when passing the name of the item gained to his little window. This was a poor decision as it can (and in your case, did) cause problems when using different fonts. This is the real problem with the script and it is one that I did not actually address - I retained his method and simply adapted it so that it will not cause problems with the specific font you are using. I did this because to really fix it would take more time than I am willing to spend on someone else's script. The result of this is that if you change fonts, you will once again have a problem. If you want a real solution, I suggest you alert the scripter of these errors and ask him to fix it. My guess is that the error was introduced by Mac Malone (Dr ?), not Wij, but that is speculative as I am not familiar with the original script and am just going on reputation.

As for the window popping up in different places, that was a deliberate choice of the scripter and it's based on where the player sprite is on the screen. It appears designed to avoid blocking the sprite. I did not take the time to address this - it also has nothing to do with the ATS and if you want it changed, talk to the scripter.

Again though, I'd like to reiterate that while I am happy to help you with this problem, I do not like that you decided to obtain my aid by pretending it was an incompatibility with my script and maintaining that fiction even when following my directions would have clearly shown that was not the issue. Maybe it was accidental, I don't know, but in the future just post in the regular Scripts board when you have a problem with some random script.
« Last Edit: January 18, 2011, 12:41:09 AM by modern algebra »

**
Rep: +0/-0Level 82
I don't know if this can already be done with the script, but if it can't I have a suggestion for a feature to be added.  Basically what I'd like to do is be able to change the face displayed in the message box after the message is finished (kinda like when you say something that you think is somewhat amusing and you crack a smile).  The text tag could be structured like:

\cf("file_name", index)

****
Rep:
Level 84
3...2...1...
Hi, Modern. A couple things.

First. Thank you for fixing it very much. You did something that I do not know how to do.

Second. I did not intentionally "lie" to you. I did test it without the ATS, and it did work. What happened though, my guess, is that I wasn't using the font that I am in my project. So I truly did think it was an issue with the ATS, and I'm very sorry for any inconvenience I have caused you and I hope that you won't think less of me in the future. I try not to disappoint, even though I sometimes fail. Thank you once again Modern!

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
I'm sorry that I jumped to a conclusion that you were doing it intentionally - I did recognize that it was possible that you were simply not being rigourous enough, but it is not uncommon for me to get requests about random scripts and I am not the world's personal scripter. I don't hold it against you personally and as I said, it's not a big deal and I would help you regardless. I do think you should be a little more careful in the future and logically make a conclusion as to the source of the error before implicating some other script based on random guesswork. It would not have been hard to either simply remove the ATS from your project to test or try both in a new project where they were the only scripts and no other variables were modified.
« Last Edit: January 19, 2011, 11:28:35 PM by modern algebra »

****
Rep:
Level 84
3...2...1...
You are right, and I will make sure that I don't mess up again. I would never intentionally take advantage of you. You must be a busy person, as am I, and I respect your time and effort into scripting awesome scripts, and helping people resolve issues in scrips. I would never intentionally waste your time. So, I shall redouble my efforts to make sure I do not do it again.

**
Rep: +0/-0Level 84
I've been using ATS2 for months, and just today came across an error where \pid[n] wasn't working, so I upgraded to ATS3, and I'm re-adjusting all of my settings and I've come across a problem.
I used to use the Yanfly RD menu options to allow me to set the windowskin and change it around. I used to put it below ATS2 and it would supersede it, but now it causes an error (line 2616) because ATS3 and the menu options both want to mess with the windowskin.

This was also nice because it would set the facewindow, choicebox, namebox and message window to display the same thing instead of having to change all of them four times. Is there a way to make it so Yanfly's system still works?

Other than that I'm loving the update!

P.S. this is probably a hard request so you don't have to do it if you don't want to, but in RMXP ccoa had a system for facesets so that when RMXP reached the end of a message for a window it would switch the faceset from one (talking) to another (blinking). Any way that could be easily or feasibly done?
« Last Edit: February 01, 2011, 02:43:34 PM by Organ House »

*
Rep: +0/-0Level 72
RMRK Junior
I just start using this script and I have a really beginner question...
How do you enable the choicebox? I can't find the option