Lnik3500

Master Troll
Veteran
Joined
Feb 26, 2015
Messages
324
Reaction score
52
First Language
French
Primarily Uses
RMMV
Hello! I'd like some help please c:
I'm trying to create an Equip Skill that's exclusive to a class, For that, I need to call a common event that opens Scene_Equip to the corresponding actor and let that actor equip new armor

The big problem with this is that you can simply switch to another actor in equip menu and essentially equip different pieces for everyone, which isn't what I'm aiming for

I can currently switch actors by pressing Q/W or PageUp/PageDown and I'm looking to lock that function using an in-game switch

Maybe by putting a switch into rmmz_scene.js, but I'm not a good programmer and I have no idea what to write where.

I hope I made sense and if possible I'd like help over this c:
I can clarify stuff if needed of course.
 

Aerosys

Veteran
Veteran
Joined
Apr 23, 2019
Messages
613
Reaction score
588
First Language
german
Primarily Uses
RMMZ
Make a Plugin and add this:

Code:
(function() {
    const lockActorInMenusSwitchID = 11
 
    const alias1 = Scene_MenuBase.prototype.nextActor
    const alias2 = Scene_MenuBase.prototype.previousActor
 
    Scene_MenuBase.prototype.nextActor = function() {
        if (!$gameSwitches.value(lockActorInMenusSwitchID))
            alias1.call(this)
    }

    Scene_MenuBase.prototype.previousActor = function() {
        if (!$gameSwitches.value(lockActorInMenusSwitchID))
            alias2.call(this)
    }
})();

Change the 11 to a Switch Number you want to use. When the Switch is one, the Player cannot swap Characters in any Menu. Tell me if it works for you.
 
Last edited:

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
34,286
Reaction score
8,738
First Language
German
Primarily Uses
RMMV
another option is to give all other actors a state that seals all their equip slots before opening the scene, and remove that state after.

that way the engine will still allow the player to switch actor, but he won't be able to change any equipment on the other actors.
and no plugin needed for that, just a state with a lot of seal equip traits.
 

caethyril

^_^
Global Mod
Joined
Feb 21, 2018
Messages
2,967
Reaction score
2,295
First Language
EN
Primarily Uses
RMMZ
@Aerosys I think you're missing a ) on each of your if conditions. [Edit: fixed!] Looks good otherwise!
 
Last edited:

Lnik3500

Master Troll
Veteran
Joined
Feb 26, 2015
Messages
324
Reaction score
52
First Language
French
Primarily Uses
RMMV
After testing those ways that worked well, it turns out that opening Scene_Equip during battle seems to break as the fight completely restarts.
Maybe I will try some other ways unless there's a way to cache the battle before opening Scene_Equip.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
34,286
Reaction score
8,738
First Language
German
Primarily Uses
RMMV
unless there's a way to cache the battle before opening Scene_Equip.
you should have mentioned that you wanted to use equip during battles in your original post. all scenes are equal, so the problem is that opening the regular equip scene ends the battlescene.

however there have been "battle-equip" scripts or plugins in the past, especially written to allow changes to equipment during battle. You might try to look for one of them.
 

Lnik3500

Master Troll
Veteran
Joined
Feb 26, 2015
Messages
324
Reaction score
52
First Language
French
Primarily Uses
RMMV
@Andar I really didn't know that it was important. MZ comes with ChangeEquipOnBattleMZ.js, so I might look into turning an actor command into a skill. I think the original way of blocking actor switching should still work in that small scene

EDIT: turns out it's not compatible with Visustella, rip
 
Last edited:

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
34,286
Reaction score
8,738
First Language
German
Primarily Uses
RMMV
then check if visustella has an alternative to battleequip. I know yanfly wrote one for Ace, he should have made one for MV and visustella was formed to transfer yanfly's MV plugins.
 

Latest Threads

Latest Posts

Latest Profile Posts

When can we get this?
RPG Maker MZ Saturn.png
Saturn port when?
I'm new to rpgmaker mv, link me some good stuff to learn.
Finally, I have graduated from college and now I can put a lot more work into my game, after having not worked on it for the better part of a year.
post so i can change my profile picture ^^
Creating Some art for a fighter game.

Forum statistics

Threads
117,067
Messages
1,104,265
Members
153,040
Latest member
oscarcancer
Top