RPG Maker MV

RPG Maker MV

comet Feb 14, 2017 @ 7:14pm
Changing battler sprite according to what weapon you have equipped
How would I go about changing my battler sprite according to what weapon I have equipped?

I tried to create a common event within a weapon's traits to do this, but it doesn't give me the option to trigger a common event in the list of traits. I also tried to do it by creating a parallel event, but the only option I see within the conditional branches is "if player has ______ weapon", not if player has _____ weapon equipped.

Does the checkbox "include equipent" under the weapons option make that difference? if not, what does it do?

Also, would using the command "Change Actor Images" also effect the walking sprite sheet regardless of whether we change it or not? I have a few areas in my game that use a smaller version of my character sprite sheet in order to fake a more zoomed out camera.

If it does effect that, how do I avoid this problem?

haha so many questions, I know. Which is why I'm hoping that one of you guys can help me?
Thanks in advance :)
< >
Showing 1-9 of 9 comments
Caethyril Feb 15, 2017 @ 6:45am 
So, um.

I think Harbinger means a parallel-trigger common event. Bear in mind that such events won't run in battle at all. Also, I can't imagine how it would crash the game...it'd just make the last change the one that is applied, right? On the plus side, a parallel common event like this should work. Something like:
Branch : Actor1 has Weapon1 equipped Branch : Switch #1 is OFF Comment : face needs updating! Change Actor Images : <stuff goes here> Control Switches : #1 ON End Else Comment : this weapon is no longer equipped Branch : Switch #1 is ON Comment : face needs resetting! Change Actor Images : <stuff goes here> Control Switches : #1 OFF End End Branch : Actor1 has Weapon2 equipped etc...
The above would also need a switch per weapon, per actor...

(It would be better to use a plugin that offers some kind of "on equip/unequip, run this common event" kind of functionality. That said, I looked and found nothing like that...)

Also, a handy tip! If you hover over most buttons or lists or such in the editor for a couple of seconds, a help box will appear with a brief description of what it does. So, for example, if you hover over the Conditional Branch > Actor > Weapon dropdown box, the help box will tell you that it actually checks whether the weapon is equipped by that actor. (May seem confusing, but if you think about it there's only one inventory for the party, so if you're asking whether an actor "has" an item, you can sort of infer it means "equipped" rather than "in the party's collective bottomless pockets".)

Lastly, to my knowledge, the Change Actor Images command changes all the graphics (face, walking sprite, and SV battle sprite) to the ones specified. I'm not sure how to change only one or two of them?
Last edited by Caethyril; Feb 15, 2017 @ 6:47am
Caethyril Feb 15, 2017 @ 9:57am 
Originally posted by XIIIthHarbinger:
The way it can potentially crash the game is two fold,
Plugins may cause conflicts, yes. The way you are talking about this "event tree" makes me wonder if you're talking about a plugin yourself; perhaps it's just a clash of terms. You seem to be saying that any method proposed must work in conjunction with any possible plugin that could be written (?), but that is impossible.

Taking dual-wielding into account changes the system significantly, but without any concrete examples from you, I don't understand what you believe will form a conflict. Every Change Actor Images command is its own command, and without a plugin (see above) changing that behaviour somehow, the software makes conflict impossible, no?

If you don't place the directive in the common event to change all three components, the program has no reason to alter all three from the default.
I cannot see a way to do this, though. Change Actor Image seems, in notation and testing, to set all three graphics at once? Perhaps I am mistaken.

Furthermore it's better to have a single master switch per actor, to have the event run the conditionals, then it will trigger only the correct conditionals that have been met for the actor in a given moment
Yes, it would be better. On reflection, I would use 1 variable per actor + 1 temporary variable to store current weapon ID for comparison. It still works and is much more compact: just store the equipped weapon's (or weapon category's) ID. If wanting to accommodate for dual-wielding, an extra variable per actor can be used if the OP is not comfortable enough (perfectly understandable!) with modular arithmetic to pack it into the first. I cannot see a way to use 1 switch per actor, though.
Last edited by Caethyril; Feb 15, 2017 @ 9:58am
Caethyril Feb 15, 2017 @ 12:47pm 
Ah, OK, that makes things a lot clearer. A few points that I'll try to keep short:
  • Change Actor Image - this would be fine were it not for the fact that the thread starter wishes to accommodate two different sizes of walking sprite dependent on current map. Just means you have twice as many conditional branches, was hoping I'd missed something that could help avoid that. No worries!
  • My use of switches/variables was explicitly to prevent reapplication of the Change Actor Images command every frame. Perhaps I was just being silly there.
  • A parallel event per actor sounds rather more prone to conflicts than a single one for all actors, but we all have our own programming styles and I admit I don't know exactly how multiple parallel events are prioritised/executed in Javascript.
Sorry for the confusion.

In lighter news, I think I've managed to make a very bare-bones plugin that calls a common event when you equip/unequip any weapon/armor item. Could use it to do away with the parallel events! Link: https://drive.google.com/file/d/0B47clJwJZOS0N1hpRmZpeTk3TjA/view?usp=sharing

With said plugin, you can just have a common event for weapon equip/unequip, check equipped weapons for each actor, and change their sprites...all without any switches/variables, I hope? =)
comet Feb 15, 2017 @ 6:20pm 
Wow! thank you guys for answering my questions. No worries :) I'm keeping my game simple since it's my first, so I only have one actor. She'll also be wielding only one weapon at a time. I don't really have any plugins that are supposed to affect the battle system or equipment just yet, but was planning on implementing Yanfly's Animated Battlers plugin. But I am also aware that certain plugins may interfer with each other regardless of what they're supposed to do.

Also, thank you, Caethyril, for making this plugin! I will try it out as soon as I can and see if it's what I need.
comet Apr 24, 2017 @ 5:01pm 
Originally posted by Caethyril:
In lighter news, I think I've managed to make a very bare-bones plugin that calls a common event when you equip/unequip any weapon/armor item. Could use it to do away with the parallel events! Link: https://drive.google.com/file/d/0B47clJwJZOS0N1hpRmZpeTk3TjA/view?usp=sharing

With said plugin, you can just have a common event for weapon equip/unequip, check equipped weapons for each actor, and change their sprites...all without any switches/variables, I hope? =)


Hi! I know its been a long time, but i'm about to start working on my battle sytem that's going to be in my game, and am wondering if the plugin you made is ok to use in a commercial game? I'm not 100% set on making my game commercial yet, but i thought it would be a lot better to ask anyway.
comet Apr 24, 2017 @ 5:03pm 
woops! sorry haha looks like you mentioned it in your plugin and I just didn't notice. thanks again!
Caethyril Apr 25, 2017 @ 2:50am 
Originally posted by kindamon:
woops! sorry haha looks like you mentioned it in your plugin and I just didn't notice. thanks again!
Yep, commercial or non-commercial are both fine. ^_^

However, I realise now that this plugin of mine has a potential problem...the default behaviour for "reserve event" is for the engine to remember only the most recently "reserved" event until it can be run (which, here, is when the menu closes). This means if you wanted to perform multiple independent checks with my plugin, only the most recent (un)equip event would run. If an issue, this could be remedied by a plugin, such as Common Event Queue[himeworks.com], in which case mine could trigger any of the equip/unequip events multiple times in a single visit to the equip menu.

Yanfly's released a plugin quite recently called Utility Common Events[yanfly.moe], and one of the triggers is "close menu". So you could, perhaps, use that to link to your common event instead. Might be a little more stable as long as you just want a net effect based on current equips, as opposed to some kind of instant on-equip stuff (e.g. lose 10 HP every time you equip the weapon?) or something.

If none of that sounds applicable to you (or if it's working just fine for you at the moment) then don't mind me. xP
Last edited by Caethyril; Apr 25, 2017 @ 2:52am
Wolfe Apr 25, 2017 @ 6:31am 
You can specify a paralell process

Originally posted by kindamon:
I also tried to do it by creating a parallel event, but the only option I see within the conditional branches is "if player has ______ weapon", not if player has _____ weapon equipped.

You've already had much more detailed help than I can offer, but just to let you know you CAN specify if a weapon is equipped or not as a paralell process, but it's on a different tab from the if a weapon is merely in your possession tab. You select the character then the weapon and it will only check if it's equipped - not just if it's in your possession. I don't know why they kept them separate tabs but it definitely is there.

Thanks to that functionality my custom action combat system is possible.
comet Apr 26, 2017 @ 8:53pm 
hmm...thank you both :) I'll be trying all of these methods to see which works best.
Last edited by comet; Apr 26, 2017 @ 8:54pm
< >
Showing 1-9 of 9 comments
Per page: 1530 50

Date Posted: Feb 14, 2017 @ 7:14pm
Posts: 9