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,277
Reaction score
8,729
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

Ace Attorney
Veteran
Joined
Sep 13, 2015
Messages
460
Reaction score
490
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,277
Reaction score
8,729
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
683
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,277
Reaction score
8,729
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,958
Reaction score
2,292
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
683
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

Question for the Mods: What am I supposed to do when I can't make a synopsis 350 words long? (for project recruitment thread) @Shaz @mlogan
The game is meant to be more on the simple side in order to be achievable so I'm a bit stuck...
Had a nice visit with our family. Dad grilled some burgers and mom made baked beans and fudge. We also watched Foul Play. Chevy Chase and Goldie Hawn make an awesome duo. I am surprised how much of the movie I forgot LOL. How did everyone else's holidays go?
Got a windowskin working nicely to go with Mog's menu plugins.
p8BE5bj.png

tsD4gZS.png

nwpeK84.png
Just getting started on RPG maker and having a blast!
I am once again escalating in the kitchen. I might or might not be 4 types of cookies into baking and not finished...

Forum statistics

Threads
117,038
Messages
1,104,029
Members
152,967
Latest member
tetistetiss
Top