Script Call that affects the current event without specifying event ID

it's all in the title, like, how would you write$gameMap.event(45).setPriorityType(1); so that I can reuse it without having to change the event number every time a new event uses it
You can replace $gameMap.event(45) with:
  • this (in a move route, for the character being moved); or
  • this.character(0) (in a Script command, for "This Event").
I don't have MV up right now, but I think this should work if you're using it on the event in question:
Code:
$gameMap.event(this.eventId())
Edit: caethyril beat me with a more classy option! 😀
You can replace $gameMap.event(45) with:
  • this (in a move route, for the character being moved); or
  • this.character(0) (in a Script command, for "This Event").
it worked thank you so much
Great, you're welcome! 👋

Code:
$gameMap.event(this.eventId())
Note that this is slightly different from my suggestion. this.character(0) returns null if This Event is not on the current map. In that case, your script call might return a valid reference to a different event, on the current map. That might be useful in niche cases, if you're careful with event IDs.

Original thread: https://forums.rpgmakerweb.com/threads/script-call-that-affects-the-current-event-without-specifying-event-id.168358/