Lnik3500

Master Troll
Veteran
Joined
Feb 26, 2015
Messages
324
Reaction score
53
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
880
Reaction score
881
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
38,008
Reaction score
10,569
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
4,508
Reaction score
3,546
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
53
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
38,008
Reaction score
10,569
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
53
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
38,008
Reaction score
10,569
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

ScreenShot_3_30_2023_10_5_45.pngstarted working on a new area today. It's a warped version of being inside someone's home. Also moved the face and Panic gauges to be out of the way of the map names. switching moods actively changes what you encounter. Calm is normal while anxious is all the way up to Manic.
Ads.png
Some advertisements for M

And yes kiddos smoking, alcohol and too much coffee or tea are bad for you - but in the 20's we didnt know that yet xD


This is for demonstration of random vocal.
My mom showed up yesterday and I wanted to proudly show off my comic con web page. So of course, it no longer existed. I guess when the 4 day event was over they removed it.
Feeling like a creative Pattato this morning...

Forum statistics

Threads
129,979
Messages
1,206,694
Members
171,209
Latest member
910Ninocc
Top