Hello! I'm having some difficulty determining how to use javascript to read an event's note tag. I've searched quite a bit, but only find ways to read the game data for items, battlers, etc.
What I'm trying to accomplish is a high-speed (practically instantaneous) projectile script for the open world map. I have it checking progressively in a straight line for events that it comes in contact with an event in line with the player from their originating (x,y), it should read their note tag to see if it is "blocking," "enemy," "destructible," or what have you.
A messy little example of how I want it to run is as follows, with the "what do I do to check for them?" part at the bottom:
Any help would be appreciated, even if it's just, "Read this article," or, "You should be searching for [this]," or anything at all! Thank you for your time.
To note, I'm not against using comments in the event pages. That actually may be more beneficial, but I'm not sure if it is as easy as simply searching for a comment in an event. I know that Galv has a projectile plugin that uses this, but I also know he's a far more learned coder than I am! And, I don't want to ask for too much. But, if it's just as easy to read an event's containing comments as it is to read their note tag, I WOULD prefer that method.
What I'm trying to accomplish is a high-speed (practically instantaneous) projectile script for the open world map. I have it checking progressively in a straight line for events that it comes in contact with an event in line with the player from their originating (x,y), it should read their note tag to see if it is "blocking," "enemy," "destructible," or what have you.
A messy little example of how I want it to run is as follows, with the "what do I do to check for them?" part at the bottom:
Code:
// Find Player (x,y) and facing dir, and initiate check values
var parameters = PluginManager.parameters('FNC_Ranged_Attack');
var _startX = $gamePlayer.x;
var _startY = $gamePlayer.y;
var _startDir = $gamePlayer.direction();
var _checkX = _startX;
var _checkY = _startY;
var _attack_range = parameters["Range"];
var _rangeChecked = 0;
/* Check coordinates in an area ahead of Player (x,y)
and see if there is an event in that square
Then check for which note tag they have set and
run the appropriate function to handle damage for enemies or
facing direction / event removal for destructible objects
*/
for (_rangeChecked = 0; _rangeChecked < _attack_range; _rangeChecked++) {
if (_startDir == 2) { //Down
_checkY++;
} else if (_startDir == 8) { //Up
_checkY--;
} else if (_startDir == 4) { //Right
_checkX++;
} else if (_startDir == 2) { //Left
_checkX--;
}
if ($gameMap.eventIdXy(_checkX, _checkY) != 0){
//check event note tag, execute corresponding function
}
}
Any help would be appreciated, even if it's just, "Read this article," or, "You should be searching for [this]," or anything at all! Thank you for your time.
To note, I'm not against using comments in the event pages. That actually may be more beneficial, but I'm not sure if it is as easy as simply searching for a comment in an event. I know that Galv has a projectile plugin that uses this, but I also know he's a far more learned coder than I am! And, I don't want to ask for too much. But, if it's just as easy to read an event's containing comments as it is to read their note tag, I WOULD prefer that method.