Event/Variable/Plugin Interaction

ATT_Turan

Veteran
Veteran
Joined
Jul 2, 2014
Messages
89
Reaction score
39
First Language
English
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.
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
2,604
Reaction score
1,961
First Language
English
Primarily Uses
RMMV
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.
 

ATT_Turan

Veteran
Veteran
Joined
Jul 2, 2014
Messages
89
Reaction score
39
First Language
English
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)?
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,108
Reaction score
13,713
First Language
English
Primarily Uses
RMMV
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.
 

hiddenone

Lurker Extraordinaire
Global Mod
Joined
Feb 19, 2014
Messages
2,496
Reaction score
5,332
First Language
english
Primarily Uses
RMMZ

I've moved this thread to Javascript/Plugin Support. Please be sure to post your threads in the correct forum next time. Thank you.

 

ATT_Turan

Veteran
Veteran
Joined
Jul 2, 2014
Messages
89
Reaction score
39
First Language
English
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.
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
2,604
Reaction score
1,961
First Language
English
Primarily Uses
RMMV
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.
 

ATT_Turan

Veteran
Veteran
Joined
Jul 2, 2014
Messages
89
Reaction score
39
First Language
English
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.
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
2,604
Reaction score
1,961
First Language
English
Primarily Uses
RMMV
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.
 

ATT_Turan

Veteran
Veteran
Joined
Jul 2, 2014
Messages
89
Reaction score
39
First Language
English
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...
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
2,604
Reaction score
1,961
First Language
English
Primarily Uses
RMMV
Yeah, a turn 0 troop event will do the trick.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,108
Reaction score
13,713
First Language
English
Primarily Uses
RMMV
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.
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
2,604
Reaction score
1,961
First Language
English
Primarily Uses
RMMV
Always happy to be of assistance, glad you got it sorted. :)
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.
Can someone recommend some fun story-heavy RPGs to me? Coming up with good gameplay is a nightmare! I was thinking of making some gameplay platforming-based, but that doesn't work well in RPG form*. I also was thinking of removing battles, but that would be too much like OneShot. I don't even know how to make good puzzles!
one bad plugin combo later and one of my followers is moonwalking off the screen on his own... I didn't even more yet on the new map lol.

Forum statistics

Threads
106,035
Messages
1,018,455
Members
137,821
Latest member
Capterson
Top