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
616
Reaction score
592
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,358
Reaction score
8,772
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,986
Reaction score
2,304
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,358
Reaction score
8,772
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,358
Reaction score
8,772
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

aww man, color hex code #C4C4C4 doesn't work for the tint value in this scene I need something darker, which stinks just because I liked that one it was my favorite plastic explosive three times...#696969 (nice) should work better (WHY IS MY BRAIN LIKE THIS)
Tell it to me straight, doc. If I've been trying to piece together a "shorter" game to learn stuff outside of game jams... am I just running away from my WIP? :v
Well, I've got a party tomorrow, and my friends are coming over. I wanted to work a bit on the Fandom Scouts assets so I can be ready when that update arrives... in other news, Pizza Time Horror is getting a second teaser, and it shows Cabaret Helen's last performance before the location closed.
Also who used to be scared of Chuck E as a kid? I was! Now I love him!
The new cards and what they do:

(I am clearly not a youtuber... Haha)

Forum statistics

Threads
117,281
Messages
1,106,084
Members
153,453
Latest member
kuzmitchoww
Top