Event/Variable/Plugin Interaction

I'm using SumRndmDde's Summon Core plugin to...well, create a summon skill. What I would like to achieve is that the skill summons a different actor depending on the terrain type (tileset) of the map. From poking around, I think that information is in gameMap._tilesetId for me to evaluate. The question then is how I can implement it. Obviously, some of this stuff I can just start typing into my database and blindly test, but that takes time to keep changing things and rebooting so I figure I'd ask first.

I figure the way to do this is to have the skill call a common event, which will evaluate the tileset and set a variable to be used as the actor ID I'm summoning.

1) How can I tell from reading through a plugin whether a given notetag field accepts Javascript? He says explicitly that several of his notetag fields do, but he doesn't mention about the field to specify the actor you're summoning. If I can just use that one notetag and say the actor being summoned is the variable I'm using in the common event, that would be easiest.

2) How can I activate a skill from inside an event? I see commands to set skills and such, but not to activate one, but I figure there must be a script function call for it. The less-desirable option would be to make a different summoning skill for every possible tileset, have one that the player learns, and that calls a common event which activates one of the other skills depending on the player's tileset.
1. Generally if it doesn't specifically say, it probably doesn't. But most notetag fields in plugins which do accept JavaScript will use "eval" so it can help to search for that. Summon Core does so for the actor ID, so you can enter JavaScript here and it should in theory work.

2. Sounds like you want the "Force Action" command.
1. Generally if it doesn't specifically say, it probably doesn't. But most notetag fields in plugins which do accept JavaScript will use "eval" so it can help to search for that. Summon Core does so for the actor ID, so you can enter JavaScript here and it should in theory work.

2. Sounds like you want the "Force Action" command.

Thanks! I was focused on something about skills since that's what they're called in the database, I glazed right over Force Action.

Since it does use eval for the Actor ID, would the formatting be $gameVariables.value(id)?
Force Action is only usable within a battle.

I think you need to turn it around, and rather than activating a skill from within an event (in that case you'd just have commands to do the plugin call), look at attaching a common event to the skill and execute the commands in the common event. Then the player can use the skill on any map, and the common event will run.

I've moved this thread to Javascript/Plugin Support. Thank you.

Force Action is only usable within a battle.

I think you need to turn it around, and rather than activating a skill from within an event (in that case you'd just have commands to do the plugin call), look at attaching a common event to the skill and execute the commands in the common event. Then the player can use the skill on any map, and the common event will run.

This is only a battle skill. Within battle, you summon a helping actor who goes away at the end of the fight.
Thanks! I was focused on something about skills since that's what they're called in the database, I glazed right over Force Action.

Since it does use eval for the Actor ID, would the formatting be $gameVariables.value(id)?

With it using eval, you can use basically any valid JS code. So $gameMap._tilesetId would work, for example, but obviously if you used that you would have to make sure all your summon actors had the same IDs as their tilesets. You could do an if or switch statement that would return different values depending on what the tileset ID is, though.
With it using eval, you can use basically any valid JS code. So $gameMap._tilesetId would work, for example, but obviously if you used that you would have to make sure all your summon actors had the same IDs as their tilesets. You could do an if or switch statement that would return different values depending on what the tileset ID is, though.

I'm figuring I will have the actual Skill Effect call a common event that will set a variable depending on the map's tileset. I will then have the skill's notetag use that variable as the actor ID to summon.
Ah, then yeah. Set your summon actor ID to $gameVariables.value(id of variable you're using)

One potential issue: I believe common events are called after skill execution, so it'll try to do the summon effect before the variable is set.
Ah, then yeah. Set your summon actor ID to $gameVariables.value(id of variable you're using)

One potential issue: I believe common events are called after skill execution, so it'll try to do the summon effect before the variable is set.

That appears to be what's happening, it's getting a null result from the variable. I'll either go the other route with forcing the activation of another skill, or I'll have the battles set the variable at turn 0. I think I saw a plugin someplace to define some actions to always happen every battle...
Yeah, a turn 0 troop event will do the trick.
This is only a battle skill. Within battle, you summon a helping actor who goes away at the end of the fight.
Ah, no worries. When I read about terrain types and maps, my mind went to spawning events.
Ah, no worries. When I read about terrain types and maps, my mind went to spawning events.

I understand 🙂

It all works perfectly, thanks for the assist.
Always happy to be of assistance, glad you got it sorted. 🙂

Original thread: https://forums.rpgmakerweb.com/threads/event-variable-plugin-interaction.124227/