Seal characters attack unless they have a weapon equipped.

I can't believe this is defeating me. Very upset. Booo.

Yeah, so is it simple to prevent an actor from attacking if they have no weapon equipped? Surely it is... =/

Or alternatively is there a way to auto induce a state on the actor if no weapon is equipped?

Or alternatively, alternatively is there a way to not allow an actor to have no weapon equipped?
I'm new to MZ but been at hard work at 2k3 but I try helping anyway...
to the troops, new event in the even windows, and then conditional branch, maybe?

EDIT: Second tab, I believe
to the troops, new event in the even windows, and then conditional branch, maybe?
What would you do with that, though? To make an event interact with the ability to Attack?

Or alternatively, alternatively is there a way to not allow an actor to have no weapon equipped?
Yes, if you Google it you should find a number of threads about requiring weapons.



What would you do with that, though? To make an event interact with the ability to Attack?
Oh so it works like that, thanks! 😀
I should have specified the stated goal.


Context
My character is a robot that can only perform certain actions if he has particular upgrades equipped (in this case weapons). Either that or his abilities are severely diminished if "upgades" aren't equipped. Simply locking off his attack seemed like the easiest option to make him useless if stripped of all his weapon class equipment.

The first two solutions provided by ATT_Turan seem like very promising avenues. Thank you. I'll let you know how/if it works out.
a robot that can can only perform certain actions if he has particular upgrades equipped (in this case weapons).
You can use the built-in Required Weapon menu on the Skills in the database for that.

Either that or his abilities are severely diminished if "upgades" aren't equipped.
You can put checks for the weapons inside the damage formula.
You can use the built in required Weapon menu on the Skills in the database for that.
But there's only two slots and this should only affect the robot actor. Am I missing something?

While I'd love to learn more about damage formulas, again that would affect all characters wouldn't it? I suppose I could say something along the lines of requires weapon class sword or bow or bionic arm or gun etc etc. That sounds like it would work, but I've no idea how to write that code.
But there's only two slots and this should only affect the robot actor. Am I missing something?
...no, I guess I am? I assumed if these skills are special attacks using robotic weaponry that only your robotic character would learn them.

I wouldn't assume your human cleric would be have access to the Shoulder Missile Pods skill at all, but I guess you have some kind of other setup 😛

Regardless, it's pretty easy to use VisuStella's Skills and States to make skills be greyed out under certain conditions.

Code:
<JS Skill Enable>
enabled = user != $gameActors.actor(69) || user.hasWeapon($dataWeapons[22]);
</JS Skill Enable>

Actor 69 will only be able to use the skill if they have weapon ID 22 equipped. Anyone else can use it normally.

While I'd love to learn more about damage formulas, again that would affect all characters wouldn't it?
Not if you put the correct conditionals in them. I'm pretty sure this thread has all of the basic syntax for checking things like actor ID, equipped weapon, etc.


I suppose I could say something along the lines of requires weapon class sword or bow or bionic arm or gun etc etc. That sounds like it would work, but I've no idea how to write that code.
I don't see how that's different from what I suggested with the regular Required Weapon field, but...ok. I guess because there's more than 2?
That's a ton of info and avenues you've presented. Thanks again. It's on me to figure it out from here. Thanks for sign posting in the right directions. I'll endeavour to be less of a newb. Muchos head scratching awaits my life, but that's far better than planting my head into the wall and crying.

All is good, very simple solution found. Thanks ATT_Turin
  • "Does user have weapon type 12 equipped?"
    JavaScript:
    user.isWtypeEquipped(12)
  • "Does user have weapon 22, 23, 24, or 25 equipped?"
    JavaScript:
    [22,23,24,25].some(id => user.hasWeapon($dataWeapons[id]))
Just to mention it: there's a "Required Weapon" setting at the bottom of every Skill page. You could make a new "Robot Attack" skill that requires a "Mech Upgrade" type equipped, then give that actor an appropriate Attack Skill trait. (This setting checks isWtypeEquipped.)

[Edit: added a missing ) on the code for the second bullet point. And belatedly noticed that Turan already mentioned the Required Weapon thing earlier. 😴]
As my ambitions expand, I shall consider all these options. For now I'm happy with the fastest and simplest approach, which was to use the VisuStella Items and Equip plugin to ensure every party member requires a weapon. That'll do for me.

Without upgrades my robot character is useless at attacking, and as he uses his skills he becomes increasingly slow. That's exactly how I want him for now. Again thanks for all the tips, I'm sure they'll come in useful further down the line.
...no, I guess I am? I assumed if these skills are special attacks using robotic weaponry that only your robotic character would learn them.

I wouldn't assume your human cleric would be have access to the Shoulder Missile Pods skill at all, but I guess you have some kind of other setup 😛

Regardless, it's pretty easy to use VisuStella's Skills and States to make skills be greyed out under certain conditions.

Code:
<JS Skill Enable>
enabled = user != $gameActors.actor(69) || user.hasWeapon($dataWeapons[22]);
</JS Skill Enable>

Actor 69 will only be able to use the skill if they have weapon ID 22 equipped. Anyone else can use it normally.


Not if you put the correct conditionals in them. I'm pretty sure this thread has all of the basic syntax for checking things like actor ID, equipped weapon, etc.



I don't see how that's different from what I suggested with the regular Required Weapon field, but...ok. I guess because there's more than 2?

<Custom On Equip Eval>
user.changeEquip(0, $dataWeapons[this._itemId]); //can it be like this?
</Custom On Equip Eval>

me use Way_Core,
@Adisas88
1 - Your question doesn't appear to have anything to do with this thread, you should make a new one or post your question in the thread waynee95 started for his plugins.

2 - That notetag wouldn't do anything with Way_Core, you'd have to be using his On Equip Eval plugin.

3 - That syntax is wrong, because this is the same as user - you're trying to equip the actor's item ID, and they don't have one. (actually, the way the code is run, that function isn't a method of a data type, there is no this at all)

4 - What are you even trying to do? If your code were written properly, it would be saying "When you equip this item, equip this item."
@Adisas88
1 - Your question doesn't appear to have anything to do with this thread, you should make a new one or post your question in the thread waynee95 started for his plugins.

2 - That notetag wouldn't do anything with Way_Core, you'd have to be using his On Equip Eval plugin.

3 - That syntax is wrong, because this is the same as user - you're trying to equip the actor's item ID, and they don't have one. (actually, the way the code is run, that function isn't a method of a data type, there is no this at all)

4 - What are you even trying to do? If your code were written properly, it would be saying "When you equip this item, equip this item."
So how do you translate this.weapon,,and how code this.weapon on RPG Maker MV ?

<Custom On Equip Eval>
user.changeEquip(0, $dataWeapons[user._equips[0].itemId]); // Change to the weapon specified by _itemId
</Custom On Equip Eval>

JavaScript:
<Custom On Equip Eval>

// Wait for a short duration (if needed)

// You can replace this with any custom delay function you have in your game

setTimeout(function() {

    user.changeEquip(0, $dataWeapons[user._equips[0].itemId]); // Change equipment after a delay

}, 1000); // Adjust the delay time as needed (1000 milliseconds = 1 second)

</Custom On Equip Eval>

Sorry not Work
@Adisas88 This is the MZ Support section. Your question seems to be about MV. I suggest taking a look at these sections listed below as well as Waynee95’s thread to make a post that is more tailored to your specific needs.

Sorry, I'm a beginner. and thank you
No worries. It’s all cool. I just wanna make sure everyone gets to the best place for assistance. 😍
No worries. It’s all cool. I just wanna make sure everyone gets to the best place for assistance. 😍
Ok. I'm making a game on my own, and it turns out it takes a long time to create. I really like TBS
That's great! Planning to create a unique TBS game with thrilling challenges sounds exciting!

"The game I'm creating will be different from any you've played before. It's based on the games I used to play a long time ago, as well as my own ideas. Let me reveal one core aspect of my game: there's no leveling system, and enemies have skills and stats superior to the player's. If the player loses, all save data will be erased. I'm designing the game to be as minimal in memory usage as possible, relying on players' brains to defeat enemies. Skills are freely available for purchase, and there are forbidden classes and skills. etc."
Well. It does appear that OP did come to a solution for their question, so I think I’ll pack this one up. If that’s not the case, lemme know and we can get it reopened.

Original thread: https://forums.rpgmakerweb.com/threads/seal-characters-attack-unless-they-have-a-weapon-equipped.166910/