I'm using Yanfly's Equip Battle Skills plugin and I need help with how to apply this notetag: actor.equipSkill(id, slot), into my game. I just want my actors to start the game with certain skills equipped. Any help would be appreciated.
Yanfly Equip Battle Skills help
Javascript/Plugin SupportNo need to do anything special. Any skills the actor already knows when joining the party, will automatically be equiped (if there is room for them).
By the way, actor.equipSkill(id, slot) is used as a script call, not a notetag.
By the way, actor.equipSkill(id, slot) is used as a script call, not a notetag.
The skills do not equip automatically for me. They're available but they are not equipped. Also, could you show me how to do a script call with this plugin?
A minor correction to the terms you used: That isn't a notetag. A notetag goes in a Note box and usually is read by a plugin to tell it that a particular item in the database has some characteristic or needs a particular value.
What you're talking about is a JavaScript function, which is sometimes also called a script call, because an event can call it using the "script" command (or another plugin can call it using JavaScript) and it tells the plugin directly to do something at a particular time.
The way you would implement using that script call in a game is to have an autorun event on your starting map that calls that function and tells the game to put a bunch of skills into particular actors' skill slots.
I always have an autorun event on my starting map to make sure everything in the game is set up correctly, like variables or switches that need to be set, the party's starting gold, and any plugin commands like this that need to be done manually at the start of the game. It's usually also my "introduction" event that welcomes the player to the game. Just make sure there's a setting at the end of the event to deactivate it, or you won't be able to start playing the game!
So inside your autorun event you would put the following inside a Script command (found on page 3):
$gameActors.actor(actorId).equipSkill(skillId, slot);
You need to replace actorId with the Actor ID (from the database) of whatever person you're talking about, replace skillId with the Skill ID (from the database), and replace slot with the slot number you want that skill in. Repeat the above command, changing out the values, until you have each actor's skills set up.
So if you wanted actor 1 to have skills 10 , 11, 12, and 13 in their first four skill slots, you would write:
$gameActors.actor(1).equipSkill(10, 1);
$gameActors.actor(1).equipSkill(11, 2);
$gameActors.actor(1).equipSkill(12, 3);
$gameActors.actor(1).equipSkill(13, 4);
What you're talking about is a JavaScript function, which is sometimes also called a script call, because an event can call it using the "script" command (or another plugin can call it using JavaScript) and it tells the plugin directly to do something at a particular time.
The way you would implement using that script call in a game is to have an autorun event on your starting map that calls that function and tells the game to put a bunch of skills into particular actors' skill slots.
I always have an autorun event on my starting map to make sure everything in the game is set up correctly, like variables or switches that need to be set, the party's starting gold, and any plugin commands like this that need to be done manually at the start of the game. It's usually also my "introduction" event that welcomes the player to the game. Just make sure there's a setting at the end of the event to deactivate it, or you won't be able to start playing the game!
So inside your autorun event you would put the following inside a Script command (found on page 3):
$gameActors.actor(actorId).equipSkill(skillId, slot);
You need to replace actorId with the Actor ID (from the database) of whatever person you're talking about, replace skillId with the Skill ID (from the database), and replace slot with the slot number you want that skill in. Repeat the above command, changing out the values, until you have each actor's skills set up.
So if you wanted actor 1 to have skills 10 , 11, 12, and 13 in their first four skill slots, you would write:
$gameActors.actor(1).equipSkill(10, 1);
$gameActors.actor(1).equipSkill(11, 2);
$gameActors.actor(1).equipSkill(12, 3);
$gameActors.actor(1).equipSkill(13, 4);
Thanks for the response. I actually tried this before I posted my topic but it didn't work then, which is why I asked. I just tried it now and it works. I must have done a typo or something.
This thread can be closed since my issue is solved.
Original thread: https://forums.rpgmakerweb.com/threads/yanfly-equip-battle-skills-help.86498/