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,356
Reaction score
8,771
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,356
Reaction score
8,771
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,356
Reaction score
8,771
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

Well, someone "reviewed" my game. Didn't credit me anywhere in the video and spent 2 minutes insulting it. Going to ignore that and move on.
To cut down on map lag, I've been researching how to implement a lighting layer as a single map overlay instead of a bunch of individual lights. Hopefully I'll have a screenshot soon!
Imagine having a game broken up into a whole bunch of chapters? Like Chapter 11 should be about the party members going bankrupt.
Over 1/4th of the calendars are already out :eek: Have you already put something to a good use?

Forum statistics

Threads
117,261
Messages
1,105,921
Members
153,431
Latest member
shadowking1901
Top