joket

Veteran
Veteran
Joined
Apr 24, 2021
Messages
176
Reaction score
44
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,354
Reaction score
8,770
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
176
Reaction score
44
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
145
Reaction score
103
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
469
Reaction score
503
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
176
Reaction score
44
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
176
Reaction score
44
First Language
English
Primarily Uses
RMMV
What about this?
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
34,354
Reaction score
8,770
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
685
Reaction score
588
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
176
Reaction score
44
First Language
English
Primarily Uses
RMMV
what if I just mod those number directly?
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
34,354
Reaction score
8,770
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,986
Reaction score
2,304
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
176
Reaction score
44
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
685
Reaction score
588
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
176
Reaction score
44
First Language
English
Primarily Uses
RMMV
The plugin simple lines work. Thank you!
 

Latest Threads

Latest Posts

Latest Profile Posts

Imagine having a game broken up into a whole bunch of chapters? Like Chapter 11 should be about the party members going bankrupt.
Over 1/4th of the calendars are already out :eek: Have you already put something to a good use?
Where would you go if you're looking to hire someone on here? I'm in need of a writer to take my story concept and turn it into npcs/dialog in my game.
Evening humans! How goes the game make?

Forum statistics

Threads
117,258
Messages
1,105,898
Members
153,429
Latest member
NiricoMino
Top