MV how to detect the position, how and when a projectile launched by the player disappeared?

I noticed the "size" parameter is set to 666, I'm not sure how it is measured but it's likely a very big hitbox. is this on purpose? try to change it to null , it could solve the problem
I noticed the "size" parameter is set to 666, I'm not sure how it is measured but it's likely a very big hitbox. is this on purpose? try to change it to null , it could solve the problem
well that worked thanks but no event is generated
well that worked thanks but no event is generated

That could be an issue related to the spawner plugin

the help file says:
"When spawning an event, it's important to know that if the location is blocked by impassible terrain, the player or any other event - it will not spawn unless you have previously changed Galv.SPAWN.overlap script call to one of the settings that allows it to overlap things."

Just by looking at your map, I'm guessing the 100 region is covering impassable tiles so that might be it.
add Galv.SPAWN.overlap = 'all' above Galv.SPAWN.event(5,tx,ty) in my plugin and see if it works
That could be an issue related to the spawner plugin

the help file says:
"When spawning an event, it's important to know that if the location is blocked by impassible terrain, the player or any other event - it will not spawn unless you have previously changed Galv.SPAWN.overlap script call to one of the settings that allows it to overlap things."

Just by looking at your map, I'm guessing the 100 region is covering impassable tiles so that might be it.
add Galv.SPAWN.overlap = 'all' above Galv.SPAWN.event(5,tx,ty) in my plugin and see if it works
still didn't work :/
Hmm... try to add "else" to the code here:

Spoiler: code
Sprite_MapProjectile.prototype.checkHitEvent = function() {
// Basic checking for events
var tx = Math.floor(this._obj.x / Galv.PROJ.tileSize);
var ty = Math.floor(this._obj.y / Galv.PROJ.tileSize);

// check regions
if ($gameMap.regionId(tx,ty) == 100) {
Galv.SPAWN.event(5,tx,ty);
} else

if (this._obj.regions.contains($gameMap.regionId(tx,ty)) || this._obj.terrains.contains($gameMap.terrainTag(tx,ty))) {
this.doHit();
return null;
};

var events = $gameMap.events();
var event = null;
for (var i = 0; i < events.length; i++) {
var dis = Galv.PROJ.dist(events.screenX(),events.screenY() - Galv.PROJ.eYOff,this.x,this.y);

if (dis < this._hitDist && events != this._obj.sTarget && this.isBlockerEvent(events)) {
event = events;
break;
};
};
return event;
}
Hmm... try to add "else" to the code here:

Spoiler: code
Sprite_MapProjectile.prototype.checkHitEvent = function() {
// Basic checking for events
var tx = Math.floor(this._obj.x / Galv.PROJ.tileSize);
var ty = Math.floor(this._obj.y / Galv.PROJ.tileSize);

// check regions
if ($gameMap.regionId(tx,ty) == 100) {
Galv.SPAWN.event(5,tx,ty);
} else

if (this._obj.regions.contains($gameMap.regionId(tx,ty)) || this._obj.terrains.contains($gameMap.terrainTag(tx,ty))) {
this.doHit();
return null;
};

var events = $gameMap.events();
var event = null;
for (var i = 0; i < events.length; i++) {
var dis = Galv.PROJ.dist(events.screenX(),events.screenY() - Galv.PROJ.eYOff,this.x,this.y);

if (dis < this._hitDist && events != this._obj.sTarget && this.isBlockerEvent(events)) {
event = events;
break;
};
};
return event;
}
Sorry for the delay, it still didn't work, am I doing something wrong?
Will the shots have to end right in the middle of a tile? for the event to be cloned?
and if instead of it generating the event on top of the projectile, it generates it in an isolated corner of the map and takes it to the place where the shot disappeared?
I meant add Galv.SPAWN.overlap = 'all' above Galv.SPAWN.event(5,tx,ty) in my plugin, not in the event command (it shouldn't matter, but try it just in case)
also check the console (shift+F8) for any error messages
I meant add Galv.SPAWN.overlap = 'all' above Galv.SPAWN.event(5,tx,ty) in my plugin, not in the event command (it shouldn't matter, but try it just in case)
also check the console (shift+F8) for any error messages
well that didn't work either
and if you do it through events? the player's trigger would be a loop event that would move one step to where the player is looking, the only problem would be the interaction with events, could there be some way to check if the page that is being executed of the event (in this case the trigger) has some specific comment, and if there is an equal comment on the current page of another event (an enemy for example) the two events would activate a local switch

do you think it would be easier? and if it would be possible to make this kind of interaction?
something like:
I forgot to show you, but this is what appeared on the console:
I forgot to show you, but this is what appeared on the console:
It looks like either I made a typo or you didn't copy the code correctly...
I'll write it again on my text editor and attach the entire file
It looks like either I made a typo or you didn't copy the code correctly...
I'll write it again on my text editor and attach the entire file

ok, do you need anything?

@viniciusan9elin, please avoid double posting, as it is against the forum rules. You can use the "Edit" function on your posts to add additional information you've forgotten or respond to multiple people. You can review our forum rules here. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/how-to-detect-the-position-how-and-when-a-projectile-launched-by-the-player-disappeared.157324/