Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Focused Sound Effects for RPG Maker MV and MZ

Play sound effects originating from specific spots on the map! · By HeroicJay

Manual script calls?

A topic by hotdawg games created 5 days ago Views: 24 Replies: 3
Viewing posts 1 to 3

Hey, this plugin is sick. However, the lack of manual script calls is a bit limiting as I'd like to set the target for the sound effect based on a variable or a value from another plugin (Eli Self Variables in particular, which I'm pretty sure shouldn't be an issue if I can write out the script call). I saw the function in the plugin file but it's pretty large and I don't think there's a way to trigger it via a call currently? I tried in the console but to no avail. Anyway, if you're able to add a written call it would be awesome. Thanks in advance!

Developer

I don't think I get what you mean by "manual script calls" - do you mean trying to access the functions directly through the "Script" command in RPG Maker? - I think what you're actually asking for is the ability to use a variable (or some sort of evaluable JavaScript) in the plugin command to refer to an event, instead of hardcoding it. This is a feature I could consider adding if so.

I did not design the plugin around calling the AudioManager.playFocusedSE function directly from outside the plugin, but if you really insist it could be done without any updates. 

Option 1: In MV format the "args" as a string exactly like how you would call the script in the first place. (This would be simpler in MZ, where the args are passed as an object, rather than a string.) 

Option 2: Don't include any sort of location/event data in the args whatsoever and pass the location of the event you're trying to use as a source to xCoord and yCoord. The other args would still need to be set up correctly.

Option 3: If you have the event object in your code as, let's say "loudEvent", then call "loudEvent.playFocusedSE('the parameters you would give to the plugin command')", which is what is used for custom move routes; this would need to be a formatted string even in MZ.

Yes, script commands in MZ.

Those options are a little bit complicated in all honesty but yeah if you're able to make a way to just feed code into the plugin commands in the same way as with the interpreter in the vanilla script command it would be pretty awesome. Right now doing modular stuff with this plugin takes a lot of workarounds that bloat my events and that has been a headache

Developer

To tell the truth, I gave it some thought, and I actually do think the idea is solid. More ways to refer to events can't hurt. I don't want to bog down the UI or instructions for more basic users, so here are some thoughts that went through my head:

1. $v# would get interpreted as the RPG Maker variable with the given ID (for example, $v4 would tell it to use the value in variable 4.)

2. If you put something in (parentheses), it is evaluated as Javascript code.

And, of course, anything else is treated like an event ID if it's a number or an event name if it isn't, which is how it already works. I could implement either or both of the above. (But not right now; it's late.)