[XP] Reading an event's name

Started by Cyanard, October 13, 2026, 01:04:59 am

Previous topic - Next topic

Cyanard

October 13, 2026, 01:04:59 am Last Edit: October 13, 2026, 08:02:20 pm by Cyanard
I'm looking for a script that's able to read the inputted name atop an event, as in this part:

I want to be able to name an event something, and when a common event is called, it reads that name and performs a particular effect. Basically, it gives the event its own characteristic / type of object through the assigned name

I have attempted to make something work before reaching out for a request, but I'm unexperienced, so it simply kept giving me errors. I do know, however, that RPG::Event is where the names are stored, but I can't figure out how to pull the names from there

My only specifications is that the script call shouldn't require adding an ID to identify which event it is, as the script call will be put directly on the events themselves

KK20

Is your map event calling a common event to then do something upon that map event? If so, then you can use a conditional branch > script to check for "Door" like so:
$game_map.events[@event_id].name.downcase == 'door'

Or are you trying to call a common event that then does something to ALL the events on the map named "Door"?

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Cyanard

October 14, 2026, 08:38:05 pm #2 Last Edit: October 15, 2026, 03:19:47 pm by KK20
Quote from: KK20 on October 14, 2026, 03:25:57 amIs your map event calling a common event to then do something upon that map event? If so, then you can use a conditional branch > script to check for "Door" like so:
$game_map.events[@event_id].name.downcase == 'door'

Or are you trying to call a common event that then does something to ALL the events on the map named "Door"?

I mean the former, yeah. The common event is put on map events, it reads the event's name and then they perform universal actions depending on the name given

However, the problem is that, by default, there's no .name attractor in Game Event, Map, Character, etc. that correlates to the name put as the event's name

Game Actor DOES manage to pull names, and the manual also has a page for RPG::Event which shows that the value does exist, I just haven't been able to figure out how to pull it

EDIT:
Ohhhhhhhh dammit, I just realized the solution to this is incredibly simple

Copying what Game Actor did to get the names but in Game Event

KK20

Oh yeah, forgot about that tidbit. I just opened up one of the dozens of projects on this computer and it happened to have that method already defined. Nice work figuring it out on your own :)

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!