KagggZu

Villager
Member
Joined
Sep 18, 2021
Messages
9
Reaction score
0
First Language
English
Primarily Uses
RMVXA
Hi everyone! I'm using the BM Advanced VK Equip script to have an image (character's appearance) on the equip screen change as they have new equipment.

My problem is that the change happens only after reopening the menu. I used a common event to check if an item was equipped. If it was, then it would change text in the actor's class note tag for the "image change" to happen.

I'm not knowledgeable enough in coding to figure out how to add this. I do know that within the script, there is a "paper doll mode" to overlap pictures on top of the character's image. That feature doesn't quite do what I want, but it's able to refresh the screen after changing equipment while still being at the equip screen. Maybe if that could be retrofitted into all equipment rather than only in the "paper doll mode", that could fix my issue.

The example project features everything I mentioned with the "paper doll mode" being too jank for me to use with what I have in mind.

Script:

Example project:
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
45,490
Reaction score
16,403
First Language
English
Primarily Uses
RMMV

I've moved this thread to RGSSx Script Support. Thank you.

 

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
4,671
Reaction score
1,322
First Language
English
Primarily Uses
RMVXA
My problem is that the change happens only after reopening the menu. I used a common event to check if an item was equipped. If it was, then it would change text in the actor's class note tag for the "image change" to happen.
I don't understand.
You had the tag placed on the one piece of armour but not the other. That's the only reason it did not change when equipping.

If you want something else other than paperdoll mode you need to explain better. Because it sounds like you want paperdoll mode. Since it does what you stated you want.
have an image (character's appearance) on the equip screen change as they have new equipment.
 

KagggZu

Villager
Member
Joined
Sep 18, 2021
Messages
9
Reaction score
0
First Language
English
Primarily Uses
RMVXA
The note tags in "Armors" ONLY allow for the paper doll mode to work. When equipping the "Red Dress" armor, it overlaps the existing image, but the image behind is still visible. That's not what I want to happen.

With the "Pink Dress" armor, I created a common event to forcefully change the note tag in "Classes". This checks if the armor is equipped and allows the character's image to change, but it only changes after:

Equipping the "Pink Dress" > Closing the menu fully (going back into the overworld) > Opening back the menu into "Equipment"

You'll see that Anna's preview image changes from the default school uniform to that of the "Pink Dress". This is half of what I want to happen.

In a sense, yes I do want the function of paper doll mode (images to change on equip), but only using paper doll mode doesn't work how I want it to. The 1st section in this reply being one problem and the 2nd being there would be no picture/art in the preview if I had no default image beforehand to load (having no armor equipped would have the preview picture be blank).

I think the solution here would be to have the function after equipping armors from the paper doll mode be implemented into equipping any armors, but my coding expertise isn't good enough to figure it out.
 

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
4,671
Reaction score
1,322
First Language
English
Primarily Uses
RMVXA
Got it.
Ruby:
class Window_EquipActor < Window_Base
  def draw_all_items
    return unless @actor
    draw_actor_name(@actor,0,0)
    draw_mini_face
    @equip_image = false
    if BM::EQUIP::PAPER_DOLL_MODE
      item_max.times {|i| draw_item2(i) } 
    else
      item_max.times {|i| draw_item(i) }
    end
    draw_equip_dummy(0, 0) if @equip_image == false
  end
  def draw_pd_equip_image(item, x, y)
    return unless item
    return if item.eb_image.nil?
    bitmap = Cache.equip_body(item.eb_image)
    rect = Rect.new(0, 0, bitmap.width, bitmap.height)
    contents.blt(x, y, bitmap, rect)
    @equip_image = true
  end
end
 

KagggZu

Villager
Member
Joined
Sep 18, 2021
Messages
9
Reaction score
0
First Language
English
Primarily Uses
RMVXA
I'm sorry, but I can't seem to figure out how to use your code. I see that those methods are already defined in the original script. In my example project, I replaced them, but the preview image doesn't change upon equip.
 

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
4,671
Reaction score
1,322
First Language
English
Primarily Uses
RMVXA
You don't replace the code with mine, you add it below the other scripts in a new slot
 

KagggZu

Villager
Member
Joined
Sep 18, 2021
Messages
9
Reaction score
0
First Language
English
Primarily Uses
RMVXA
Ah, I understand now. Your code changed "paper doll mode" to hide the default preview image upon equipping armors. I didn't see that before because my original problem with the script was still in there.

This edit works so well that I'm sorry to complain again.

My game feature idea is to have armors that when equipped, would change your character preview. Equipping different armors together would change the whole look, not just add another picture on top. I would have conditional branches in play to check combinations of armors to output a new image.

My example game would have it be like:

[Pink Dress] equipped + [Red Dress] equipped = [Rose Pink Dress] character preview

This is why I asked for the screen to refresh like how "paper doll mode" does after equipping rather than trying to just use that feature alone. That is, unless this is a whole different issue where I can't access "Common Events" while still being in the menu to check for conditional branches.
 

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
4,671
Reaction score
1,322
First Language
English
Primarily Uses
RMVXA
So if you had all the images for all the combinations, would some code work for you.
I think I can make it so that you can specify in the script what the combinations are and then I can have it load the new data. But you would have to have an armour with each variation.
So pink dress is 62 and red dress is 63 when combined you want 64. armour 64 would have the notetag for the rose pink dress.
I'll work on that tomorrow if you are interested.
This still uses paperdoll as the other ways (I think) you're asking is not something I want to try (way too complicated).
 

KagggZu

Villager
Member
Joined
Sep 18, 2021
Messages
9
Reaction score
0
First Language
English
Primarily Uses
RMVXA
I think checking for a different armor # would work. To make sure we're on the right track, it would just need to have:

Check 1:
If [Pink Dress] equipped
Hide default preview image
Show [Pink Dress] preview

Check 2:
If [Pink Dress] equipped + [Red Dress] equipped
Hide default preview image + [Pink Dress] + [Red Dress]
Show [Rose Pink Dress] preview

Check 3:
More armors equipped with the same idea in "Check 2"

So sorry for the trouble here and thanks for sticking with it.
 

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
4,671
Reaction score
1,322
First Language
English
Primarily Uses
RMVXA
This is working except for the purpose of what you want it has one issue.
I think the script is designed to have parts show up on top of the base image.
So if you had a belt, then it would show up on top of the base image and it would 'change' the image.
But you want the base image to be changed when adding on other dresses.
Well if you didn't have a combination specified then both images would show up, just like before.
I'll continue to work on it, but you can see that the basic function is working.

Made it change dresses, but currently will overwrite the previous slot.
So if you have an item in slot 3 then slot two or one will never show.

Seems to be 90% working

Scratch that, seems I did a bad thing.

Now it works, but as I was trying to say before this is a top down image replacement/combo script.
If there is no combination order for the equipment worn, then the last item that has the eb_image note tag will be the only image shown.
I'm going to make this a separate spoiler.

Ruby:
# ╔═════════════════════════════════════╦════════════════════╗
# ║ Title: Paperdoll Combo Images       ║  Version: 1.01     ║
# ║ Author: Roninator2                  ║                    ║
# ╠═════════════════════════════════════╬════════════════════╣
# ║ Function:                           ║   Date Created     ║
# ║                                     ╠════════════════════╣
# ║ Change paperdoll image              ║    18 Sep 2021     ║
# ╚═════════════════════════════════════╩════════════════════╝
# ╔══════════════════════════════════════════════════════════╗
# ║ When equipping several armours together, the base image  ║
# ║ will change if the combination is set in the script.     ║
# ╚══════════════════════════════════════════════════════════╝
# ╔══════════════════════════════════════════════════════════╗
# ║ Instructions:                                            ║
# ║   Specify the combination for each armour sets           ║
# ║      [1,4] => 10                                         ║
# ║      [1,4,8] => 11                                       ║
# ╚══════════════════════════════════════════════════════════╝
# ╔══════════════════════════════════════════════════════════╗
# ║ Updates:                                                 ║
# ║   2021 09 28 -> fixed checking for combos                ║
# ╚══════════════════════════════════════════════════════════╝
# ╔══════════════════════════════════════════════════════════╗
# ║ Requires:                                                ║
# ║   BlackMorning - Basic Module                            ║
# ║   BlackMorning - Advanced Equip                          ║
# ╚══════════════════════════════════════════════════════════╝
# ╔═════════════════════════════════════╗
# ║ Terms of use:                       ║
# ║ Free for all uses in RPG Maker      ║
# ╚═════════════════════════════════════╝

module R2_Paperdoll_Combo
  Paperdoll = {
    [62,63] => 64,
    [63,62] => 65,
    [62,62,62] => 66,
    [63,63] => 67,
  }
end

class Window_EquipActor < Window_Base
  def draw_all_items
    return unless @actor
    draw_actor_name(@actor,0,0)
    draw_mini_face
    @equip_image = false
    if BM::EQUIP::PAPER_DOLL_MODE
      item_max.times {|i| draw_item2(i) }  
    else
      item_max.times {|i| draw_item(i) }
    end
    draw_equip_dummy(0, 0) if @equip_image == false
  end
  def draw_pd_equip_image(item, x, y)
    return unless item
    return if item.eb_image.nil?
    @actor.equips.each_with_index { |eb, indx|
      next if eb.nil?
      ebfile = eb.eb_image if eb.eb_image != nil
      if ebfile != item.eb_image
        item = eb
      end
    }
    item2 = item_combine(item)
    if item2 != item
      item = item2
    end
    bitmap = Cache.equip_body(item.eb_image)
    rect = Rect.new(0, 0, bitmap.width, bitmap.height)
    contents.blt(x, y, bitmap, rect)
    @equip_image = true
  end
  def item_combine(item)
    prev = item
    @image_combo = []
    @result = nil
    @id = 0
    @cnt = 0
    @actor.equips.each { |equip|
      next if equip.nil?
      @image_combo.push(equip.id)
    }
    R2_Paperdoll_Combo::Paperdoll.each { |data|
      if @image_combo[2] == data[0][2] && (data[0][2] != nil || @image_combo[2] != nil) &&
        (@image_combo[1] == data[0][1]) && (@image_combo[0] == data[0][0])
        cnt = 3
      elsif (@image_combo[1] == data[0][1]) && (@image_combo[0] == data[0][0]) && data[0][2].nil?
        cnt = 2
      else
        cnt = 1
      end
      if @cnt < cnt && cnt > 1
        @cnt = cnt
        @id = data[1]
      end
    }
    @result = $data_armors[@id]
    image = @result
    image = prev if @result.nil?
    return image
  end
end
Ruby:
# ╔═════════════════════════════════════╦════════════════════╗
# ║ Title: Paperdoll Combo Images       ║  Version: 1.00     ║
# ║ Author: Roninator2                  ║                    ║
# ╠═════════════════════════════════════╬════════════════════╣
# ║ Function:                           ║   Date Created     ║
# ║                                     ╠════════════════════╣
# ║ Change paperdoll image              ║    18 Sep 2021     ║
# ╚═════════════════════════════════════╩════════════════════╝
# ╔══════════════════════════════════════════════════════════╗
# ║ When equipping several armours together, the base image  ║
# ║ will change if the combination is set in the script.     ║
# ╚══════════════════════════════════════════════════════════╝
# ╔══════════════════════════════════════════════════════════╗
# ║ Instructions:                                            ║
# ║   Specify the combination for each armour sets           ║
# ║      [1,4] => 10   armour 1 + armour 4 = Armour 10       ║
# ║      [1,4,8] => 11                                       ║
# ╚══════════════════════════════════════════════════════════╝
# ╔═════════════════════════════════════╗
# ║ Terms of use:                       ║
# ║ Free for all uses in RPG Maker      ║
# ╚═════════════════════════════════════╝

module R2_Paperdoll_Combo
  Paperdoll = {
    [62,63] => 64,
    [62,63,64] => 65,
  }
end

class Window_EquipActor < Window_Base
  def draw_all_items
    return unless @actor
    draw_actor_name(@actor,0,0)
    draw_mini_face
    @equip_image = false
    if BM::EQUIP::PAPER_DOLL_MODE
      item_max.times {|i| draw_item2(i) }
    else
      item_max.times {|i| draw_item(i) }
    end
    draw_equip_dummy(0, 0) if @equip_image == false
  end
  def draw_pd_equip_image(item, x, y)
    return unless item
    return if item.eb_image.nil?
    item2 = item_combine(item)
    if item2 != item
      item = item2
    end
    bitmap = Cache.equip_body(item.eb_image)
    rect = Rect.new(0, 0, bitmap.width, bitmap.height)
    contents.blt(x, y, bitmap, rect)
    @equip_image = true
  end
  def item_combine(item)
    prev = item
    @image_combo = []
    @result = nil
    @id = 0
    @cnt = 0
    @actor.equips.each { |equip|
      next if equip.nil?
      @image_combo.push(equip.id)
    }
    R2_Paperdoll_Combo::Paperdoll.each { |data|
      if @image_combo[2] == data[0][2] && (data[0][2] != nil || @image_combo[2] != nil)
        cnt = 3
      elsif (@image_combo[1] == data[0][1]) && data[0][2].nil?
        cnt = 2
      else
        cnt = 1
      end
      if @cnt < cnt && cnt > 1
        @cnt = cnt
        @id = data[1]
      end
    }
    @result = $data_armors[@id]
    image = @result
    image = prev if @result.nil?
    return image
  end
end
 
Last edited:

KagggZu

Villager
Member
Joined
Sep 18, 2021
Messages
9
Reaction score
0
First Language
English
Primarily Uses
RMVXA
Sorry for the late response!

The script is working wonderfully as you described, but when I tinkered around, I found a weird bug.

The bugfix I'm looking for is to have duplicate armor be available for use in the script.

For example, when I list this:
[62,63] => 64,
[63,62] => 65,
[62,62] => 66,
[63,63] => 67,

I was able to have armor combinations be able to be order specific and it's amazing! Keep this! However, when I try to assign duplicate armor id's, it calls a different one instead:
[62,62] => 66,
would show up as
[62,62] => 65,
in game.

I think it grabs the "62" from:
[63,62] => 65,

Same issue happens with:
[63,63] => 67,

Funny enough, when I assign the duplicate armor combination by itself, it works. As soon as I grab the other combinations, it breaks.

Example project:
 
Last edited:

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
4,671
Reaction score
1,322
First Language
English
Primarily Uses
RMVXA
Updated
 

Latest Threads

Latest Posts

Latest Profile Posts

I really, really want the Magic story to be good, but instead we got today's chapter of the most predictable mish-mash of tropes with almost no personality. I let go of the physical game years ago, but I can't seem to let go of the story.
Just finished watching the last of the Final Destination movies. I'm digging every last water bottle out of that old van :p
Put off learning to drive for so long, I hope I don't run into any of-fences ..... (quietly leaves)
I introduced a new character to Mintabelle's Wonderland. Fufu the Raccoon! She's supposed to be a motherly daycare attendant, but when the power goes out, she becomes a monster. Rumor among kids says she causes these outages herself...
After an entire year, finally made new story cutscenes. Ones that take place after the current last boss. Praise be.

Forum statistics

Threads
129,803
Messages
1,205,309
Members
170,909
Latest member
atravelersheart
Top