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

21
General Discussion / Re: See With Your Ears - Video
February 01, 2018, 09:24:10 am
I love the nerdwriter, he has some pretty excellent videos.

Sound design is definitely overlooked and can add so much depth to the simplest of games when used correctly.
22
Oh dang, very nice. Will be testing this out soon!
23
I definitely wouldn't use the word genius...

This fixes the issue with the custom folder name not working properly, in case you decide to use folder names instead of disc folders:
Spoiler: ShowHide
#==============================================================================
# ** Disc Changer script (Designed for Legend of Harpine)
#------------------------------------------------------------------------------
# Zeriab
# 1.05
# 2008-09-20
#------------------------------------------------------------------------------
# Allows you to change the disc, where each disc can contain 999 maps
#==============================================================================
=begin
INSTRUCTIONS
------------
If you do not have the SDK then you have to change Game_Map
In the Game_Map setup method change the load_data line to this: (Line 50)

  # Load map from file and set @map
  @map = load_data(sprintf("Data/%sMap%03d.rxdata", $game_system.disc, @map_id))

After you have done this the below will work.

This script enables the change_disc command. Use script calls to change the disc.
For disc 1 create a subfolder in your data folder called 'disc1' and place the
map files for disc 1 in there.
For disc 2 you should create a subfolder called 'disc2' and place the map files
for disc 2 in there. And so on for each of your discs.
The syntax is:

  change_disc(number, id = nil, x = nil, y = nil, direction = nil)

The nil numbers mean that those arguments are optional. When you don't use them
then they are set to whatever the current map_id, x, y and direction are at the
moment.

If you want to change to disc 2 then you can put this in a script call:

  change_disc(2)
 
You will then be transfered to disc 2 with the same map id and coordinates as
what the player currently has.
If you want to be more precise and say you want to change to disc 2 on the map
with id 10 and the player must be placed at the tile with x = 6 and y = 13 then
you should put this in a call script:

  change_disc(2, 10, 6, 13)
 
Note that when you start the game the maps directly in the data folder is used.
You can back to them by changing to disc number 0.
Basically, disc number 0 is the maps directly in the data folder and not in any
of the sub folders.

The final argument is the direction. By default the player retains the current
direction. You can put 6 different values as direction:

0, 10 : No change
2     : Turn Down
4     : Turn Left
6     : Turn Right
8     : Turn Up

If you for example want to transfer the player to disc 1, map 43 at x = 30 and
y = 4 with the player looking down you should put this in a call script:

  change_disc(1, 43, 30, 4, 2)
 
*hugs*
- Zeriab
=end

class Game_System
  attr_writer :disc
  def disc
    @disc ||= ''
    @disc
  end
end

class Game_Temp
  attr_accessor :disc_changing
end

class Game_Map
  attr_writer :map_id
  if Module.constants.include?('SDK')
    def setup_load
      # Load map from file and set @map
      @map = load_data(sprintf("Data/%sMap%03d.rxdata", $game_system.disc, @map_id))
    end
  end
end

def change_disc(number, id = nil, x = nil, y = nil, direction = nil)
  # Change disc
  if number == 0
    $game_system.disc = "/"
  elsif number.is_a?(Integer)
    $game_system.disc = "disc#{number}/"
  else
    disc = '/'
    disc += number.to_s unless disc[-1] = 47
    $game_system.disc = disc
  end
  # Process arguments
  map_id = id.is_a?(Integer) ? id : $game_map.map_id
  x = $game_player.x unless x.is_a?(Integer)
  y = $game_player.y unless y.is_a?(Integer)
  direction = $game_player.direction unless direction.is_a?(Integer)
  # Set transferring player flag
  $game_temp.player_transferring = true
  # Set transferring player flag
  $game_temp.disc_changing = true
  # Set player move destination
  $game_temp.player_new_map_id = map_id
  $game_temp.player_new_x = x
  $game_temp.player_new_y = y
  $game_temp.player_new_direction = direction
  # Change the current map id in case the new and old are identical.
  $game_map.map_id = 0
end

24
As I suspected, it looks like there isn't any code that actually handles what happens when you change to Disk 0, I just tested it in a demo.

I'm not entirely sure if the SDK changes anything, since I didn't use the SDK, just made the Game_Map edit. Adding a condition that handles what happens when the map is set to "0" seemed to work.

Try replacing your script with this and see how it goes:
Quote
#==============================================================================
# ** Disc Changer script (Designed for Legend of Harpine)
#------------------------------------------------------------------------------
# Zeriab
# 1.05
# 2008-09-20
#------------------------------------------------------------------------------
# Allows you to change the disc, where each disc can contain 999 maps
#==============================================================================
=begin
INSTRUCTIONS
------------
If you do not have the SDK then you have to change Game_Map
In the Game_Map setup method change the load_data line to this: (Line 50)

  # Load map from file and set @map
  @map = load_data(sprintf("Data/%sMap%03d.rxdata", $game_system.disc, @map_id))

After you have done this the below will work.

This script enables the change_disc command. Use script calls to change the disc.
For disc 1 create a subfolder in your data folder called 'disc1' and place the
map files for disc 1 in there.
For disc 2 you should create a subfolder called 'disc2' and place the map files
for disc 2 in there. And so on for each of your discs.
The syntax is:

  change_disc(number, id = nil, x = nil, y = nil, direction = nil)

The nil numbers mean that those arguments are optional. When you don't use them
then they are set to whatever the current map_id, x, y and direction are at the
moment.

If you want to change to disc 2 then you can put this in a script call:

  change_disc(2)
 
You will then be transfered to disc 2 with the same map id and coordinates as
what the player currently has.
If you want to be more precise and say you want to change to disc 2 on the map
with id 10 and the player must be placed at the tile with x = 6 and y = 13 then
you should put this in a call script:

  change_disc(2, 10, 6, 13)
 
Note that when you start the game the maps directly in the data folder is used.
You can back to them by changing to disc number 0.
Basically, disc number 0 is the maps directly in the data folder and not in any
of the sub folders.

The final argument is the direction. By default the player retains the current
direction. You can put 6 different values as direction:

0, 10 : No change
2     : Turn Down
4     : Turn Left
6     : Turn Right
8     : Turn Up

If you for example want to transfer the player to disc 1, map 43 at x = 30 and
y = 4 with the player looking down you should put this in a call script:

  change_disc(1, 43, 30, 4, 2)
 
*hugs*
- Zeriab
=end

class Game_System
  attr_writer :disc
  def disc
    @disc ||= ''
    @disc
  end
end

class Game_Temp
  attr_accessor :disc_changing
end

class Game_Map
  attr_writer :map_id
  if Module.constants.include?('SDK')
    def setup_load
      # Load map from file and set @map
      @map = load_data(sprintf("Data/%sMap%03d.rxdata", $game_system.disc, @map_id))
    end
  end
end

def change_disc(number, id = nil, x = nil, y = nil, direction = nil)
  # Change disc
  if number == 0
    $game_system.disc = "/"
  elsif number.is_a?(Integer)
    $game_system.disc = "disc#{number}/"
  else
    disc = number.to_s
    disc += '/' unless disc[-1] = 47
    $game_system.disc = disc
  end
  # Process arguments
  map_id = id.is_a?(Integer) ? id : $game_map.map_id
  x = $game_player.x unless x.is_a?(Integer)
  y = $game_player.y unless y.is_a?(Integer)
  direction = $game_player.direction unless direction.is_a?(Integer)
  # Set transferring player flag
  $game_temp.player_transferring = true
  # Set transferring player flag
  $game_temp.disc_changing = true
  # Set player move destination
  $game_temp.player_new_map_id = map_id
  $game_temp.player_new_x = x
  $game_temp.player_new_y = y
  $game_temp.player_new_direction = direction
  # Change the current map id in case the new and old are identical.
  $game_map.map_id = 0
end


It looks like using a folder with a regular name is bugged, so I'll take a look at that, too, when I get a moment.
25
It looks like you are not using the arguments correctly. The "id =", etc. are only in the directions to show you what each argument means.

Your script call should look like this:
change_disc(0, 3, 10, 14)

26
That helps a lot actually, thanks. That makes understanding the flow of things a little easier.

I'll have to re-evaluate how the phase system is being used, as I had a really hard time interpreting that too. There are two versions of this ATB script, one that's a bit updated (but not compatible with my base system) that I've been referring to for some logic changes/better comments, and I noticed that exact snippet of phase update code is in that one, too.

27
So I've come across what I believe to be the biggest logic disaster in this thing and that's with the main frame update.

I have two frame updates here, one that is aliased within the ATB script, and one that is utilized by my battle system (it's actually the RMXP default)

What jumped out at me is the ATB alias calls the original method in the middle of the script. How exactly does that work? Does it run the original method, then return back to the aliased method?

If that's the case, I see some conflicts with the phase processing, because if the update_phase# is called by the main update method before the aliased one, then the aliased one will not continue, correct?

Any thoughts on how I would restructure this to be compatible? Would I just call the original method at the end of the aliased one?

Main frame update:
Spoiler: ShowHide
 #---------------------------------------------------------------------------
  # * Main battle frame update
  #---------------------------------------------------------------------------
  def update
  # If battle event is running
    if $game_system.battle_interpreter.running?
      # Update interpreter
      $game_system.battle_interpreter.update
      # If a battler which is forcing actions doesn't exist
      if $game_temp.forcing_battler == nil
        # If battle event has finished running
        unless $game_system.battle_interpreter.running?
          # Rerun battle event set up if battle continues
          unless judge
            setup_battle_event
          end
        end
        # If not after battle phase
        if @phase != 5
          # Refresh status window
          @status_window.refresh
        end
      end
    end
    # Update system (timer) and screen
    $game_system.update
    $game_screen.update
    # If timer has reached 0
    if $game_system.timer_working and $game_system.timer == 0
      # Abort battle
      $game_temp.battle_abort = true
    end
    # Update windows
    @help_window.update
    @party_command_window.update
    @actor_command_window.update
    @active_battler_window.update
    @status_window.update
    @message_window.update
    # Update sprite set
    @spriteset.update
    # If transition is processing
    if $game_temp.transition_processing
      # Clear transition processing flag
      $game_temp.transition_processing = false
      # Execute transition
      if $game_temp.transition_name == ""
        Graphics.transition(20)
      else
        Graphics.transition(40, "Graphics/Transitions/" +
          $game_temp.transition_name)
      end
    end
    # If message window is showing
    if $game_temp.message_window_showing
      return
    end
    # If effect is showing
    if @spriteset.effect?
      return
    end
    # If game over
    if $game_temp.gameover
      # Switch to game over screen
      $scene = Scene_Gameover.new
      return
    end
    # If returning to title screen
    if $game_temp.to_title
      # Switch to title screen
      $scene = Scene_Title.new
      return
    end
    # If battle is aborted
    if $game_temp.battle_abort
      # Return to BGM used before battle started
      $game_system.bgm_play($game_temp.map_bgm)
      # Battle ends
      battle_end(1)
      return
    end
    # If waiting
    if @wait_count > 0
      # Decrease wait count
      @wait_count -= 1
      return
    end
    # If battler forcing an action doesn't exist,
    # and battle event is running
    if $game_temp.forcing_battler == nil and
       $game_system.battle_interpreter.running?
      return
    end
    # Branch according to phase
    case @phase
    when 1  # pre-battle phase
      update_phase1
    when 2  # party command phase
      update_phase2
    when 3  # actor command phase
      update_phase3
    when 4  # main phase
      update_phase4
    when 5  # after battle phase
      update_phase5
    end
  end


Aliased one:
Spoiler: ShowHide
Quote#--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  alias acbs_update_atb update
  def update
    #Update the battle phases
   if @phase == 1
      $game_temp.battle_main_phase = true
      @actor_command_window.opacity = 0
      @phase = 0
    elsif @phase != 5
      @phase = 0
    end
   #Check if an event is running
    @event_running = true if $game_system.battle_interpreter.running?
   
   #Check for game over
   return $scene = Scene_Gameover.new if $game_temp.gameover
   
   #Call the original method
   acbs_update_atb
   
   #...Check if an event is running again??
   if $game_system.battle_interpreter.running?
      return
    elsif @event_running
      @status_window.refresh
      @event_running = false
    end
   
   #Check if we're on the post-battle phase
   return update_phase5 if @phase == 5
   
   #??????EVENT RUNNING????????
   @event_running = true if $game_system.battle_interpreter.running?
    if @update_turn_end
      turn_ending
      @update_turn_end = false
    end
   
    #Update escape
   if Input.press?(Escape_Input) and @escape_type > 0
      if $game_temp.battle_can_escape
        $game_temp.max_escape_count = update_phase2_escape_rate
        $game_temp.escape_count += 2 unless @wait_on
        @escaping = true
        if !@help_window.visible and @escape_type == 1
          @help_window.set_text('')
          @help_window.set_text(Escape_Message, 1)
        end
        if @escape_type == 2
          if @escape_atb_meters.nil?
            @escape_atb_meters = Escape_Meters.new
            @escape_meter_opacity = 0
            @escape_atb_meters.visible = true
          else @escape_atb_meters != nil
            @escape_atb_meters.opacity = 15 * @escape_meter_opacity
            @escape_meter_opacity = [@escape_meter_opacity + 1, 17].min
            @escape_atb_meters.refresh
          end
        end
        if $game_temp.escape_count >= $game_temp.max_escape_count
          $game_temp.escape_count = 0
          update_phase2_escape unless $game_party.all_dead?
        end
      else
        @help_window.set_text(Cant_Escape_Message, 1) if @escape_type == 1       
        if @escape_type == 2       
          if @escape_atb_meters.nil?
            @escape_atb_meters = Escape_Meters.new
            @escape_meter_opacity = 0
            @escape_atb_meters.visible = true
          else @escape_atb_meters != nil
            @escape_atb_meters.opacity = 15 * @escape_meter_opacity
            @escape_meter_opacity = [@escape_meter_opacity + 1, 17].min
            @escape_atb_meters.refresh
          end
        end
      end
    elsif @escape_type > 0
      if @escaping
        @escaping = false
        @help_window.visible = false
      end
      $game_temp.escape_count = [$game_temp.escape_count - 1, 0].max unless @wait_on
      if @escape_atb_meters != nil and $game_temp.escape_count == 0
        @escape_atb_meters.opacity = 15 * @escape_meter_opacity
        @escape_meter_opacity = [@escape_meter_opacity - 1, 0].max
        if @escape_meter_opacity == 0
          @escape_atb_meters.dispose
          @escape_atb_meters = nil
        end
      end
      @escape_atb_meters.refresh if @escape_atb_meters != nil
    end
    #Exit method if escape was successful
   return if @escaped
   
   #Perform the basic ATB update
   atb_update
   
   #Update the battler input
    input_battler_update(false)
    if @action_battlers[0] != nil && @action_battler.nil?
      @action_battlers.flatten!
      @action_battler = @action_battlers[0]
      if @action_battler.dead?
        @action_battler.atb = 0
        @action_battler = nil
      else
        start_phase4
      end
    end
   
   #Update the action battler
    if @action_battler != nil && !@spriteset.effect?
      @active_battler = @action_battler
      update_phase4
    end
   
  end


Also, this aliased one looks like it's checking the interpreter like 10 times, can't quite understand why.

This is in reference the demo in my OP, if more context is needed.
28
QuoteI tried setting line 1117 (@status_window.visible = true) to false, thinking that was just a mistake

I did the same thing, which is why I was confused.  Assuming it was just for cleaning up, I added those windows to it, but I got a disposed windows error. Reviewing windows_dispose, it looks like it disposes...some windows...sometimes? This is the battle I'm currently having with this system, since everything is just all over the place.

Those two lines did resolve the problem, so that's one less problem. For now.

Now to figure out why making the @help_window visible on the escape attempt phase forces my actor to attack instead! :D :facepalm:
29
Quote from: lilbrudder917 on November 14, 2017, 10:26:52 pm
Wow, it's been a while since I've stopped lurking and actually made a post.

In "SBSXP BATTLE 1" you need to uncomment lines 139 and 143. The comments are preventing
@status_window.dispose

and
@result_window.dispose if @result_window != nil
from running, which keeps them from being disposed.


Bless you for even looking at this disaster. Thank you.

I didn't realize those were commented out, I think I thought it was already present in the windows_dispose method. It's definitely a step in the right direction.
30
Script Troubleshooting / Re: [RMXP] Changing Enemy HP
November 14, 2017, 10:36:43 pm
I definitely suggest using that or another script, this is pretty bad and will cause you a lot of grief and hours in the future.

But, if you are adamant, then yeah, the first problem is you're setting the HP equal to the MaxHP, then changing MaxHP, which will do nothing.
Then, you're setting the HP before the MaxHP, which means there's no maximum value to hold what you're trying to add to it. You'll need to set the MaxHP first, then the HP.
31
Script Troubleshooting / Re: [RMXP] Changing Enemy HP
November 14, 2017, 09:07:42 pm
Can you provide a screenshot of the event page? Still sounds good, but I need to see if the eventing makes sense.
32
...I don't think I can use RPG Maker anymore.

...The status menu was not opaque because I was using a battleback that was not 640x480...

If anyone would like to help me figure out why the window dispose isn't working correctly after battle though, that would be helpful.
33
Script Troubleshooting / Re: [RMXP] Changing Enemy HP
November 14, 2017, 08:54:06 pm
Context would still be helpful. Even a screenshot of the event page.

I'm curious why you are using a script call for this in the first place. Are you calling this during an evented battle? If so, there is a "Change Enemy HP" event that works just as well. It's possible something else could be causing the problem.

Also, "==" is only for checking whether or not something is equal, such as in a conditional statement. You would use "=" to assign the HP to the MAXHP or visa versa.


34
Script Troubleshooting / Re: [RMXP] Changing Enemy HP
November 14, 2017, 08:21:01 pm
Do you have a little more context as to what you're doing? That line by itself seems fine to me, but we probably need to see the whole thing in the context of a script so we can better understand why it isn't working for you.
35
Script Troubleshooting / [RMXP] Battlebacks
November 14, 2017, 08:05:56 pm
All set on this now, but I'll leave it for future reference so someone else doesn't do what I did.

RPG Maker XP default battlebacks are not 640x480. If you use them with a transparent window, you won't notice the transparency! Took me hours to figure that one out, derp.




36
Script Requests / Re: Sprite Opacity "Glow"
November 13, 2017, 11:26:28 pm
A gif of the beauty:
https://i.imgur.com/GrdOZ6A.gifv
You guys rock. Thanks for all the help.
37
Script Requests / Re: Sprite Opacity "Glow"
November 13, 2017, 11:20:52 pm
Oh, man, that was 100% it! I knew there was something that was being ignored, the instance variable solved it. Something so simple, too.

It looks killer. I did have to reduce the opacity step a bit to change the speed, but it works.
38
Script Requests / Re: Sprite Opacity "Glow"
November 13, 2017, 08:42:05 pm
"Sound logic" is a good hint that there's probably something conflicting. I'm using Heretic's map title as a base, the full script is here: https://pastebin.com/nVPVRSrj

Weird, it's working now. The sprites overlay properly. I deleted everything I did and started over. Now the "fade" effect isn't working. Heck.

I'm guessing it may be because I'm changing the bitmap every selection, which is automatically setting the opacity to 255? I'm not sure how to properly implement it.

I have this in the update method for my menu:
    # Draw the title pictures
    case @command_window.index
    when 0 #Draw "new game"
       @com.bitmap = RPG::Cache.title("Com_01")
   @com_glow.bitmap = RPG::Cache.title("Com_01_G")
   #Call glowing method
   glowing_selection
    when 1 #Draw "continue"
    # Check if continue is disabled
   unless @continue_enabled
#Draw faded out
@com.bitmap = RPG::Cache.title("Com_02_Disable")
   else
# Draw regular
@com.bitmap = RPG::Cache.title("Com_02")
@com_glow.bitmap = RPG::Cache.title("Com_02_G")
#Call glowing method
glowing_selection
   end
    when 2 #Draw "end"
       @com.bitmap = RPG::Cache.title("Com_03")
       @com_glow.bitmap = RPG::Cache.title("Com_03_G")
   #Call glowing method
   glowing_selection
when 3 #Draw "credits"
   @com.bitmap = RPG::Cache.title("Com_04")
   @com_glow.bitmap = RPG::Cache.title("Com_04_G")
   #Call glowing method
   glowing_selection
    end


With a special method that makes the "glowing" portion of the sprite glow:
  #Method for glowing selection
  def glowing_selection
#Fade it in and out
#Check the direction variable exists
if @com_glow.opacity == 255
com_opacity_direction = -1
elsif @com_glow.opacity == 0 || com_opacity_direction == nil
com_opacity_direction = 1
end
#Fade the sprite in and out
@com_glow.opacity += (com_opacity_direction * 15)
  end


39
Script Requests / Re: Sprite Opacity "Glow"
November 13, 2017, 07:49:50 pm
WEW okay, I finally got to this.

My first question is, it seems like drawing two sprites on top of each other is a disaster. Even though the second sprite has transparency, it "erases" the sprite behind it. I assume I'm simply doing this incorrectly. I have a different Z order set for both of them, but no avail.

Is there more to drawing multiple layers of sprites than just:
sprite1 = Sprite.new
sprite2 = Sprite.new
sprite1.bitmap = [file1]
sprite2.bitmap = [file2]


Because this is what I currently have, in essence. I'm not sure if this is the problem, or changing the bitmap every frame in the update method is the problem, which is what I am currently doing to deal with having a different bitmap for each menu selection.
40
Update: While the slight stuttering is present in VXA and XPA, the massive lag spikes I was getting in my own game were unrelated. Turns out it was an outdated version of Ryex's dynamic sound? Weird!

I do still get those slight stutters, but I had some folks reporting they don't get them. I need to test on some other machines to see if it's a problem with my computer, at this point.