Each arrow event runs the event it points to when interacted with. Those arrow events can be freely copied and pasted anywhere, allowing for quick creation of large interactables. The arrows sprites themselves won't render in-game.
This, and much more, is possible with this plugin!
Introduction
Run Nearby Event allows you to run regular events the same way you would run common events, in a lot of different ways. It gives you a plugin command to, you guessed it, run a nearby event. It also allows you to run an event with a given id if it's not nearby, an event of a given name or notetag, to run a specific page of that event instead of the currently active one, or to create regions that act as very large events. The included help file should explain exactly how to use it - this post will mostly try to explain why you'd use it, with some examples.
In general, everything this plugin allows you to do would of course be possible without it, albeit with a lot more common events, variables, or copies of events. But with it they become a lot simpler and more pleasant to do.
Spoiler: Large interactables
The most obvious use case for the plugin is of course making larger events to interact with, like in the image above. This is of course possible without it, but rather annoying either way you do it. You could have multiple copies of an event, but this will make it more taxing to modify it, not allow you to use self-switches, and be a pain to debug if you ever forget to copy over some changes. You could use a plugin to extend the hitbox, which is better, but it will require fiddling around with event notetags and won't be visible in the editor, requiring extensive testing to make sure you got those hitboxes right. Or you could click on an arrow event, press Ctrl+C, select the square you want to be the extension of an event and press Ctrl+V
Ok, but how would you make those arrow events? Like so:
The first page will never become active in-game, and is only there to display the arrow in the editor. You don't have to include it, but it does make it a lot easier to work with.
Also, make sure to set the correct priority on the second page (I kept forgetting about that back when I made this feature)
For the sprites, you can make your own arrows, or use the ones I've made:
Save this image as $arrows.png in the characters folder and you're good to go. You're free to use this image for any purpose, it's just arrows I made in GIMP in a few minutes
The way I tend to use them is that blue arrows are used in events that have "Same as characters" priority, and run the event that they point to and is right next to them. Those can be freely copied and pasted. Red arrows are for events that are not meant to be copied, because they are somehow different, e.g. they run an even a few tiles away, have a different priority or trigger. Though of course you're free to use them however you want.
Another thing of note is that you can chain such events, as seen in the image on top of the post. An arrow event can run another arrow event, which will run the next arrow event etc. This will all happen on a single frame, so you can have a chain with 200 of them and it shouldn't cause any lag (as to why you'd have a chain 200 long is another question).
Spoiler: Other uses
Wondering what else you can use this plugin for? Here's a bunch of ideas.
Most of those could also be done with common events, if you don't mind having a lot of these. I just think that common events should only be used for things that are actually common throughout the project, and if an event is only used on one map, it should go on that map. You don't have to agree with that opinion, but you'll find this plugin considerably more useful if you do
1. You have a warehouse with a bunch of boxes, and would like the same interaction for all of them, but can't use arrow events because they're all over the place. Just use
RunEvent id
复制代码
, and enjoy your single reaction event that you can easily modify.
2. Like the above, but you want one reaction when looking at specific create for the first time, and another if you've already looked at it before. You can can use a self-swich for each crate, and have that determine which event/page to run.
Spoiler: Crate example
The crate event (presumably you'd have a lot of these):
The single reaction event:
No switches, variables, or common events needed
3. A group of 4 NPCs talking to each other. Talking to one of them will get you the reaction from them specifically, and then, regardless of who you talked to, transition to the same conversation involving everyone by just running the event in the middle.
4. Turning any tile into a "counter" tile (allowing you to talk to NPCs across it) with
RunEvent facing
复制代码
.
5. A merchant with a complex way of selling you things (e.g. lots of conditionals, or maybe an evented UI), with a fair amount of dialogue the first time you meet him, who will want to jump straight to business afterwards. So the first time you talk to him, there's a long introduction scene, and then the selling you stuff part. The second time there's just the selling you stuff part. It would be nice to have the introduction and selling on separate pages, but then how can you have both happen when you first talk to him? Simple: at the end of the first page (after setting a self-switch activating the second page), use
RunEvent this
复制代码
.
6. A magical crystal of randomness, that when interacted with will do something random, either good and bad, and will also cause the party to discuss the outcome. You could set a random variable to 1-10, and then have 10 very long conditional branches with the consequences. But a nicer and more manageable way is to set that variable to 2-11, and run another page of the event depending on the result.
Spoiler: Random crystal example[quote]
The event will first ask the player if they want to use the crystal, then the commands on the randomly chosen page will play out, and then the "I hope you enjoyed the randomness crystal" dialogue will play.
As you can see, the other pages don't need to have an image or priority set - only their commands are run.
7. A riddle that tells the player to check a specific tree in a forest. That tree will have a special reaction when interacted with, but it would be nice to create a reaction for every wrong tree as well. Since there might be a lot of them, you can paint them all with a region (let's say region 42). Then create an event with the reaction for investigating the wrong tree, and give it the notetag <Region:42>.
Hopefully these examples will give you an idea of what you can do with this plugin. I've had this feature in my game for a long time, and the idea that events can just freely run other events has become really intuitive for me. I actually struggled a bit with explaining exactly why you'd want this, since I use it for nearly everything
[/quote]
Spoiler: Removing a trigger from events
When using this plugin, you might often want to create an event that's triggered by other events, but never by the player directly. Usually you can put it in an unreachable area, but sometimes on wide open maps that might be difficult. In my game, I've made it so that events that have an action button trigger, are below or above characters and have "through" enabled are not interactable. When making this plugin I've realised that this might be a bit cursed for some people, so while it remains an option (off by default), you can instead make events uninteractable with a <NoTrigger> notetag.
Spoiler: More technical notes
On top of the plugin command, you can also use this plugin's functionality with a script call - details in the help file and the JSDocs comment in code.
This plugin overwrites
Game_Player.prototype.startMapEvent
复制代码
, unless the
Events with trigger "none"
复制代码
option is set to
Disabled
复制代码
.
The events are started as children of existing events, similar to common events. The increase in depth however is prevented, to leave the full amount for potential common event shenanigans. Instead a custom interpreter property
chainLength
复制代码
is used to detect infinite loops.
Spoiler: Terms
The plugin is available under the MIT Licence - you're free to use it in your non-commercial or commercial games, or use the code in your own plugins. Credit is appreciated, but not required.
Please let me know if you have any problems with it, have suggestions for new features, or would simply like to share how you're using it. There are probably plenty of uses for it that I haven't thought of, and I'd really like to hear about them