joket

Veteran
Veteran
Joined
Apr 24, 2021
Messages
303
Reaction score
71
First Language
English
Primarily Uses
RMMV
Hello, I'd like to change buff and debuff icon references.
I've read this:

But I don't want to change my iconset.png. I want to change the icon number reference from the game data.
Where can I find those number to change the reference?
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
38,005
Reaction score
10,564
First Language
German
Primarily Uses
RMMV
I don't think you can, because most likely they are not a fixed reference but a mathematical calculation.
There should be a single offset somewhere in the code, and the ID is calculated from there like "Parameter x has icon at x+offset for first level and x+8+offset for second level"

How do you want to change the icons? you might be able to shift the offset, but you won't be able to change the fact that all icons need to be in their specific order.
 

joket

Veteran
Veteran
Joined
Apr 24, 2021
Messages
303
Reaction score
71
First Language
English
Primarily Uses
RMMV
it's okay for them to be in a specific order. But my 2nd and 3rd row is occupied by other icons, and I can't just shift the icons quickly. Do you know where in the code are those id calculation references? I'd just mod that with something like:
"parameter x has icon at x+10+offset for first level and x+8+offset for second level"
so that it starts 10 icons after
 

Cyberhawk

Bravelion Leader
Veteran
Joined
Jan 9, 2019
Messages
150
Reaction score
109
First Language
English
Primarily Uses
RMMZ
Honestly, i would find it easier to just edit the icon image via pixlr, photoshop or gimp. since you can remove a row of icons and replace them.
I think it may be hardcoded into the gamemaker itself. Imo it's a lot quicker to just edit a photo in such ways over trying to change the base code.
 

Sword_of_Dusk

Ace Attorney
Veteran
Joined
Sep 13, 2015
Messages
1,072
Reaction score
1,099
First Language
English
Primarily Uses
RMMV
I agree with the above. Editing your iconset will be easier and more efficient.
 

joket

Veteran
Veteran
Joined
Apr 24, 2021
Messages
303
Reaction score
71
First Language
English
Primarily Uses
RMMV
It won't be easier nor more efficient. I've already multiple calls to those actual ones: battle system, maps, minigames, events. There could be more than 1200 icon calls to those specific 8 ones on the second line. I need to change the code reference.
 

joket

Veteran
Veteran
Joined
Apr 24, 2021
Messages
303
Reaction score
71
First Language
English
Primarily Uses
RMMV
What about this?
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
38,005
Reaction score
10,564
First Language
German
Primarily Uses
RMMV
forget what I wrote, I misread and don't know
 

LadyBaskerville

Hell-poodle
Veteran
Joined
Sep 12, 2016
Messages
706
Reaction score
643
First Language
German
Primarily Uses
RMMV
What about this?
The constants referenced in that thread look like what I just found too. (Lines 2122 and 2123 in rpg_objects.js) You should be able to just make a js file containing only the lines
JavaScript:
Game_BattlerBase.ICON_BUFF_START = 32;
Game_BattlerBase.ICON_DEBUFF_START = 48;
with the numbers changed to the values you want, and add it as a plugin.
 

joket

Veteran
Veteran
Joined
Apr 24, 2021
Messages
303
Reaction score
71
First Language
English
Primarily Uses
RMMV
what if I just mod those number directly?
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
38,005
Reaction score
10,564
First Language
German
Primarily Uses
RMMV
what if I just mod those number directly?
Then any project update later will remove your edits. And MZ is not yet legacy, so you can expect fututre updates.

Plugins are nothing other than script files in a framework that tells the engine where to add those scripts inside the engine.
Making the changed numbers into a plugin will guarantee that the numbers will be overwritten independent of any engine updates done, as long as the plugin is added.

You can even have a plugin written in such a way that you can change the values by plugin properties instead of file manipulation, although that would probably be overkill for this case.
 

caethyril

^_^
Global Mod
Joined
Feb 21, 2018
Messages
4,505
Reaction score
3,545
First Language
EN
Primarily Uses
RMMZ
what if I just mod those number directly?
Sure you could. That said, plugins can be easily turned on/off, are obvious when asking for support, and are not erased if/when you update your project's core scripts. And this one would have negligible CPU/RAM overhead.

The attached file, using the exact code LadyBaskerville suggested, took me less than 20 seconds to create: open Notepad, paste text, save.
 

Attachments

  • buffIcons.js
    80 bytes · Views: 15

joket

Veteran
Veteran
Joined
Apr 24, 2021
Messages
303
Reaction score
71
First Language
English
Primarily Uses
RMMV
Thank you very much! yes it's the smartest way.
 

LadyBaskerville

Hell-poodle
Veteran
Joined
Sep 12, 2016
Messages
706
Reaction score
643
First Language
German
Primarily Uses
RMMV
This is in the MV forum, not MZ, so I'm not sure how much of an issue updates would be - but using a plugin is best practice for the reasons mentioned.
 

joket

Veteran
Veteran
Joined
Apr 24, 2021
Messages
303
Reaction score
71
First Language
English
Primarily Uses
RMMV
The plugin simple lines work. Thank you!
 

Latest Threads

Latest Posts

Latest Profile Posts

It's been a while again, eh.
It's all over! ep 27 now I got find some other long RPG to play, any reccomendations?
Shaz wrote on Avery's profile.
I need some of whatever you've been drinking for the last few weeks!
Although I love your awesome tutorials and always want more, I sure hope you're not going to burn yourself out.
Has anyone else ever thought about how the title of Gym Leader is usually hereditary? Usually the gym leaders child or sibling becomes the next gym leader. Not always, but usually. Pokémon nepotism
I have a new profile photo and I'm loving the heck out of it! Thanks @Finnuval :kaopride:
:kaoluv:

Forum statistics

Threads
129,949
Messages
1,206,494
Members
171,163
Latest member
cmoir
Top