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
614
Reaction score
591
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,321
Reaction score
8,755
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,978
Reaction score
2,302
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,321
Reaction score
8,755
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,321
Reaction score
8,755
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

"16. Do NOT contact other members by private message, on the forum or status feed, inviting them to put additional tools (such as leaderboards, ads, etc - whether yours or another person's) into their game."
Oh no. Necessity is the mother of invention. Do I want to know what happened?
Early WIP for my next entry. Since it's early you're going to need to wait a little longer than usual. What's that? You'll find out in my next update!
12.PNG
20 festive cards can now be unlocked in BiteMe!

The cards are permanent, but can only be unlocked in December!
Once the year is over, you won't be able to unlock the cards, or to upgrade it.
https://johndoenews.itch.io/biteme-storymodeCard141-160-Ad.png
Finally showing some updates again

Forum statistics

Threads
117,181
Messages
1,105,245
Members
153,307
Latest member
nyhkkbjyek
Top