joket

Veteran
Veteran
Joined
Apr 24, 2021
Messages
163
Reaction score
39
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
34,257
Reaction score
8,712
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
163
Reaction score
39
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
143
Reaction score
102
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

Keyblade Master
Veteran
Joined
Sep 13, 2015
Messages
447
Reaction score
477
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
163
Reaction score
39
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
163
Reaction score
39
First Language
English
Primarily Uses
RMMV
What about this?
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
34,257
Reaction score
8,712
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
680
Reaction score
579
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
163
Reaction score
39
First Language
English
Primarily Uses
RMMV
what if I just mod those number directly?
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
34,257
Reaction score
8,712
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
2,957
Reaction score
2,291
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: 2

joket

Veteran
Veteran
Joined
Apr 24, 2021
Messages
163
Reaction score
39
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
680
Reaction score
579
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
163
Reaction score
39
First Language
English
Primarily Uses
RMMV
The plugin simple lines work. Thank you!
 

Latest Threads

Latest Posts

Latest Profile Posts

Sizzle sizzle sizzle...
zbf1dCZ.gif
Sharing my past was a mistake. Will delete the post when I get access to a working internet connection again.
TFW you get a plugin working correctly with your other plugins ♡\( ̄▽ ̄)/♡

(CW for minor gore - Einar's Y incision is gone for his test portrait)

Cs5kAbZ.png
Doing some winter related edits for a cozy cottage!
I think it's the third time I am changing my skill info plugin, but as I get better at programming, I want to fix the trash I made earlier :p

Streaming while I am programming the plugin. Join in if you wish :)

Forum statistics

Threads
116,981
Messages
1,103,496
Members
152,845
Latest member
Zynarith2
Top