Small Question

Solr

Living Weapon
Veteran
Joined
Apr 20, 2019
Messages
46
Reaction score
7
First Language
English
Primarily Uses
RMVXA
So, I am pretty new to these forums, but I have been using various rpg maker engines for a long time.

In the item menu, how would I go about drawing an "X" instead of a colon to display the amount of an item?
I have little knowledge of ruby code and I would very much appreciate it if someone could provide me a snippet, or tell me what line to edit and how to do so. Thank you in advance, this is my first post, so I'm sorry if something isn't formatted correctly.
reference.png
 

Wavelength

MSD Strong
Global Mod
Joined
Jul 22, 2014
Messages
5,624
Reaction score
5,107
First Language
English
Primarily Uses
RMVXA
I believe you can change this method in the script Window_ItemList:
#--------------------------------------------------------------------------
# * Draw Number of Items
#--------------------------------------------------------------------------
def draw_item_number(rect, item)
draw_text(rect, sprintf(":%2d", $game_party.item_number(item)), 2)
end

Check out where I highlighted the colon in green. Just change that to an x without changing anything else and I think it should work.

Just in case I'm wrong, I'm moving this over to the Learning Ruby and RGSS subforum so someone can correct me. In the future, if you have a small question about a change you need to make to the default code, that's the best place to ask it.
 

Solr

Living Weapon
Veteran
Joined
Apr 20, 2019
Messages
46
Reaction score
7
First Language
English
Primarily Uses
RMVXA
I believe you can change this method in the script Window_ItemList:
#--------------------------------------------------------------------------
# * Draw Number of Items
#--------------------------------------------------------------------------
def draw_item_number(rect, item)
draw_text(rect, sprintf(":%2d", $game_party.item_number(item)), 2)
end

Check out where I highlighted the colon in green. Just change that to an x without changing anything else and I think it should work.

Just in case I'm wrong, I'm moving this over to the Learning Ruby and RGSS subforum so someone can correct me. In the future, if you have a small question about a change you need to make to the default code, that's the best place to ask it.
Ah thank you so much, you replied so fast and it works like a charm!!! And I'll be sure to post any future questions I have about the code this place. Thank's again!
 

Wavelength

MSD Strong
Global Mod
Joined
Jul 22, 2014
Messages
5,624
Reaction score
5,107
First Language
English
Primarily Uses
RMVXA
No problem, glad it worked for ya :)
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,370
Reaction score
7,678
First Language
German
Primarily Uses
RMMV
@Solr I suggest you make yourself a special list of whenever you edit the base script files.
VXA will not be updated anymore so this is not as important as with MV (where the basefiles are still updated sometimes), but it will become a problem if you ever try to transfer something to a new project and forget to modify the base scripts in the new project the same way.
 

Solr

Living Weapon
Veteran
Joined
Apr 20, 2019
Messages
46
Reaction score
7
First Language
English
Primarily Uses
RMVXA
@Solr I suggest you make yourself a special list of whenever you edit the base script files.
VXA will not be updated anymore so this is not as important as with MV (where the basefiles are still updated sometimes), but it will become a problem if you ever try to transfer something to a new project and forget to modify the base scripts in the new project the same way.
Thanks for the tip, Andar, but I got it covered. I create a new backup of my game whenever I make changes to the script or do some serious eventing. (I got burned a while back when a project became corrupted and I had no backup)
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,370
Reaction score
7,678
First Language
German
Primarily Uses
RMMV
@Solr My comment wasn't only for backup purposes, there are other things that can go wrong.

It's funny in hintsight now, but there once was someone who wrote a tutorial and provided an Ace demo for it. It was only eventing (or supposedly only eventing) and introduced some nice tricks on how to make something very easy (don't remember what).

And it worked in the demo provided with it, but for no one else, not even the tutorial writer could reproduce this or understand why it worked in the demo but not in new projects.

It took months before someone finally found the tiny change in the base scripts that even the tutorial writer had forgotten about...
 

Solr

Living Weapon
Veteran
Joined
Apr 20, 2019
Messages
46
Reaction score
7
First Language
English
Primarily Uses
RMVXA
@Andar Oh I see what you mean. I understand now. Yeah, I'll definitely keep a log of my base script edits, luckily I haven't made that many so it should be easy to backtrack. Thanks for the advice :)
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
5,594
Reaction score
6,525
First Language
Indonesian
Primarily Uses
RMVXA
This is why the thing called "basic module" or "core script" exist, i suggest u to make your own.

Im on mobile, i could explain more when im on desktop.
 

Solr

Living Weapon
Veteran
Joined
Apr 20, 2019
Messages
46
Reaction score
7
First Language
English
Primarily Uses
RMVXA
This is why the thing called "basic module" or "core script" exist, i suggest u to make your own.

Im on mobile, i could explain more when im on desktop.
Oh wow, it's TheoAllen! I can't believe you're actually talking to me, it's like I'm in the presence of a celebrity! I've used your sideview battle system once for a past project I never completed. In my current project, I'm actually using your pathfinding script. It's amazing that it can calculate routes in real time like as a parallel process without causing any lag. Like, it's something that doesn't even seem possible in VXA.

As much as I'd like to write my own core script, unfortunately, I just don't have enough time to formally learn ruby code though. All the work I do on my project is done using any free time I have from college. Thank you for your advice though, it's amazing to be talking to you.
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
5,594
Reaction score
6,525
First Language
Indonesian
Primarily Uses
RMVXA
As much as I'd like to write my own core script, unfortunately, I just don't have enough time to formally learn ruby code though. All the work I do on my project is done using any free time I have from college. Thank you for your advice though, it's amazing to be talking to you.
What I'm suggesting is not much different than what Andar said. If Andar said "list", I said "core script". In this "core script", you dump all the change within one script slot. Nothing fancy and it is not always something fancy. For example, you don't agree with draw_item_index in the default script, instead of changing it in the basic script, you change it in a new script slot. So your "core script" will just something like.
Code:
class Window_ItemList
  def draw_item_number(rect, item)
    draw_text(rect, sprintf(":%2d", $game_party.item_number(item)), 2)
  end
end
Later if you want to change something from the base script, add more to your "core script", essentially you're also making list like what Andar suggested. You know what you have changed without actually change the base script. I hope my explanation is clear enough. If you create a new project, you just need to copy the script.
 

Solr

Living Weapon
Veteran
Joined
Apr 20, 2019
Messages
46
Reaction score
7
First Language
English
Primarily Uses
RMVXA
@TheoAllen Oh I see. Is it really this simple? With the exception of "class Window_ItemList" this is the same code from line 100 of Window_ItemList. So if I just add this below materials as an independent script, it will overwrite some of the default code for Window_ItemList? Can all my minor changes to the base script be represented like this, as long as I specify the base script I am overwriting as "class X" or whatever?
Thank you so much for going out of your way to show me this :) This is very helpful.
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
5,594
Reaction score
6,525
First Language
Indonesian
Primarily Uses
RMVXA
@Solr yes it's the same as if you change the line 100 ~ 102 from the default script. The good practice is to never edit the default script. Instead, make the change as a new script slot. This is basically what many scripts does. So they're distributable.
 

Solr

Living Weapon
Veteran
Joined
Apr 20, 2019
Messages
46
Reaction score
7
First Language
English
Primarily Uses
RMVXA
@TheoAllen I see, that makes sense. Thank you again!
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

I should realize that error was produced by a outdated version of MZ so that's why it pop up like that
Ami
i can't wait to drink some ice after struggling with my illness in 9 days. 9 days is really bad for me,i can't focus with my shop and even can't do something with my project
How many hours have you got in mz so far?

A bit of a "sparkle" update to the lower portion of the world map. :LZSexcite:
attack on titan final season is airing tomorrow, I'm excited and scared at the same time!

Forum statistics

Threads
105,882
Messages
1,017,231
Members
137,607
Latest member
Maddo
Top