MV Is there a solution to the conflict of using []?

Sorry for somewhat unclear title, i don't know how to describe it in few words. I use two plugins. As part of the first one there is a health bar that are formed with code like this:
1742556074357.png


The [FIX] prefix in file originally does not present, so it works fine. But, every time the health bar is refreshing, it's moving to a new position if the player is moved on the map, and i don't want that.

So i use plugin that anchors images to the map (TTK - Fix Picture), and basicly the only requirement it has - is the [FIX] prefix in image name.

However if i add updated name of the picture as showin in the code above - i am starting to get this error -
1742556144224.png

Probably because RM reads [] as part of the code. Is there any way to resolve this conflict that is not too complicated for someone who can't code?
You could declare a variable name above your current code and reference that in the "Img" property instead.
const imgName = "[FIX]Hub1";
Img: imgName
You could declare a variable name above your current code and reference that in the "Img" property instead.
const imgName = "[FIX]Hub1";
Img: imgName
Like this?
1742563152032.png
Getting the same error.
whenever you an "[PARAM]Name" is called, it might see it as a
reference to a parameter that doesn't exist.

in this case, I need to see what FIX Picture exactly does and if it can
be omitted.

Edit:
maybe try [this plugin] and see if that works.

otherwise, I could try to update to use the picture shake without "[FIX]" as the
ID into a struct to be readed, so those ID are ignored instead.
I would try adding single quotes so the [FIX] part is not evaluated.

Code:
Img:"'[FIX]Hub1'"

Just an idea.
Ok, once again i am being stupid and not noticing obvious solution. The fix picture plugin had an option to customize the prefix.

BUT... it seem to be not working on this picture. Or it is not working when picture summoned trough the script, idk.


maybe try [this plugin] and see if that works.
But it only removes the shake. And what i need to do is to stop picture from being re-rendered.
It seems like my script creates a new picture every time it gets updated. It also creates a wave name that does not even use an image and i have no idea at all how and where it is created. But both image and wave name change their locations if player moves to different part of the level, so it will remain on player's screen. And i have no idea how to stop that from happening(


UPDATE: I think this happens because plugin by default takes images from different folder other than image\pictures, and the fix picture plugin only works with those. Is there a script call that would modify one in image above so it would use pictures folder instead?
image\pictures, and the fix picture plugin only works with those. Is there a script call that would modify one in image above so it would use pictures folder instead?
it is possible, need to look into both, which folder they are being drawed.

Edit:
you can try this into a plugin or insert it inside the TTK plugin to see if it works.
JavaScript:
    Sprite_Picture.prototype.loadBitmap = function() {
        if (Imported.QJBullet) {
            this.bitmap = ImageManager.loadBullet(this._pictureName);
        } else {
            this.bitmap = ImageManager.loadPicture(this._pictureName);
        }
    };

it might need some changing, or some redirection inside his update position.
Inside a string [] should be ignored, outside a string it becomes an array indicator.

I think we need the full console output of the error to see if the FIX mentioned in the error is the same FIX that is part of the filename.
It might be something else in the code.

Because the only way this can happen if the [FIX] is the cause, is if the string is Eval'ed AND somehow contains a syntax error that prevents the eval from identifying it as a filename-string.
it is possible, need to look into both, which folder they are being drawed.

Edit:
you can try this into a plugin or insert it inside the TTK plugin to see if it works.
JavaScript:
    Sprite_Picture.prototype.loadBitmap = function() {
        if (Imported.QJBullet) {
            this.bitmap = ImageManager.loadBullet(this._pictureName);
        } else {
            this.bitmap = ImageManager.loadPicture(this._pictureName);
        }
    };

it might need some changing, or some redirection inside his update position.
I tried, nothing changed.
Have to not that image disappears after receiving hit, and returning some time after.

QJ is using folder called bullets.
Not sure if you need the code from plugins or this information is enough.
The plugins are free, but i still don't think that i can post their code. But i can link them.

https://qiujiu.itch.io/qj-bullet-plugin - the one i am using is QJ-Bullet (there are several plugins in demo).

The code i am using is in the map called protect, in event that looks like fairy.


Inside a string [] should be ignored, outside a string it becomes an array indicator.

I think we need the full console output of the error to see if the FIX mentioned in the error is the same FIX that is part of the filename.
It might be something else in the code.

Because the only way this can happen if the [FIX] is the cause, is if the string is Eval'ed AND somehow contains a syntax error that prevents the eval from identifying it as a filename-string.
That problem is solved already, but i still can't figure out how can i make the fix picture plugin to work with the other one that using different folder for it's images.
I re-direct the picture name by loading it's bullet folder 😉

but what if you remove the "[FIX]" will it work by than? or do you get the error still?
I re-direct the picture name by loading it's bullet folder 😉

but what if you remove the "[FIX]" will it work by than? or do you get the error still?
No, I am not getting any errors, it's just that picture is still being moved even with new code in fixpicture.

Also i already removed borders, so it's just FIXhub1 now, so nothing should stop the plugin from working... unless it only works via show picture and the script call does not activate it.
if the param is FIX it should work.

else try to change "indexOf" => includes and see if that works.
and make sure the param jus have FIX without the use [ and ] as prefix.

I cannot tell if it works, otherwise, it needs a check to if it exist in the pictureName.
there are serveral ways to do that as well.
else try to change "indexOf" => includes and see if that works.
Sorry, i don't understand where such change needs to be done, and how. I tried to learn coding for years but always failed, so i understand a little less than basic logic of it.
and make sure the param jus have FIX without the use [ and ] as prefix.
Yes, it's just FIX now.
I tested it on other instances where i am using it (just show picture command) and it works, and it is fixed so the prefix change is legit.
1742585603168.png
includes <= is changing the way the plugin checks for "indexOf" the prefix.

if FIX seems to work or any other, you can also use Fix_ or F_ or FIX_.

avoid use brackets as object with [FIX] is an array.
array's can have errors in those as it expect a value/string to return which isn't defined.

so try to avoid it if you get it again somewhere from another plugin 🙂
includes <= is changing the way the plugin checks for "indexOf" the prefix.

if FIX seems to work or any other, you can also use Fix_ or F_ or FIX_.

avoid use brackets as object with [FIX] is an array.
array's can have errors in those as it expect a value/string to return which isn't defined.

so try to avoid it if you get it again somewhere from another plugin 🙂
I do not use brackets anymore, i understand now what they caused, and now it's just a FIX without brackets. I could change it to any other prefix as well, just don't see reason to.

The problem i have now is that there are no errors, but plugin still does not work for that image. And i don't know why.

I tried to read the fix picture code, and it seems to be quite simple, just 11 lines. But i can't really get what they do.

There is also a description that says that it binds image to the place designated by the event command. Maybe that is the problem? I don't have the event command to designate the coordinates for the image to be rooted to?

I tried inserting plugin's code into script in the event, but it does not work like that, gives various errors.
This thread is closed due to being reported as solved. If you need it reopened, report it to let us know. Thank you!

Original thread: https://forums.rpgmakerweb.com/threads/is-there-a-solution-to-the-conflict-of-using.176437/