How to create notetags

Michael Caiola

The Stone Bull
Veteran
Joined
Sep 14, 2016
Messages
392
Reaction score
76
First Language
English
Primarily Uses
I threw together this plugin to move the Guard command after the Attack command and before the Skill commands:


//=============================================================================
// Move Guard Under Attack
// GuardUnderAttack.js
// Last Updated: 2016.10.25
//=============================================================================

/*:
* @plugindesc Moves the Guard command under the Attack command and before Skill commands.
* @author Bryan Caiola
* @help Plug and play!
*/

Window_ActorCommand.prototype.makeCommandList = function() {
if (this._actor) {
this.addAttackCommand();
this.addGuardCommand();
this.addSkillCommands();
this.addItemCommand();
}
};




How do I make it so that the change only happens when the notetag <move guard> is places in the notes area?
 

waynee95

Inactive
Veteran
Joined
Jul 2, 2016
Messages
682
Reaction score
598
First Language
German
Primarily Uses
RMMV
You can put <moveGuard> in the actor's notebox and then check for this._actor.meta.moveGuard.
 

Michael Caiola

The Stone Bull
Veteran
Joined
Sep 14, 2016
Messages
392
Reaction score
76
First Language
English
Primarily Uses
Thank you. I tried this and it didn't work. What did I get wrong?


//=============================================================================
// Move Guard Under Attack
// GuardUnderAttack.js
// Last Updated: 2016.10.25
//=============================================================================

/*:
* @plugindesc Moves the Guard command under the Attack command and before Skill commands.
* @author Bryan Caiola
* @help Plug and play!
*/

if (this._actor.meta.moveGuard) {
Window_ActorCommand.prototype.makeCommandList = function() {
if (this._actor) {
this.addAttackCommand();
this.addGuardCommand();
this.addSkillCommands();
this.addItemCommand();
}
}
};


Also, how do I do it for weapon notes?
 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,108
Reaction score
13,713
First Language
English
Primarily Uses
RMMV
The condition goes IN the function, not AROUND it.

Code:
Window_ActorCommand.prototype.makeCommandList = function() {
    if (this._actor) {
        this.addAttackCommand();
        if (this._actor.meta.moveGuard) {
        	this.addGuardCommand();
         	this.addSkillCommands();
        } else {
        	this.addSkillCommands();
        	this.addGuardCommand();
        }
        this.addItemCommand();
    }
};
 

Michael Caiola

The Stone Bull
Veteran
Joined
Sep 14, 2016
Messages
392
Reaction score
76
First Language
English
Primarily Uses
"Cannot read property 'moveGuard' of undefined"


TypeError: Cannot read property 'moveGuard' of undefined
    at Window_ActorCommand.makeCommandList (/S:/OneDrive/Faceless%20Gnome/Productions/Video%20Games/The%2013th%20Sign/RPG%20Maker/The%2013th%20Sign/js/plugins/GuardUnderAttack.js:16)
    at Window_ActorCommand.setup (rpg_windows.js:5413)
    at Scene_Battle.startActorCommandSelection (rpg_scenes.js:2270)
    at Scene_Battle.startActorCommandSelection (/S:/OneDrive/Faceless%20Gnome/Productions/Video%20Games/The%2013th%20Sign/RPG%20Maker/The%2013th%20Sign/js/plugins/YEP_BattleEngineCore.js:4228)
    at Scene_Battle.changeInputWindow (rpg_scenes.js:2071)
    at Scene_Battle.selectNextCommand (rpg_scenes.js:2299)
    at Scene_Battle.selectNextCommand (/S:/OneDrive/Faceless%20Gnome/Productions/Video%20Games/The%2013th%20Sign/RPG%20Maker/The%2013th%20Sign/js/plugins/YEP_BattleEngineCore.js:4207)
    at Scene_Battle.selectNextCommand (/S:/OneDrive/Faceless%20Gnome/Productions/Video%20Games/The%2013th%20Sign/RPG%20Maker/The%2013th%20Sign/js/plugins/YEP_InstantCast.js:560)
    at Scene_Battle.startPartyCommandSelection (/S:/OneDrive/Faceless%20Gnome/Productions/Video%20Games/The%2013th%20Sign/RPG%20Maker/The%2013th%20Sign/js/plugins/YEP_BattleEngineCore.js:4176)
    at Scene_Battle.changeInputWindow (rpg_scenes.js:2073)
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,108
Reaction score
13,713
First Language
English
Primarily Uses
RMMV
okay. 


this._actor is a Game_Actor, but the note is on the Data_Actor.


Just change that condition to this._actor.actor().meta.moveGuard and it ought to work.
 

Michael Caiola

The Stone Bull
Veteran
Joined
Sep 14, 2016
Messages
392
Reaction score
76
First Language
English
Primarily Uses
Thank you! That worked. How do I make it also work for weapon notetags?
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,108
Reaction score
13,713
First Language
English
Primarily Uses
RMMV
what do you want to do with weapon notetags?
 

Michael Caiola

The Stone Bull
Veteran
Joined
Sep 14, 2016
Messages
392
Reaction score
76
First Language
English
Primarily Uses
EDIT: I found another way to accomplish my end goal, so I don't need this solved anymore. But feel free to answer in case someone comes across this wanting the same thing. Thanks for the help, Shaz.


----------


When the weapon is equipped, Guard will move below Attack.


I'm trying use Yanfly's Weapon Unleash to change attack and guard, but I want them to be next to each other. However, I only want that to happen with certain weapons. My goal is to give the user two attacks with the same weapon and I have everything figured out except how to make the two attacks the first two items on the list. I'm starting to think I'm going about it the wrong way.


I'd have to add a second guard skill using VE's Direct Commands, which is fine, but the new guard still has all the quirks of a skill that I'd need to get rid of. And even after replacing guard, the actor still uses the guard sprite and not the ready sprite, even though there's no guard state or special flag. I'm sure that's more coding. I'm to to the point where something I thought was simple is turning into something complicated. There's probably another, much easier way out there, too and I'm wasting my time.


I'm sorry, I'm not explaining this well at all, am I? I'm very tired and have had a bad headache for most of the day.
 
Last edited by a moderator:

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

He mad, but he cute :kaopride:

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.
Can someone recommend some fun story-heavy RPGs to me? Coming up with good gameplay is a nightmare! I was thinking of making some gameplay platforming-based, but that doesn't work well in RPG form*. I also was thinking of removing battles, but that would be too much like OneShot. I don't even know how to make good puzzles!

Forum statistics

Threads
106,036
Messages
1,018,461
Members
137,821
Latest member
Capterson
Top