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

1
Sorry, I'm the only one who can script around these parts anymore, and I've never accepted battle system requests. Good luck finding anyone who still scripts in XP.
2
Events and Pictures do not reside on the same Viewport. In Spriteset_Map:
    # Make viewports
    @viewport1 = Viewport.new(0, 0, 640, 480)
    @viewport2 = Viewport.new(0, 0, 640, 480)
    @viewport3 = Viewport.new(0, 0, 640, 480)
    @viewport2.z = 200
    @viewport3.z = 5000
...
    # Make character sprites
    @character_sprites = []
    for i in $game_map.events.keys.sort
      sprite = Sprite_Character.new(@viewport1, $game_map.events[i])
      @character_sprites.push(sprite)
    end
    @character_sprites.push(Sprite_Character.new(@viewport1, $game_player))
    # Make weather
    @weather = RPG::Weather.new(@viewport1)
    # Make picture sprites
    @picture_sprites = []
    for i in 1..50
      @picture_sprites.push(Sprite_Picture.new(@viewport2,
        $game_screen.pictures[i]))
    end
Try making Sprite_Pictures instantiate on @viewport1.
3
RMXP Script Database / Re: [XP] Continuous Maps
September 12, 2024, 01:41:12 am
Resolution is not the issue, it's the fact that XPA completely rewrites how maps are rendered and updated, which is what Continuous Maps does too. Neither Blizz nor I are going to make a compatible fix for this.
4
It will require an edit to whatever script you're trying to use. There's no easy way to make this 100% compatible with everything out there.
5
RMXP Script Database / Re: [XP] Tons of Add-ons
September 04, 2024, 06:58:34 pm
Another bug fix for Multi-Hit (replace Scene_Battle within the script):
Code: ruby
class Scene_Battle

  def rand_hits(value)
    return value if value.is_a?(Integer)
    return (rand(value.max - value.min + 1) + value.min)
  end

  def repeating_action?
    return (@repeat[1] - @repeat[0] > 0)
  end

  alias update_phase4_step1_multi_hit_later update_phase4_step1
  def update_phase4_step1(battler = nil)
    if battler != nil
      update_phase4_step1_multi_hit_later(battler)
      return
    end
    update_phase4_step1_multi_hit_later
    @repeat = [1, 1, 0]
    return if @active_battler == nil || !$game_system.MULTI_HIT
    if @active_battler.current_action.kind == 0
      if @active_battler.current_action.basic == 0
        if @active_battler.is_a?(Game_Actor)
          hits = rand_hits(BlizzCFG.weapon_hits(@active_battler.weapon_id))
        elsif @active_battler.is_a?(Game_Enemy)
          hits = rand_hits(BlizzCFG.enemy_hits(@active_battler.id))
        end
        @repeat = [hits, hits, 2]
      end
    elsif @active_battler.current_action.kind == 1
      @repeat[2] = 3
    elsif @active_battler.current_action.kind == 2
      @repeat[2] = 4
    end
  end
 
  alias update_phase4_step2_multi_hit_later update_phase4_step2
  def update_phase4_step2(battler = nil)
    if battler != nil
      update_phase4_step2_multi_hit_later(battler)
      return
    end
    update_phase4_step2_multi_hit_later
    return if !$game_system.MULTI_HIT
    if @phase4_step != 1
      if @repeat[2] == 3
        hits = rand_hits(BlizzCFG.skill_hits(@skill.id))
        @repeat = [hits, hits, 5]
      elsif @repeat[2] == 4
        hits = rand_hits(BlizzCFG.item_hits(@item.id))
        @repeat = [hits, hits, 5]
      end
    end
    if repeating_action?
      unless BlizzCFG::SHOW_ANIMATION_PER_HIT
        @animation1_id = 0
        @animation2_id = 0
      end
      @help_window.visible = false
    end
  end
 
  alias update_phase4_step3_multi_hit_later update_phase4_step3
  def update_phase4_step3
    update_phase4_step3_multi_hit_later
    @active_battler.white_flash = false if repeating_action?
  end
 
  alias update_phase4_step4_multi_hit_later update_phase4_step4
  def update_phase4_step4
    update_phase4_step4_multi_hit_later
    @wait_count = 0 if repeating_action? && !BlizzCFG::SHOW_ANIMATION_PER_HIT
  end
 
  alias update_phase4_step5_multi_hit_later update_phase4_step5
  def update_phase4_step5(battler = nil)
    if battler != nil
      update_phase4_step5_multi_hit_later(battler)
      return
    end
    update_phase4_step5_multi_hit_later
    return if !$game_system.MULTI_HIT
    if @active_battler.current_action.kind == 1
      if BlizzCFG::SKILL_RANDOM.include?(@skill.id)
        if @active_battler.is_a?(Game_Actor)
          @active_battler.current_action.decide_random_target_for_actor
        elsif @active_battler.is_a?(Game_Enemy)
          @active_battler.current_action.decide_random_target_for_enemy
        end
      else
        if @active_battler.is_a?(Game_Actor)
          @active_battler.current_action.decide_last_target_for_actor
        elsif @active_battler.is_a?(Game_Enemy)
          @active_battler.current_action.decide_last_target_for_enemy
        end
      end
    elsif @active_battler.current_action.kind == 2
      if BlizzCFG::ITEM_RANDOM.include?(@item.id)
        if @active_battler.is_a?(Game_Actor)
          @active_battler.current_action.decide_random_target_for_actor
        elsif @active_battler.is_a?(Game_Enemy)
          @active_battler.current_action.decide_random_target_for_enemy
        end
      else
        if @active_battler.is_a?(Game_Actor)
          @active_battler.current_action.decide_last_target_for_actor
        elsif @active_battler.is_a?(Game_Enemy)
          @active_battler.current_action.decide_last_target_for_enemy
        end
      end
    elsif @active_battler.is_a?(Game_Actor)
      if BlizzCFG::WEAPON_RANDOM.include?(@active_battler.weapon_id)
        @active_battler.current_action.decide_random_target_for_actor
      else
        @active_battler.current_action.decide_last_target_for_actor
      end
    elsif @active_battler.is_a?(Game_Enemy)
      if BlizzCFG::ENEMY_RANDOM.include?(@active_battler.id)
        @active_battler.current_action.decide_random_target_for_enemy
      else
        @active_battler.current_action.decide_last_target_for_enemy
      end
    end
    @phase4_step = 2 if @repeat[0] > 1 && @repeat[2] > 0
    @repeat[0] -= 1
  end
 
  alias make_skill_action_result_multi_hit_later make_skill_action_result
  def make_skill_action_result(battler = nil, plus_id = nil)
    if battler != nil
      if plus_id != nil
        make_skill_action_result_multi_hit_later(battler, plus_id)
      else
        make_skill_action_result_multi_hit_later(battler)
      end
      return
    end
    if @repeat[2] == 5
      sp_cost = @skill.sp_cost
      if $game_system.SP_COST_MOD
        sp_cost = BlizzCFG.get_cost_mod(@active_battler.states, sp_cost)
      end
      @active_battler.sp += sp_cost
      @status_window.refresh
    end
    make_skill_action_result_multi_hit_later
  end
 
  alias make_item_action_result_multi_hit_later make_item_action_result
  def make_item_action_result
    if @repeat[2] == 5
      $game_party.gain_item(@item.id, 1)
      @status_window.refresh
    end
    make_item_action_result_multi_hit_later
  end
 
  # Compatibility fix for LockeZ Sacrifice HP
  if method_defined?(:sacrifice_hp)
    alias sacrifice_hp_if_not_repeating sacrifice_hp
    def sacrifice_hp(battler, action)
      sacrifice_hp_if_not_repeating(battler, action) unless @repeat[2] == 5
    end
  end
 
end
It addresses MP cost issues and consuming items multiple times.
Original thread: https://forums.rpgmakerweb.com/index.php?threads/xp-tons-of-add-ons-multi-hit-bug.171550/
6
Oh hey, welcome back, been quite a while since I last saw you.

Thanks for catching that bug. Turns out I forgot to get the skill and item IDs. I've updated the script, as well as provided a new script call (you can still use the old way, but this is much cleaner to use).
7
RMXP Script Database / Re: [XP] Design a HUD
August 13, 2024, 11:38:11 pm
I added a new variable to the config called HUD_TOGGLE_SWITCH_ID. Just set that to whatever switch ID you want to use to toggle its visibility on/off.
https://pastebin.com/h1h0cRtV (because the script breaks character limit)
9
RMXP Script Database / Re: [XP] Custom Resolution
August 08, 2024, 02:27:21 am
Quote from: thalesgal on August 07, 2024, 09:49:40 amPlease, I would like to resize the screen but just stretch it. I saw that this script resize the game but my game was entirely made 640x480. So I just want to resize just like ALT+ ENTER does. Just stretch it.
From what I remember, XP's game window doesn't actually stretch when you increase its width or height, unlike VXA. It instead just displays a black void beyond the 640x480 default. Fullscreen stretches because it's effectively changing your monitor's resolution to 640x480. So you're not really going to achieve what you want with the default engine.

You'll need to either use VXA's game executable (points at XPAce in signature) or use something like MKXP(-z)
11
The method itself isn't particularly difficult to create. It simply just replaces every pixel's color for the source bitmap with the passed in RGB color, while still respecting the Alpha channel's value.

It's been a while since I've worked with C++ and DLLs though, so here's what Copilot came up using RotateBitmap as a reference (I fixed obvious mistakes generated by the result). Untested of course.
Code: cpp
DLL_EXPORT int fill_color(long srcObject, float* color) {
// obtain the RGSS bitmap data
RGSSBMINFO* srcBitmap = ((RGSSBITMAP*)(srcObject << 1))->bm->bminfo;
if (srcBitmap == NULL)
{
return 1;
}
// used variables
int srcWidth = srcBitmap->infoheader->biWidth;
int srcHeight = srcBitmap->infoheader->biHeight;
// pointers to bitmap data, going from the first row, but the rows are in reverse order
unsigned char* srcData = (unsigned char*)srcBitmap->firstRow;
unsigned char* src = NULL;
// Local Variables used to determine positions during rotation
int x = 0;
int y = 0;
// Iterate each Row in the Height of the Bitmap
for (y = 0; y < srcHeight; ++y)
{
// Iterate each Pixel in the Row of the Bitmap
for (x = 0; x < srcWidth; ++x)
{
// access bitmaps' pixel data from the coordinates
// x - y * destWidth, because the x is the offset in the row,
// but since the rows are reverse, it's "- y * destWidth"
src = &srcData[(x - y * srcWidth) * BPP];
src[2] = (unsigned char)(color[0]);
src[1] = (unsigned char)(color[1]);
src[0] = (unsigned char)(color[2]);
}
}
// Color fill is successful
return 0;
}
12
RMXP Script Database / Re: [XP] Tons of Add-ons
July 31, 2024, 02:19:49 am
So it would seem that the absorb script does not call upon the aliased phase4_step5 methods before it:
Code: ruby
  alias update_phase4_step5_hpsp_absorb_later update_phase4_step5
  def update_phase4_step5(battler = nil)
    if $game_system.ABSORB_HP_SP
      @status_window.refresh
      @help_window.visible, damages = false, 0
      @target_battlers.each {|target|
          if target.damage != nil
            target.damage_pop = true
            damages += target.damage if target.damage.is_a?(Numeric)
          end}
      if check_absorb(@active_battler, @active_battler.current_action.skill_id,
          damages)
        @status_window.refresh
      end
      @skill, @phase4_step = nil, 6
    elsif battler == nil
      update_phase4_step5_hpsp_absorb_later
    else
      update_phase4_step5_hpsp_absorb_later(battler)
    end
  end
In this snip above, we satisfy the first conditional if $game_system.ABSORB_HP_SP because we turned it on. We execute all the code after it up until elsif battler == nil. Nowhere in between do we ever call upon the alias update_phase4_step5_hpsp_absorb_later, which is necessary since the Multi-Hit script modifies the method update_phase4_step5 as well.

What you can try doing is making the edit here:
Code: ruby
      @skill, @phase4_step = nil, 6
      update_phase4_step5_hpsp_absorb_later(battler) # <=====
    elsif battler == nil
That seemed to work fine with Multi-Hit, but I didn't test it with any of the other scripts in Tons.
13
Script Requests / Re: [XP] - Animated Panorama?
July 19, 2024, 03:29:57 pm
Can you be more specific? The script calls to change the panorama sx and sy ARE your speed variables.
14
Last post 2011.

And in case you haven't noticed, these forums are dead.
15
RMXP Script Database / Re: [XP] Tons of Add-ons
July 10, 2024, 06:47:13 pm
You're talking about this?
#   WEAPON_RANDOM - add any weapon IDs here and separate them with commas to
#                   make those specific weapons attack another random target
#                   for each other hit than the first
#   SKILL_RANDOM  - add any skill IDs here and separate them with commas to
#                   make those specific skills attack another random target
#                   for each other hit than the first
#   ITEM_RANDOM   - add any item IDs here and separate them with commas to
#                   make those specific items attack another random target
#                   for each other hit than the first
#   ENEMY_RANDOM  - add any enemy IDs here and separate them with commas to
#                   make those specific enemies attack another random target
#                   for each other hit than the first
That's if you want attacks to randomly hit a different target. If you want all the attacks to hit the same target, you don't put anything in those arrays.

I also believe you're referring to this post regarding multi-hit, but that's actually a completely different script. Wraith was using "DerVVulfman Multi-Strike", not Multi-Hit in Tons of Add-ons.

With that said, I don't think I've ever tried using multi-hit and absorb together, but knowing Blizz I can't imagine them being incompatible.
16
If you look in the map "Item Shop" and open up the Grass Seeds event, locate the script call that says:
$game_player.gold-=$game_variables
[1]*500
The problem is that the [1] is on a new line. It needs to be placed next to $game_variables. You can thank the criminally small text box size for causing that blunder.

So the fix is to simply do this
$game_player.gold-=
$game_variables[1]*500
17
Jaiden forgot to add the LOCK_PANORAMA_IDS constant to the script. You can just add it here in the script (and configure it accordingly):
module CustomFogsPanorama
    #--------------------------------------------------------------------------
    # * Constants (Please do not modify)
    #--------------------------------------------------------------------------
    NORMAL = 0
    ADD = 1
    SUB = 2
    #--------------------------------------------------------------------------
   
    # List of map IDs, or put [] if you do not want to use this feature
    LOCK_PANORAMA_IDS = [1, 2, 3]
18
This is for RMXP. I don't know what inspired you to post that since the last comment was over a year ago.
20
RMMZ Script Database / Re: [MZ][MV] Ultra Mode 7
May 06, 2024, 03:28:23 pm
Might want to contact Blizz directly. He doesn't frequent any of the RM forums often. Could try looking through this thread if the question has already been asked.

https://forums.rpgmakerweb.com/index.php?threads/ultra-mode-7-rmmv-rmmz.94100/

EDIT: oh I see you already posted there