MV Shooting system?

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
Thank you! It seems like it was my fault, one of the event that were supposed to spawn were deleted, maybe by accident.

I have another question, hopefully final. It's about the hp bar in protect mission. I found where i can change it's coordinates, but when enemy reduces the hp and player's screen is moved, the hp bar also moves to a new location. It is possible to not do that?
I tried changing other parameters randomly, but without much success in finding out what they do, only managed to make it disappear at all. I think it should be somewhere on page 2, logically - anchorx, but when i change that hp bar just disappears. Same problem happens with wave counter, but the 3-nd image, the outtline of the hp bar always stays in place.
Here is the entire code -
1742409628673.png
1742409599869.png
@AquaEcho one more question, please.When i set up the player-shooting event, hit on the player does not register, and hp of the player are not reduced. I directly copied the event without modifying for now to exclude any possible errors.

I tried to read instructions but failed to find anything related to player damage, there is only player offset and hitbox script commands description.

I believe that the problem is with setting up the player's hit global event. Seems like simply copying it is not enough to make it work.
It seems like the script you provided is served to activated it, but i failed to get it working, it gives me errors. Also i tried to find this command in the demo to see how it is done there, but... failed to find it. I checked all the events on the map and could not find it anywhere.
Code:
Code:
 "C[commonEvent id,value1,value2......]":start commonEvent and pass in parameters.
             (1) You can get the parameters in commonEvent. e.g:  this.BP[1] refer to value1.
             (2) You can use this.EID to get the Target character id.
                 -1 refer to player.the number greater than 0 refer to event.
             (3) Use this.bullet.x/this.bullet.y to get the x/y of bullet when it diasppears.
1743966521362.png
What does your common event 12 look like and why are you passing in 3 numbers in the brackets?
What does your common event 12 look like and why are you passing in 3 numbers in the brackets?
Here it is, i even gave it same name as original. I only do not know what variables do, i understand that they somehow calculate damage but i don't understand the logic behind them. So i just left them untoched apart from setting the variable (tried not changing as well, still not working).
1743971030553.png
I passed them because i thought it's an explanations for values above, aka value1.
This is how it should look? Still stays "invalid or unexpected token"
1743970994971.png
The event page looks ok although the third value you passed in the parameter does nothing. The first is your common event number and the second you set as your damage value in the common event. You could use a third value for something if you wanted but you are not right now.

It needs to be inside the bullet object. This is what my enemy bullet looks like.
1743971681908.png
The event page looks ok although the third value you passed in the parameter does nothing. The first is your common event number and the second you set as your damage value in the common event. You could use a third value for something if you wanted but you are not right now.

It needs to be inside the bullet object. This is what my enemy bullet looks like.
View attachment 336583
Mine looks the same.
1743973083232.png

It shoots bullets, but does not do damage.
Where exactly do i add the script from my message? I do not see it in your enemy.
Mine looks the same. View attachment 336585
It shoots bullets, but does not do damage.
Where exactly do i add the script from my message? I do not see it in your enemy.
Yours does not look the same. Look at mine where the action property is in the bullet object
Yours does not look the same. Look at mine where the action property is in the bullet object
Thank you! Sorry, it was my mistake, somehow i overlooked that one of the lines had addition. Now it works!
@AquaEcho Ran into another weird issue, with the Meteorite Dart. If i use it in my project, it does not work propely, only harmless dart are being shot, but no meteorites follow. That happens both if player and even using it. My theory that it uses some kind of additional process to summon meteors, but i failed to find such. There aren't anything else in global events, or map events in the demo.


I even tried to copy entire crystal from the demo that lets you select this weapon, yet still only dart is fired. The meteorite part is missing and i don't see even a hint on what it might be. Maybe you know?
Or if someone has discord contact of the Qiujiu, maybe you can ask him that question for me? Because it seems like he no longer accepts incoming friend requests.
Previous messages can be ignored cause that is (sort of) solved. Meteorites now appear, not exactly like in demo, but that kinda will do.

Instead, i have yet again problems with hitting the player. Please, send help!


First is the meteorite. It refuses to make damage. At all.
This is the code -
1746566067134.png


This time i have action command that refers to the same common event as gunshot (12). But nothing happens, not even hit animation on player.

Next one is sword. It sort of works, but only one sword appears at the enemy and does damage.
I believe the problem is in event structure, i am doing it wrong, but if i try to put additional code somewhere at the beginning, like this for example -
1746567012132.png


I am getting the unexpected token error.
And when i am putting it like this:

1746567153598.png


It works but just a single sword appears at the enemy, rest appear at player's position and do not do damage.

Since each line seems to reffer to individual sword, i tried adding
Target:["P[]"],
at the end of first 3 lines, but it simply does nothing at all. I don't understand why. When i try to put action there i am getting unexpected token errors there as well.

And the last is this one, rainbow spiral -
1746568194803.png


It refuses to start from the enemy and always starts from the player instead. Also refusing to do damage.

I know i have a wrong target here, but if i change it to the player, the animation does not play at all, and i just instantly receive damage when enemy using this ability. If i remove target entirely it still spawns from the player.

Logically the initial rotation parameter should determine the spawn origin, but if i set

initialRotation:"E[5]",

Nothing changes, it still spawns from the player.
I feel like you do not read the plugin instructions or stop and think why code does what it does. You also don't post relevant information like the common event for the collision or the console error log when you say you get an error. A lot of times the answer is right in front of you.

For example
Next one is sword. It sort of works, but only one sword appears at the enemy and does damage.
I believe the problem is in event structure, i am doing it wrong, but if i try to put additional code somewhere at the beginning, like this for example -
Why does only one sword appear at the enemy? Because only one of your swords used the x: E[5], y: E[5] bullet properties. Right there is the answer to half your problems. Why is it also the only sword that does damage? Because it's also the one that has an action property with the common event note that does the damage to the target.
Logically the initial rotation parameter should determine the spawn origin, but if i set

initialRotation:"E[5]",

Nothing changes, it still spawns from the player.
No, initial rotation is exactly what it means. The bullet rotates towards what you put. That will make it so the bullet will start rotated toward event 5.
Code:
initialRotation:The default is "PD[]".The initial rotation of bullet.
...
"PD[]":Same as the direction of player.
 "E[event id]":Aim at the direction of event from (x,y) below.

The plugin instructions say
Code:
x/y:The default is"P[]"The initial x/y coordinate.
         "M[]":refer to x/y coordinate of mouse.
         "P[]":refer to x/y coordinate of player.
         "E[event id]":refer to x/y coordinate of event.0 refers to this event.
It told you the default "spawn" position is the player and to use E[event id] to make it an event position.
I feel like you do not read the plugin instructions or stop and think why code does what it does. You also don't post relevant information like the common event for the collision or the console error log when you say you get an error. A lot of times the answer is right in front of you.

For example

Why does only one sword appear at the enemy? Because only one of your swords used the x: E[5], y: E[5] bullet properties. Right there is the answer to half your problems. Why is it also the only sword that does damage? Because it's also the one that has an action property with the common event note that does the damage to the target.

No, initial rotation is exactly what it means. The bullet rotates towards what you put. That will make it so the bullet will start rotated toward event 5.
Code:
initialRotation:The default is "PD[]".The initial rotation of bullet.
...
"PD[]":Same as the direction of player.
 "E[event id]":Aim at the direction of event from (x,y) below.

The plugin instructions say
Code:
x/y:The default is"P[]"The initial x/y coordinate.
         "M[]":refer to x/y coordinate of mouse.
         "P[]":refer to x/y coordinate of player.
         "E[event id]":refer to x/y coordinate of event.0 refers to this event.
It told you the default "spawn" position is the player and to use E[event id] to make it an event position.

Thank you! Somehow i misunderstood initial rotation as initial spawn point. That is because instructions do not really clarify what rotation means. From my knowledge it can mean moving an object from point to point, like troop rotation. And i was thinking about that. The other meaning of it known to me is spinning, like a helicopter blade, and it does not really fit for what it does. It would be better if it was named something like initial aim target.

I also figured out the case of error in sword event, it's because i need to put new lines between every first and second, not after second. Probably because i was using the end characters wrong (i just copied those), i don't really know why it didn't work, but that's not important.

So swords now work perfectly, and the spiral also starts from the enemy! I also fixed the spiral, and now when changing target to the player - it properly does damage now! However, sometimes you can walk right trough it without getting hit. But i guess that is some kind of internal bug maybe.

And i found out why meteorites were not doing damage as well! It apears that their damage should be set inside the plugin settings instead of event settings.

So thank you a lot for the explanation, and sorry for being stupid and missing obivous stuff.

However, i still don't understand what command responds for meteorites falling and how can i add a fourth one to the circles that are closer to the starting point. Sadly the notes do not explain how specific bullets work, and i can't grasp that from the general logic. So i will be grateful if you will point me out to the line that are responcible for their amount.
However, i still don't understand what command responds for meteorites falling and how can i add a fourth one to the circles that are closer to the starting point. Sadly the notes do not explain how specific bullets work, and i can't grasp that from the general logic. So i will be grateful if you will point me out to the line that are responcible for their amount.

This is the event page for the meteorite dart.
1746646047539.png

It uses MoveQT with the "redCircle" text preset
Code:
 MoveQT:The default is [].Specifies that after the bullet moves to a few frames, it starts
         to execute the instruction of 'preset text id' every few frames.
         Base format:
         [wait time before circling,waiting interval,preset text id]
         e.g:     [[10,5,"test1"]]
         After the bullet runs for 10 frames, execute the instruction of 'preset text id' test1
         once, and then execute the instruction of 'preset text id' test1 every 5 frames

The text presets are in the plugin settings.

1746646441725.png


What's happening is the meteorite dart is creating a red circle every 12 frames along its path, then firing (or spawning) a second bullet for the falling meteorites themselves at those red circles' positions after a 50 frame delay.
So it's based on frame count. If you want more meteorites you need to adjust the frame count numbers.
This is the event page for the meteorite dart.
View attachment 339793
It uses MoveQT with the "redCircle" text preset
Code:
 MoveQT:The default is [].Specifies that after the bullet moves to a few frames, it starts
         to execute the instruction of 'preset text id' every few frames.
         Base format:
         [wait time before circling,waiting interval,preset text id]
         e.g:     [[10,5,"test1"]]
         After the bullet runs for 10 frames, execute the instruction of 'preset text id' test1
         once, and then execute the instruction of 'preset text id' test1 every 5 frames

The text presets are in the plugin settings.

View attachment 339795

What's happening is the meteorite dart is creating a red circle every 12 frames along its path, then firing (or spawning) a second bullet for the falling meteorites themselves at those red circles' positions after a 50 frame delay.
So it's based on frame count. If you want more meteorites you need to adjust the frame count numbers.
Thank you, that works, but, sadly, does not solve the problem. It seems like i misunderstood the issue - instead of being not enough meteorites for every red circle, it seems like the first 2 or 3 circles gets ignored. So when i spawn more meteorites, they still fall away from the first circles.
1746652122742.png


Like this, the player position has no meteorites fall on it and takes no damage.

I would assume that first number in moveQT has to be changed, since it specifies how much frames bullet moves before executing instructions, but in main event it's already zero, and in the redcircle event i tried changing 50 to 10 and it had no effect.

I also tried to change the x and y from the redcircle event since i don't even know what current "this.screenShowY()," even suppose to do - it's not in help file. Changed to even position, but then circles started to appear only at the enemy.

I don't know what else i can try changing since all other parameters look like cosmetics. Do you know which value represents starting circle for meteorites to fall in?
I also tried to change the x and y from the redcircle event since i don't even know what current "this.screenShowY()," even suppose to do - it's not in help file. Changed to even position, but then circles started to appear only at the enemy.
It says in the help file
Code:
 * 7.The content of DeadQT/MoveQT/UpdateQT or DeadJS/MoveJS/UpdateJS can contain below phrase:
 *   this.screenShowX()   refer to the x coordinate of bullet.
 *   this.screenShowY()   refer to the y coordinate of bullet.
It says in the help file
Code:
 * 7.The content of DeadQT/MoveQT/UpdateQT or DeadJS/MoveJS/UpdateJS can contain below phrase:
 *   this.screenShowX()   refer to the x coordinate of bullet.
 *   this.screenShowY()   refer to the y coordinate of bullet.
Oh. Again i am being stupid, didn't thought to look in other places.

Have one more question, unrelated to previous. In plugin settings there are player offset setting that defines bullet spawn point. However, it becomes problematic when character turns around because the offset point remains the same. Is there no way to customize it for different direction? Or, perhaps, there are some script command for setting the offset, so i can make a parallel event that will check player direction and change the offset every time it changes?

I already tried to use this with no effect -

QJ.Bullet.params.playerPresetOffset = x:'E[30]',y:'E[30]',

Does nothing as plugin command, and as a script call gives unexpected token -
1746718138795.png


This is to better understand what i am talking about -
I'm not sure if that offset takes a variable because you would have to have variable offsets based on player's facing direction. It is probably better to use the MoveJS script to have a 30 frame delay or so in the first parameter so the bullet doesn't "start" until 30 frames after the player fires it.
how do your character sheet looks like, I think the issue comes from there.
same for up/down probably, if incorrectly.
I messed up again, but don't understand where.
Here is 2 events that are nearly identical.
1
1753365964524.png

1753365982301.png

1753366009705.png

2
1753366033838.png

1753366050885.png

1753366069683.png

But the residual shadow is being cast only in first one, second works without the shadow. Why? Everything is the same!

Another thing i notices is that the shadow disappears entierly when character enters the bush tile (that covers their lower part). That i don't understand as well, but the issue above is more important for now.

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