MV How to keep image from script call fixed, and how to find part of the event?

Figured that i should rather start a new post with a new problem.

First problem:

I am using bullet plugin (https://qiujiu.itch.io/qj-bullet-plugin), and during certain event it calls the HP bar that is stored as a picture in img\bullets folder.
The code that summons picture in event looks like this:
1742653635158.png
The problem is that there is also a code that updates the picture, lowering hp bar when event takes damage. And if the player character moves, the hp bar moves to a new location when updating. And i don't want that, it looks bad and covers enemies.
This is the code for picture update.
1742653673648.png
I tried to solve that with another plugin - TTK fix picture (https://forums.rpgmakerweb.com/index.php?threads/fix-picture.50594/)

It should fix all pictures that have FIX as prefix in their name. But it does not work. I assume there might be 2 possible reasons:

1) it only fixes pictures from the pictures folder, and unable to work with bullets folder.

However, in the original post where i tried to solve different issue first (https://forums.rpgmakerweb.com/inde...to-the-conflict-of-using.176437/#post-1505791) and the ShadowDragon suggested a code that would replace folder images are taken from. It did not work - so either this is not the source of the problem, or maybe it's one of two sources.

2) Perhaps, it only fixes pictures after event gives them coordinates to be fixed to, and it does not work when coordinates given via script call? I don't know how to test that.

There is also a second problem - the event also creates text "Wave" with changing number of waves. I HAVE NO IDEA HOW ITS BEING DONE! This is the code for it -
1742656369968.png

It seems like it calls the image called Wave but THERE ARE NO SUCH IMAGE in any folder of the game!

But that image is also shifting along with the camera, appearing in new places when updated just like the hp bar.
I tried to change both parameters called "wave". Chanding top one makes it so previous instances of the image is not deleted when new ones appear, so you soon will have waves all over the screen. Changing bottom ones does nothing at all.


I also have another theoretical solution but don't know how to implement it.
Because you know what does not shift? The hp outline.
It's code looks like this -
1742655625877.png

And it's always stays in place. It does not even require plugin to stay fixed! Why? I have no idea. The code for appearance is exactly identical to the appearance code of the hp bar. Maybe it has some secret way to be fixed? Or it is not moving because unlike hp bar and wave message the outline is not updated? That is most likely the case, and in that case it is not a solution.

I have no idea why simply keeping two images in place are so damn complicated, and this is why i hate dealing with tech stuff. In writing i can solve any problem, but here i just don't know what to do, every path seems to be a dead end. Maybe someone else has any idea?
😩 Huston, my head explodes from trying to think about this problem. Please, send help.
I'm not familiar with these plugins, but here are some comments~

I tried to solve that with another plugin - TTK fix picture (https://forums.rpgmakerweb.com/index.php?threads/fix-picture.50594/)
Before even looking at the code, I can tell you that it will probably not apply here, because the bullets are not being treated, by the engine, as picture instances.

...OK, yes: I checked the code and the fix picture plugin affects Sprite_Picture. It will not apply to your bullets, because those are of a different sprite class inheriting directly from Sprite_Base.

it only fixes pictures from the pictures folder, and unable to work with bullets folder.
You can generally use the ../ fragment in a file path to navigate up 1 directory. E.g. let's say you have directories nested like this:
  • img
    • pictures
    • projectiles
Then img/projectiles and img/pictures/../projectiles point to the same place.

It seems like it calls the image called Wave but THERE ARE NO SUCH IMAGE in any folder of the game!
The plugin makes use of the PIXI particles library:
I haven't looked into this in depth...maybe Wave is a keyword that is replaced at runtime, or maybe you're seeing a generic preset texture because no valid texture has been specified. (Or maybe the image is there and you've just overlooked it.)

And it's always stays in place. It does not even require plugin to stay fixed! Why?
The "fixed-ness" of a sprite is due entirely to how the plugin is coded. Looks like that is primarily determined by the position attribute?
in your second image is QJ.BL.deleteBullet("HPHub"),
did you try to rule out with \\ in front to see if it stays?

this might cause staying if the HP is 0 (which need aditional check to delete it by than.
or add the check so it deletes if HP <= 0 otherwise it stays.
It will not apply to your bullets, because those are of a different sprite class inheriting directly from Sprite_Base
Does the hp bar image also count as a bullet?
You can generally use the ../ fragment in a file path to navigate up 1 directory.
Tried this -
1742934562521.png

1742934577210.png

Or
1742935566684.png

Wasnt sure if i need space before image file or not so tried both ways.

I think i fail to understand how exactly it works. It seems like it read two dots as an actual path instead of navigate to a folder above.
generic preset texture
But it has to be stored somewhere? And if location for it can be changed, then it can be fixed as well?
Looks like that is primarily determined by the position attribute?
None of those commands had any effect at all. Not even errors. Maybe it's because the site you linked only has mz documentation? Perhaps mz version of the plugin can do more than mv one.
did you try to rule out with \\ in front to see if it stays?
If you mean doing this -
1742934969294.png

It causes this -
1742935101085.png


this might cause staying if the HP is 0 (which need aditional check to delete it by than.
It is irrelevant if it stays because it's a game over then.
I ment the other slash // which is my bad =) the backslash are
process character, sorry.

but I think it should work for object too.

the ../ part probably cannot be used directly after an image check.
more like ../pictures will check img/picture/ folder.
Does the hp bar image also count as a bullet?
Yes, anything you shoot via the plugin function QJ.BL.Shoot will be a bullet, because that function shoots bullets. It does not shoot pictures.

It doesn't matter what name you give the .png files on your computer, or in what directory they happen to be stored. When I am saying "picture", I mean specific types of object (Game_Picture & Sprite_Picture) that are defined in the core scripts for a specific purpose: representing the Show Picture and Move Picture commands.

It seems like it read two dots as an actual path instead of navigate to a folder above.
The plugin prepends the directory path, img/bullets/. Like ShadowDragon said, you would instead use the filename ../pictures/FIXHUB1. I doubt that'll help here, though.

But it has to be stored somewhere?
An "image" file on disk (e.g. wave.png) is not needed to create graphics on screen. Code can store and reformat information.

Where do you think the core rain/snow weather particles come from? They're just simple shapes drawn by code at runtime. A bunch of circles arranged in close formation can look like a different shape, same sort of idea as pixels on your screen.

It's also possible to e.g. embed image data in code. I think this is more common with vector graphics (e.g. SVG), but could be done with raster images (e.g. BMP) or any kind of data (e.g. graphs).

None of those commands had any effect at all. Not even errors. Maybe it's because the site you linked only has mz documentation? Perhaps mz version of the plugin can do more than mv one.
Oh. Yea, I was looking at the MZ version of the plugin instead, oops. (Strange that the MV plugin page linked to an MZ wiki, even if it was only for terms of use.)

It looks like the MV plugin uses moveType instead of position. But it looks like that defaults to straight-line movement, which shouldn't be a problem at 0 speed...

Perhaps you're repeatedly creating one of the HP bar images (e.g. in a Parallel event that runs every frame) and that's why only one of them is behaving differently? Do you create both parts of the HP bar at the same time? If not, does doing that solve the problem?
I ment the other slash //
Now it works. When creating new hp bar, the old one is not deleted, and i am having hp bars all over the screen)
I doubt that'll help here, though.
Sadly you are correct.
Where do you think the core rain/snow weather particles come from?
Ah, yes, never thought of that. I even had to add a new folder for the weather plugin, and never thought why there is no default one.
It looks like the MV plugin uses moveType
1742971590037.png


Tried to add it like this. As far as i understand it should move image to player's position, but it does not.
Perhaps you're repeatedly creating one of the HP bar images (e.g. in a Parallel event that runs every frame)
Yes. Judging from what Shadow Dragon's experiment with slashes showed, it creates a new picture each time damage is taken.
Do you create both parts of the HP bar at the same time?
No, this is the first page of the event that creates outline, hp bar:
1742972499220.png

Then it switching to parallel image creation:
1742972516786.png

However, this second page is exactly where i am trying to put changes (as you can see slashes and movetype is apllied there). So if any of the methods (or fix picture plugin) would work, it would create image tied to map instead of coordinates on player's screen.
if it creates a new image constantly by dmg, than delete bullet for
the hub is required.

I only mess inside the demo to check every ability is has.
1 person made an entire game out of it that is smooth (he went crazy).

but I cannot really help or how to make the HP bar stays as I know 1 way).
but no idea how it really looks like or even work for that matter.
And if the player character moves, the hp bar moves to a new location when updating.
it should move image to player's position
So if any of the methods (or fix picture plugin) would work, it would create image tied to map instead of coordinates on player's screen.
OK, so...you want it tied to player coordinates, right?

Tried to add it like this. As far as i understand it should move image to player's position, but it does not.
Based on the MV plugin's help section, I think it would be moveType:"P[]"?

Also, if you want to be spawning the bar at the player's current position, rather than at (20, 20), then I think you'd use x:"P[]",y:"P[]". Alternatively, you could try skipping the x and y attributes, because spawning at the player's coordinates seems to be the default.

So maybe something like this? (Completely untested.)

QJ.BL.Shoot({ Bit:true,Max:-1,Img:"Hub1",moveType:"P[]", Name:"HPHub",initialRotation:0, scaleX:this.character(0).hp/this.character(0).mhp*100 });
I.e. no collision; no max lifetime; sync to player position; no rotation; horizontal scale = HP% of party leader; default for everything else. You would use the same call on both event pages.

No, this is the first page of the event that creates outline, hp bar:
OK, that's much clearer without all the cropping! The Parallel event just seems to be for updating the fill rate of the HP bar when appropriate.
OK, so...you want it tied to player coordinates, right?
No, that was just to test if other placements even work. Like, if it would work for any of those 4 types of commands, i could start figuring out how to do it the way i want to.

I want it to stay at one place anchored to the map, so even if player goes away it stays there.
So maybe something like this?
Not working, the hp bar is empty and nothing displayed at player position. I feel like those commands are made for something else. Or maybe they are activated via different way.

The Parallel event just seems to be for updating the fill rate of the HP bar when appropriate.
Yes. And when i modify deleting parameters it starts spawn new images without deleting old ones.

This command updates the image -

Bit:true,x:108-96+8,y:20,Max:-1,Speed:0,Img:"FIXHub1",

So as far as i understand there are no way to somehow modify fix picture so it will work with bullets instead of Sprite_Picture?

Then, i wonder, could i add the Fix Picture plugin's code into the qbullet (for personal use only, ofc) to make it change bullets placement the way it changes picture placement? Because if any image that goes trough the plugin is counted as bullet (as you said above), then it might be the only way to affect it. It should not really affect the plugin's work since all fixed pictures require prefix, so other bullets will keep working as usual.

You saw the fix picture code (it's quite short), do you think such modification is possible?

1 person made an entire game out of it that is smooth (he went crazy).
Which game is that?

Overall, not surprising, plugin is amazing and has a lot of stuff for various type of games, even tower defence. I also made an entire RE1 parody level with levels, puzzles, various enemies, even a bit of destructable environment.

But this point defence mission serves as the pinnacle of that and goes along with my game design formula of constantly changing the gameplay so the player will get to do new kind of stuff a lot.

That's why i want it to be good. But don't know if i should just leave hp bar to move around the screen and obstruct player's vision. Or should i cut the map so player's movement will be super limited (but it will became a really primitive stay-in-one-place-and-shoot map then. Or try to think of other solutions (if they exist).
Not working, the hp bar is empty and nothing displayed at player position.
I notice the original had a comma at the end of the scaleX line, I wonder if that's relevant.

And when i modify deleting parameters it starts spawn new images without deleting old ones.
I have no idea why that would happen. You remembered to uncomment (i.e. remove the // from) the deleteBullet line that you edited earlier, right?

You saw the fix picture code (it's quite short), do you think such modification is possible?
Possible? Of course. But if I don't know how the QJ plugin moves its bullets around then I have no chance of writing a plugin to pin them to the map. 😴


Maybe someone else will have some suggestions~
QiuJiu does have a Discord where you can directly ask them.
1 person made an entire game out of it that is smooth (he went crazy).
Which game is that?
Probably Soul Hero Adventure, but it also uses PKD's Alpha ABS so it's not 100 percent QJ Bullet
I notice the original had a comma at the end of the scaleX line, I wonder if that's relevant.
Sadly, still no change.
Side note - it's interesting that this comma is called "coma" in ukrainian, but in russian or polish it's an entirely different words. I wonder if it's adapted from english... but weird for such common word.
You remembered to uncomment (i.e. remove the // from) the deleteBullet line that you edited earlier, right?
Yes, of course. It's not an issue, i just said what happens if i make the change so maybe someone will have idea how to use that to solve issue.
But if I don't know how the QJ plugin moves its bullets around
Sadly i don't either. Would assume that it's the passable events. But maybe not.
QiuJiu does have a Discord where you can directly ask them.
Oh, didn't knew that. Will try, thanks. If i won't solve the issue at least maybe i can ask how bullets move.
Here is a janky solution for you but it should work for your purpose. It uses a modded MOG_EventIndicators plugin. Make a blank event where you want the HP bar to be. The HP bar will always be at that event's position. Set its own HP equal to the protected event's HP (event 2 in the demo).
1743289496816.png


Then on the second page put in an autonomous move route this script so it always updates its own hp to be equal to the protected event's hp.
1743289599853.png


Use whatever images you want for the HP Bars but they have to be in your img/eventindicators folder. I attached the two images I use for my demo

1743290038738.png
Here is a janky solution for you but it should work for your purpose. It uses a modded MOG_EventIndicators plugin. Make a blank event where you want the HP bar to be. The HP bar will always be at that event's position. Set its own HP equal to the protected event's HP (event 2 in the demo).
View attachment 335923

Then on the second page put in an autonomous move route this script so it always updates its own hp to be equal to the protected event's hp.
View attachment 335925

Use whatever images you want for the HP Bars but they have to be in your img/eventindicators folder. I attached the two images I use for my demo

View attachment 335929
YES! It works! It's alive!!!
You are truelly a script magician. Thank you so much for solving this problem!
I have one question though: when is self-switch B activated? If i put it on second page after the comment, the event does not works, but it seems like that page is needed for when event is completed to delete it. I am just don't know where should i put the self-switch activation.
I have one question though: when is self-switch B activated?
Oh, right. Put this in the move route too.
1743351437221.png

Code:
if(this.hp==0){$gameSelfSwitches.setValue([$gameMap.mapId(), this._eventId, 'B'], true)}
Oh, right. Put this in the move route too.
View attachment 335986
Code:
if(this.hp==0){$gameSelfSwitches.setValue([$gameMap.mapId(), this._eventId, 'B'], true)}
Works!
Can same be done with Wave counter? The problem that it's not an image. But it behaves like hp bar (moving with the screen).
1743352528447.png


If not, or it's hard, i will probably just delete it since unlike hp it's non-essential.
MOG_EventIndicators has a text and variable indicator comments you can use so yes
Will try to figure that out)

By the way, found one little bug and solved it. Maybe someone who will dig trough this in the future will be interested. If you remove previous hp bars, there is bullets left in place of them. Haven't found where they called in script, so i just renamed bullet0 file, and made blank image with name bullet0.

Original thread: https://forums.rpgmakerweb.com/threads/how-to-keep-image-from-script-call-fixed-and-how-to-find-part-of-the-event.176471/