NotFlamingo

Veteran
Veteran
Joined
Jun 14, 2014
Messages
106
Reaction score
9
First Language
Lithuanian
Primarily Uses
RMMV
Hello! I'm trying to show one item (ammo) quantity in the battle scene. I only succeeded to understand that It's impossible for me to do, because i can't code at all... I would be glad if someone could help!


Layout is number which is the quantity of the item (id=100) and then 24x24 icon from IconSet.png (30). In upper right window place. You can see it in the picture added. It should be visible during all the battle or better only when player party hud is showing (basically when player can choose what to do). I use hotkey system to choose battle skills without surfing through battle commands. All of the skills have requirement of the same ammo. Every time when player uses skill, it reduces quantity of that item (I use Yanfly Engine Ace - Skill Cost Manager v1.03). That is why I want to show ammo quantity on battle screen that will refresh every time player uses skill. Because in that case player can see how many ammo is left and decide which skill (some of skills needs more ammo, some less) to use without going through the battle command to the item list every turn to check the ammo quantity.


Thank You for your patience of my super engrish ;)


Untitled.png
 
Last edited by a moderator:

JoePro

None Newb
Veteran
Joined
May 29, 2014
Messages
78
Reaction score
17
First Language
English
Primarily Uses
We would need a copy or link to the script that you are using to display the keys/items so we can add on to or edit it.
 

MeowFace

Meow
Veteran
Joined
Feb 22, 2015
Messages
1,034
Reaction score
186
First Language
Meowish
Primarily Uses
So it's on the top left of the screen all through out the battle?


There you go:


#==============================================================================
# ■ Meow Face Battle Ammo Window
#------------------------------------------------------------------------------
# Add Ammo to Battle Scene
#==============================================================================
# How to Use:
# [1] Paste this below Material and above Main
#==============================================================================
module MeowSAMMO #DO NOT REMOVE!!
#==============================================================================
# Settings Area
#==============================================================================
ICON = 30 #Enter Icon ID here
ITEM = 100 #Enter Item ID here
#==============================================================================
# End of Settings Area
# Edit anything past this line at your own risk!
#==============================================================================
end
class Window_Ammo < Window_Base
def initialize
super(0, 0, window_width, fitting_height(1))
@last_qty = 0
self.opacity = 0
refresh
end
def window_width
return Graphics.width
end
def refresh
contents.clear
quantity = $game_party.item_number($data_items[MeowSAMMO::ITEM])
icon = MeowSAMMO::ICON
draw_icon(icon, contents.width-24, 0)
draw_text(0, 0, contents.width-24, line_height, quantity, 2)
@last_qty = quantity
end
def need_refresh?
@last_qty != $game_party.item_number($data_items[MeowSAMMO::ITEM])
end
end
class Scene_Battle < Scene_Base
alias meow_face_baw_sb create_all_windows
def create_all_windows
meow_face_baw_sb
create_ammo_window
end
def create_ammo_window
@ammo_window = Window_Ammo.new
end
alias meow_ammo_update update
def update
@ammo_window.refresh if @ammo_window.need_refresh?
meow_ammo_update
end
end


let me know if you run into any problem
 
  • Like
Reactions: BCj

NotFlamingo

Veteran
Veteran
Joined
Jun 14, 2014
Messages
106
Reaction score
9
First Language
Lithuanian
Primarily Uses
RMMV
It works! Thank You! Im gonna test and write if everything is ok. I'm getting one error but I think it's not related with this script.
 

MeowFace

Meow
Veteran
Joined
Feb 22, 2015
Messages
1,034
Reaction score
186
First Language
Meowish
Primarily Uses
It works! Thank You! Im gonna test and write if everything is ok. I'm getting one error but I think it's not related with this script.

You are welcome!


This script is either using new or alias method, so it's unlikely to cause conflicts. Simply place it below your battle scripts will do.
 

NotFlamingo

Veteran
Veteran
Joined
Jun 14, 2014
Messages
106
Reaction score
9
First Language
Lithuanian
Primarily Uses
RMMV
The script works perfect and gives no errors at all, thank You!


I know I requested only one item quantity display, but... After finished setting all battle skills I see that I need to show 5 item counts with 5 different icons on battle. Is it... too much to ask You to update given script, MeowFace? I tried by myself but only getting script duplication error (SystemStackError)... Please help!
 

Latest Threads

Latest Profile Posts

It's definitely discouraging when streamers give a try-to-say-it-nicely (i.e. bad) review of your game demo. It's like jumping into a cold pool. Bad initally, but it gets better with time. And you are now more alert and see better.
Some screenshots of the pub and lodging with the beginnings of clutter taking shape
TTp8uCw.png

jtC202e.png

bSXgyVl.png

eRx9PUF.png
Backgrounds are not my strong suit... :kaodes:
DazI8jt.jpg

Just realized I forgot doing the clouds... woops
Went to get some stuff for February 10, the birthday of my favorite ink monster...
I have a little one-person party for Bendy every year, complete with the life-size plushie I made. And yes, I bake a birthday cake!

Forum statistics

Threads
118,497
Messages
1,116,407
Members
155,489
Latest member
Desarr0
Top