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 - KK20

Pages: [1] 2 3 ... 152
1
Script Troubleshooting / Re: [RMMV] Problem with language on mobile
« on: April 19, 2018, 08:24:00 PM »
Did you contact the author? I feel they would be more helpful than any of us (largely because everyone that's still active here doesn't do MV script support).

2
Thanks for the QA, I must have been in a drunken stupor last night.
The DLL is fine by the way.

Reverted to 2.31 until I fix it.
EDIT: 2.32 is back up

3
Quick update to 2.32
  • Forgot to update XPA Tilemap's DLL from version 0.4, whoops :P (thanks tasuku13 for reporting this)
  • Input module's constants are now integers (as they are in XP) instead of symbols (as they are in VXA). You can still use XP's or VXA's way of handling input, like so
Code: [Select]
Input.trigger?(Input::C) # XP
Input.trigger?(:C)       # VXA

4
It does return something now if you try to access the window's viewport, yes. But the way the viewport is used is not how XP does it. I know that the way you implemented it was more so for convenience in positioning all the window's elements and not having to move all of them when--as an example--Window#x changes (as the top left corner of the window will always be at [0,0]; just only need to move the viewport).

IOW, your rewrite always creates a viewport the same size as the window. As such, the window is always in full view. You also cannot initialize the window to another viewport.
XP doesn't create a viewport unless explicitly initialized with one. And it behaves like any Sprite would (contents being clipped out if not contained fully in the viewport, etc.).

But default XP scripts never initializes any of the window sub-classes with a viewport. Hence, no one should be using the Window's viewport anyways. Only example I have seen so far is that online script whitespirits mentioned, where the author was drawing item description sprites to the Item Window's viewport, which were being clipped using XPA_Window (basically, there was no reason for the author to be initializing these sprites to the window's viewport).

5
Hidden classes are exactly as they read: hidden. You don't have access to the underlying code-base for these classes. Any rewrites to these classes are the scripter's best interpretation of how the script works (usually) in pure Ruby. The Tilemap class, for example, is most likely largely written in C code since the amount of drawing it does is performance heavy.

btw Selwyn's Window class rewrite is not a perfect copy of Window. Blizzard's is nearly an exact replica where Viewports are not necessarily used correctly, but no one should be accessing a Window's viewport to begin with. Try using this windowskin and compare the two scripts

You should see the difference at the title screen, namely the cursor.

That script you linked from the ARC dev thread just grabs a list of the classes' methods and variables. Again, there's no actual source code because it's hidden. This was used mainly to get an idea of what they needed to implement their own version of the hidden classes.

For getting the fonts, it probably just uses the Windows' environment variables. For example, in Windows Explorer, typing %windir%\Fonts will bring you to the fonts folder. If the font isn't found, then RMXP just doesn't draw anything (I mean, there's nothing wrong with that). There isn't a way to manipulate the underlying code to look elsewhere for font files, so you have to use a script to get that done.

6
Troubleshooting / Help / Re: [XP] Undo UMS changes to choice window?
« on: April 15, 2018, 01:48:23 AM »
I don't see any natural way to do it. Window_Message is rewritten heavily and uses another class to handle choices now. In theory, it is possible to revise the script to do so, but I don't think anyone here will do it.

7
Script Troubleshooting / Re: Image Map Maker issue
« on: April 11, 2018, 04:57:49 AM »
Give this a shot.
Code: [Select]
tilesets = load_data('Data/Tilesets.rxdata')
changed_maps = []

Dir['Data/Map*.rxdata'].each do |f|
  Graphics.update
  next unless f[/Map\d+/]
  map = load_data(f)
  tileset = RPG::Cache.tileset(tilesets[map.tileset_id].tileset_name)
  max_id = tileset.height / 32 * 8 + 383
  overwrite_file = false
 
  for z in 0..2
    for y in 0...map.data.ysize
      for x in 0...map.data.xsize
        if map.data[x,y,z] > max_id
          map.data[x,y,z] = 0
          overwrite_file = true
          changed_maps << f unless changed_maps.include?(f)
        end
      end
    end
    Graphics.update
  end
 
  if overwrite_file
    save_data(map, f)
  end
end

changed = "Changed the following maps:\n"
changed_maps.each do |map|
  changed << "#{map}\n"
end
print changed

exit
Paste above main, testplay your project. It'll spit out a message box and close afterwards. Reopen your project and it should be fixed. Didn't test it for large maps nor scanning more than 2 maps in a project.

8
Script Troubleshooting / Re: Image Map Maker issue
« on: April 10, 2018, 11:44:02 PM »
You'll need to manually go to those places on your map and draw over them with the blank tile ID at the top left of the tileset.

I would make a script that just scans all your maps and replaces invalid ones but currently at work.

9
Script Troubleshooting / Re: Image Map Maker issue
« on: April 10, 2018, 11:14:56 PM »
It's not the tileset itself that's the problem. Like, let's say for example (note, this is not how it actually is,  but just to make it easier to explain) your tileset graphic has 80 tiles on it. The top left tile is tile ID 0. Immediately right of it is tile ID 1, then 2, then 3...and the tile immediately below 0 is tile ID 7. Using that logic, the bottom right tile on the tileset will be tile ID 79.

So you make your map, using all the tiles your tileset has. Then, at some later point in time, you go "do I really need 80 tiles?" and change the tileset graphic to something smaller in size (let's say 40 tiles in total). While your map no longer draws the tile IDs 40-79 anymore, they still exist in the map data. This is what your error most likely is--your map is using a tile ID that the tileset graphic does not support.

You can put this script above Main
Code: [Select]
class Game_Map
  alias check_invalid_tiles setup
  def setup(map_id)
    check_invalid_tiles(map_id)
   
    bitmap = RPG::Cache.tileset(@tileset_name)
    maxtileid = (bitmap.width / 32) * (bitmap.height / 32) - 1
   
    for x in 0...@map.data.xsize
      for y in 0...@map.data.ysize
        for z in 0...@map.data.zsize
          if @map.data[x,y,z] - 384 > maxtileid
            p("[#{x},#{y},#{z}] = " + @map.data[x,y,z].to_s)
          end
        end
      end
    end
  end
 
end
and put your character in the problem map. If there are invalid tile IDs, a message window will pop up showing the [x, y, layer] coordinates.

10
Script Troubleshooting / Re: Image Map Maker issue
« on: April 10, 2018, 10:10:38 PM »
Line in question is pointed out below
Code: [Select]
  def initialize(x, y, tile_id, z = 4)
    @tile_id = tile_id
    @opacity = 255
    @x = x
    @y = y
    @z = z # Used for tie-breaker in comparison
    @sx = x * 32
    @sy = y * 32
    @sz = (y + $game_map.priorities[@tile_id]) * 32 + 33   #<============================
    # If tile ID value is valid
    if @tile_id >= 48
      @bitmap = RPG::Cache.tile!($game_map.tileset_name,
                                 $game_map.autotile_names, @tile_id)
      @rect = Rect.new(0, 0, 32, 32)
    else
      @bitmap = Default_Bitmap
      @rect = @bitmap.rect
    end

Since you mention this happens on some maps, I take it you have some invalid tile IDs drawn somewhere on them (i.e. a tile ID that is larger than the total number of tiles the tileset has).

11
Troubleshooting / Help / Re: [XP] Multiple MESSAGE WINDOWS at once?
« on: April 09, 2018, 05:34:24 AM »
I don't think any message window script will help you out here. This sounds way too custom that it needs to be its own script.

13
RMXP Script Database / Re: [XP] Blinking Characters
« on: April 07, 2018, 09:43:11 AM »
As raised up by Shrimpses, there's some potential bugs with the script. Posting a general fix here in case others happen to use this script.
Code: [Select]
#==============================================================================
# ** Game_Character (part 4)
#------------------------------------------------------------------------------
#  This class deals with characters. It's used as a superclass for the
#  Game_Player and Game_Event classes.
#
#   This section covers the main body of the blinking.
#   The only things you should need to change are the blink states and the blink
#   frames. The frames decides a rough guide for how long the eyes should be open
#   for. The blink states decide how the eyes act.
#     -1 = No blinking graphic
#      0 = Forced no blinking
#      1 = Normal blink(Eyes open)
#      2 = Normal blink(Eyes closed)
#      3 = Forced eyes closed
#==============================================================================

class Game_Character
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
 
  attr_accessor :base_character_name      #Base character file
  attr_accessor :blink_state              #Blink boolean
  attr_accessor :blink_frames             #Blink frame interval (average)
  attr_accessor :blink_count              #Current blink count
  attr_accessor :close_count              #Close rnd
  attr_accessor :open_count               #Open rnd
 
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  alias extinit initialize
  def initialize
    extinit
    @base_character_name = @character_name
    @has_blink = (RPG::Cache.character("#{@character_name}_Blink", 0) && true rescue false)
    @blink_state = 1
    @blink_frames = 80
    @blink_count = 0
    @close_count = 0
    @open_count = 0
  end
 
  alias blinkupdate update
  def update
    blinkupdate
    if @base_character_name != @character_name.chomp('_Blink')
      @base_character_name = @character_name
      @blink_count = 0 if @blink_state == -1
      @blink_state = 1
      @has_blink = (RPG::Cache.character("#{@character_name}_Blink", 0) && true rescue false)
    end
    update_blink
  end
 
  def update_blink
    if !@has_blink && @blink_state < 2
      @blink_state = -1
      return
    end
    bs = sprintf("%s_Blink", @character_name)
    if @blink_state == 1
      @blink_count += 1
      if @blink_count >= @open_count
        @base_character_name = @character_name
        @blink_count = 0
        @blink_state = 2
        @character_name = bs
        @close_count = (6 * (rand + 0.5))
      end
    end
    if @blink_state == 2
      @blink_count += 1
      if @blink_count >= @close_count
        @blink_count = 0
        @blink_state = 1
        @character_name = @base_character_name
        @open_count = @blink_frames * (rand + 0.5)
      end
    end
    if @blink_state == 3
      bs = sprintf("%s_Blink", @base_character_name)
      @blink_count = 0
      if @character_name != bs
        @character_name = bs
      end
    end
  end
 
  def blink_reset_base
    @base_character_name = @character_name
  end

  def blink_refresh(frames)
    @blink_count = 0
    @blink_frames = frames
  end
 
  def blink_set_state(state)
    return unless state.between?(-1, 3)
    @blink_state = state unless (state >= 2 && !@has_blink)
    @blink_count = 0
    @character_name = @base_character_name if state <= 1
  end
end

class Interpreter
 
  alias command_322_blink command_322
  def command_322
    $game_player.blink_state = 1 if $game_player.blink_state == -1
    command_322_blink
  end
 
  def blink_refresh(eventid, frames)
    # Branch by parameter
    case eventid
    when -1  # player
      $game_player.blink_refresh(frames)
    when 0  # this event
      events = $game_map.events
      events[@event_id].blink_refresh(frames)
    else  # specific event
      events = $game_map.events
      events[eventid].blink_refresh(frames)
    end
  end
 
  def blink_set_state(eventid, state)
    # Branch by parameter
    case eventid
    when -1  # player
      $game_player.blink_set_state(state)
    when 0  # this event
      events = $game_map.events
      events[@event_id].blink_set_state(state)
    else  # specific event
      events = $game_map.events
      events[eventid].blink_set_state(state)
    end
  end
 
end

14
The problem is because the graphic is requesting a change at the same time it is returning from a closed eyes to open eyes state. The notion that "the script uses move routes to briefly swap actors with their 'blink' sprites" is not correct.

When the eyes are requested to close, a variable holds the original name of the graphic.
Code: [Select]
@base_character_name = @character_nameWhen the eyes reopen, it resets the name back
Code: [Select]
@character_name = @base_character_name
I'll look into fixing this later this week.

Also, it's okay to necro if the question is related to the topic at hand.

15
Script Requests / Re: 2x Double Scaling Script in RMXP?
« on: April 03, 2018, 07:11:55 AM »
Convert your project to XPA.
http://forum.chaos-project.com/index.php/topic,12899.0.html
Since it runs on VXA's engine, it naturally supports upscaling.

Vanilla XP...never heard of one.

16
RMXP Script Database / Re: [XP] Transition Pack v1.11
« on: April 02, 2018, 09:50:03 PM »
As the script instructions say, you use the command
Code: [Select]
$scene = Transition.new(Scene_Something.new)The problem though is that the script box is too small to fit some Scene classes all on one line. So you saw this:
Code: [Select]
$scene = Transition.new
(Scene_Map.new)
You should do it like this
Code: [Select]
$scene = Transition.new(
Scene_Map.new)

FYI, if you fail to put something in the Transition.new, it defaults to Scene_Menu, as seen in the code itself:
Code: [Select]
  #--------------------------------------------------------------------------
  # * Initialize
  #     next_scene : Instance of the scene to transition into
  #           type : Transition type
  #          *args : Arguments for specified transition type
  #--------------------------------------------------------------------------
  def initialize(next_scene=Scene_Menu.new, type=nil, *args)
    @next_scene = next_scene
    @args = args
    # If transition type is specified, use it.
    # Otherwise, use default.
    @type = type.nil? ? $game_temp.transition_type : type
  end

17
RMXP Script Database / Re: [XP] Blizz-ABS
« on: April 01, 2018, 07:15:29 AM »
Blizz, there is no check for if the actor has a weapon equipped. I'm not sure if this was changed from a previous version.
A quick fix would be to add this method:
Code: [Select]
class Map_Battler < Game_Character
  alias call_old_atk_can_use attack_can_use?
  def attack_can_use?
    return false unless call_old_atk_can_use
    return false if @battler.is_a?(Game_Actor) && @battler.weapon_id <= 0
    return true
  end
end
This will make a buzzer sound if no weapon is equipped. But it also won't allow you to do a 0-damage attack (or play any attack animation for that matter).

18
Regarding commercial use, you must reach an agreement with the authors of said scripts. I generally negotiate with a free-copy of the game.

19
RMXP Script Database / Re: [XP] Custom Resolution
« on: March 25, 2018, 09:46:04 AM »
It's hard to say what the real issue could be. The script already handles Planes by using a rewrite, drawing bitmaps that stretch to the resolution's size. The script also handles resizing viewports that are 640x480 in size.

20
Script Requests / Re: Conditional Branch addon
« on: March 22, 2018, 09:49:02 PM »
@lilbrudder917
Oh I see why now. Even though nil is treated as false in an if-statement, RMXP is not evaluating the string in an if-statement.
Code: [Select]
if $game_system.playing_bgm && $game_system.playing_bgm.name == "TRACKNAME" #=> false
Code: [Select]
$game_system.playing_bgm && $game_system.playing_bgm.name == "TRACKNAME" #=> nilThe problem occurs in the Else handling, when interpreter is looking specifically for false
Code: [Select]
  #--------------------------------------------------------------------------
  # * Else
  #--------------------------------------------------------------------------
  def command_411
    # If determinant results are false
    if @branch[@list[@index].indent] == false
So yeah I guess you need to do the check for if not nil.

@F0
Yeah I understand and completely agree with you. I mainly just follow https://github.com/bbatsov/ruby-style-guide when I do actual development work. For scripts and one-liners, I flex my fingers for out-of-the-box thinking.

Pages: [1] 2 3 ... 152