MV Shooting system?

You type it after the > in the body of the page and hit enter
This?
1740334956542.png


I also went out of the room first to trigger the bug, guessed that no point doing it when everything works.
NaN means not a number. What are you putting in the enemy hit common event?
NaN means not a number. What are you putting in the enemy hit common event?
1740335421604.png
Could you show the bullet page too?
Also if you check HP before you shoot it does it still show NaN?
Could you show the bullet page too?
Also if you check HP before you shoot it does it still show NaN?
1740335607107.png

If i type it after first entering room and shooting, shows 25. If before shooting, shows 30.
When i re-enter room and type it, shows this. Don't mind the double, i just type it again to double check.
1740335754980.png
Is that enemy always Event 9 and hardcoded on the map or are you spawning it in?
Is that enemy always Event 9 and hardcoded on the map or are you spawning it in?
Two enemies on that map, 9 and 10. The one hit were 9. Both become immortal after re-entering the room.
If the HP is undefined that suggests the first page isn't running so some other self switch is active and the event isn't being reset
If the HP is undefined that suggests the first page isn't running so some other self switch is active and the event isn't being reset
1740338599332.png
1740338614845.png
1740338638049.png
Here is all the event.Where else can i look?
Could you put on the first page Script: console.log("First page ran")

Then check the console if it is running the first time you are in the room and subsequent times you enter the room?
Do i have to do the same in console, paste "Script: console.log("First page ran")" and press enter? If so, i am getting this.
1740341137908.png
No, you put that script on the first page of the enemy and check the console every time you load the map to see if you see that message
No, you put that script on the first page of the enemy and check the console every time you load the map to see if you see that message
I did put it on the first page, like this. But nothing shows when i enter.
I also tried to delete second enemy, didn't help. Other events on the map are note that just shows text, and dialogue that also just text and self-switch off.
1740342036109.png
1740342084339.png
Elements tab is irrelevant. Only the console matters here. Also works on my machine in the demo project so I cannot reproduce your error. There is something specific to your project causing the first page to not load. Edit: Clear out the filter field in the console tab.
1740343122746.png
Elements tab is irrelevant. Only the console matters here. Also works on my machine in the demo project so I cannot reproduce your error. There is something specific to your project causing the first page to not load. Edit: Clear out the filter field in the console tab.
View attachment 332370
Now it works, but second time i enter - it does not.
(The error with madewithmv is irrelevant, i just added 1 there so the pictures will not load for now)

I also just turned ALL of the other plugins off to make sure it is not plugin conflict. Still the same, upon second visit of the map first page does not seem to load.

But wait! Do events even supposed to be reset to the first page if they self-switch? I am pretty sure they are not, unless the plugin has the option for doing that. So maybe that option is not turned on, or not working at all?
1740343401724.png
Maybe put self switch A : OFF before or after the erase event command
Maybe put self switch A : OFF before or after the erase event command
Tried that. Also tried to put self switch b off there as well. Also tried to delete all but "group enemy" from the second page.

Ok i solved the reason. As i thought before, the self-switches do not turn off on page 2. I added the manual turn-off on action button to page 2, and after i press action button in game, enemy becomes killable. But there is no second "first page ran" in console. But i can check the hp with "$gameMap.event(9).hp"

For me it looks like a bug or flaw in design, maybe enemies are not supposed to be stationary for this plugin, and need to be spawned on the map every time player enters the room?

I think i can bypass this bug\limitation by using event spawner to spawn the enemy once map is loading, and then have a switch that will kill the spawner once enemy is dead (and maybe another switch to de-spawn it if player exist location). But i am trying to figure out how the spawner works, and i think that i understand if so far, except for the one thing - what is bid?

Update: found out that the bid can remain at zero value. Got event spawner to work, it was easier than i expected. But the problem remains the same - both newly spawned and already existing enemy become immortal upon re-entering the room. I wonder if the other plugins that are in demo should be installed? I don't know what they do, and descriptions are all in chinese.

I see that the author is on this forum, but no longer active. Tried to write to him, maybe he will see the message and hopefully know what is wrong.

Update again: i think that i found a solution, works so far. I changed self-switch on second page of the enemy to normal switch, and turning it off when player leaves the room. So you were right, events were stuck on second page without returning to first one.
So i found another bug with this plugin, and nearly lost sanity trying to understand it. But i solved it! Not without mental damage.
Here is how it went:

I have a room. If i place just 3 enemies there - everything will be just fine no matter who you kill first.

When there is more of them - things become bizzare.
So i have this layout: one enemy on the right, several at the top left, and one at the top right
NONE of them are unique, they are copy-pasted, just have different picture. That is to answer the question if just one of them can be bugged - no, it's all.

So, the bug: if i kill the enemy on the right first, and then enter and re-enter map, 3 enemy out of 4 on the top left will become immortal. If there will be less of them - there will be less immortal ones, since one of them will always not be immortal (the leftest one). But if we remove him - the rest will be immortal. The top right one is never immortal.

If you add more enemies, all new ones will be immortal in this case.

If you kill anyone else first (not the right enemy) bug will not trigger at all. That let me think that right enemy might be bugged, i removed it entirely, and it worked... or so i thought.

It appears that bug still triggering if you kill certain enemies first (and then re-enter the room). So even if you remove the right enenmy (who 100% triggers the bug) it's "curse" will be transferred to someone else. But now the immortal ones will also be other enemies than usual.

Then i tried to replicate bug in other room, and - it's the same, there is always just one enemy of all placed who will trigger the bug, and certain enemies that will be affected by it (this time out of 5 enemies places only one were affected).

I also managed to replicated it in demo! Sort of. Here things getting even more bizzare. So how do i replicated it:

Made 2 maps. Teleport between them. Then took enemy from enemy map and copy-pasted it 5 times. Started the game, killed one enemy, exit map, go back. The enemy i just killed appeared again and can be killed, all the others become immortal.

Then i tried to make it my way (via switch instead of self switch) and... it worked just fine! Or so i thougt. For some reason bug also triggered, but enemies were only immortal against the gun, but flamethrower killed them.

But then i started removing and adding things from those enemies and finally figured out a solution.
Adding erase event at the end was a mistake. If i switch it with self-switch to empty page, bug disappears and i can place as many enemies as i would like.

I still don't know what exactly happened: why only certain enemies triggered the bug, why only certain were becoming immortal, or why the flamethrower could still kill them. But will leave this story here just in case someone will also think that he is going crazy trying to figure this out.
Hello again! @AquaEcho ! Is there any chance that you know what this error is about?
From what i read on forums - it is about something in the code being undefined. But i checked all the changes i made and failing to understand where it go wrong.
1742407325366.png
Syntax errors mean there's usually a missing or extra grammatical symbol, e.g. , ; { '
JSON error means it relates to an object which would most likely be a bullet. I would look over your bullets and see if there's anything mistyped.

It could also be a spawned event since that's in the error stack

Original thread: https://forums.rpgmakerweb.com/threads/shooting-system.175564/