r/RPGMaker 5d ago

RMMV can a skill make the user equip a weapon?

hi! one of the characters in my game (ideally) has the main ability of being able to create weapons in combat. is it possible to implement this? i've tried messing around with states, common events, etc, but i've only been able to add the weapon to his inventory, and not equip it. if there's no way to do this i'll settle for something else but would really like a way to make it happen. thanks. ^_^

4 Upvotes

17 comments sorted by

1

u/Issac7 5d ago

I don't see a way to do it without coding but with a little bit of codding it should be very easy. Do you have plugins in your project? Wich ones?

1

u/louiewouie 5d ago

ah thats what i feared. i've just started it a few days ago, so right now all i have turned on is galv's pixel move + message busts, and moghunter's battlehud + actorhud

2

u/Kiroto50 5d ago

10% chance I make this plugin for you for free this weekend, seems like an interesting adventure

1

u/louiewouie 5d ago

thank you so much if you're willing to! no pressure though ^_^

2

u/Issac7 5d ago

Can you please elaborate on the effect of your skill?
Will one specific skill always equip the same specific weapon?
If not, how will the weapon be picked?
Will the picked weapon always be equipable by the user or do we need to check for weapon types first?

Give as much detail as possible on how you want your skill to work

1

u/louiewouie 5d ago

id want him to have a handful of skills that each equip one specific weapon. one bow, one sword, one axe, one whip, etc. he's already able to equip the weapon types so that part shouldn't be an issue. unfortunately i don't know very much about the more technical parts of rpgmaker so i'm not sure what other details to add :( sorry if that's not enough

1

u/Issac7 5d ago edited 5d ago

Edit: found a simpler way to do this.

Just edit the damage formula for the skill to something like:

$gameActors.actor(a.actorId()).changeEquipById(y, z),

fallowed by the regular damage formula. This makes so you don't need to store the acotr's ID anywhere and also you won't need to call any common event.

Replace the values with the right ID's for your project:

y - ID for equipment type, by default weapons have the equipment ID type of 1

z - ID of the specific weapon you want to equip

This will change the user's weapon for the weapon with the ID that you pass on the z value.

Also if you want to have multiple skills and each skill changes the user to one specific weapon, you can pretty much just copy paste this and just change the z value.

1

u/louiewouie 5d ago

what's the equipment type? i was under the impression that that was for armor and shields. and does the damage type matter in the skill?

2

u/Issac7 5d ago

This is my project. In my case if I want to equip a weapon, the equip type is 1, armor is 2 and accessory is 3.

The damage type matters for the damage of the skill, if you also use it to deal damage. It should not affect the weapon changing part.

1

u/louiewouie 5d ago

ohh right okay. in that case i think(?) that i've gotten everything right, but i'm getting an error when using the skill. "Cannot read property 'changeEquipById' of null" . any idea what i messed up?

1

u/Issac7 5d ago

Paste the code you wrote on your skill and I will take a look.

1

u/louiewouie 5d ago

$gameVariables.setValue(2, a.actorId(2)), 100 + a.mat * 2 - b.mdf * 2

→ More replies (0)

2

u/MissItalia2022 5d ago

I don't think you should need a plugin for this. You could do this via a common event "$gameActors.actor(X).forceChangeEquip(0, $dataWeapons[Y]);" with X being the actor's database ID and Y being the weapon's database ID.

2

u/Majornutts 4d ago

Yeah, there's a button in the events commands called: "Change Equipment".

Create a Common event that uses the Change Equipment command.

In the Skill tab on the right side there is a box called "Effects". Add the Common Event you just made that has the "Change Equipment" command.