caethyril

^_^
Global Mod
Joined
Feb 21, 2018
Messages
4,646
Reaction score
3,776
First Language
EN
Primarily Uses
RMMZ
@RCDunn: hi, thanks for the report! For your points:
  1. I do not see any problems with collisions between the player and events on slopes. Can you:
    • Describe how I can cause the crash, starting from a new project; and
    • Share a screenshot of the error in the console.

  2. I see the problem with Face Away from Player, it's a typo (should be reverseDir, not reverseDirection). The error screenshot was very helpful! An easy fix, surprised that this is the first report, though. :kaoswt2:
 

RCDunn

Veteran
Veteran
Joined
Aug 2, 2016
Messages
95
Reaction score
80
First Language
English
Primarily Uses
@RCDunn: hi, thanks for the report! For your points:
  1. I do not see any problems with collisions between the player and events on slopes. Can you:
    • Describe how I can cause the crash, starting from a new project; and
    • Share a screenshot of the error in the console.

  2. I see the problem with Face Away from Player, it's a typo (should be reverseDir, not reverseDirection). The error screenshot was very helpful! An easy fix, surprised that this is the first report, though. :kaoswt2:
Hi Caethyril,

After playing around a little I found it's actually a compatibility issue with GALV_DiagonalMovement. The error mentions a few plug-ins, but your slope move works fine after I disable Galv's. Since I need both plug-ins, I'll use my original plan of blocking events from slopes (unless it's an easy fix, but I suspect not).

Thanks for the reverseDir fix, it works! I guess no one else uses face away from Player :)

1656262207262.png
 

caethyril

^_^
Global Mod
Joined
Feb 21, 2018
Messages
4,646
Reaction score
3,776
First Language
EN
Primarily Uses
RMMZ
Interesting, thanks for letting me know! :kaohi:
 

123crafterman

Warper
Member
Joined
Apr 2, 2020
Messages
1
Reaction score
1
First Language
English
Primarily Uses
RMMV
I'm having problems with your BattlesStepY plugin, it works perfectly fine on its own, but if paired with yanfly's battle core plugin the actors escape to the right and not downwards as intended. I've put them in a blank project with just the two plugins and it doesn't work so its not conflicting plugins. Image is of the plugin list. thank you in advance!
 

Attachments

  • WHAT THE **** IS WRONG - RPG Maker MV 9_21_2022 9_07_11 AM.png
    WHAT THE **** IS WRONG - RPG Maker MV 9_21_2022 9_07_11 AM.png
    42.2 KB · Views: 9

caethyril

^_^
Global Mod
Joined
Feb 21, 2018
Messages
4,646
Reaction score
3,776
First Language
EN
Primarily Uses
RMMZ
Confirmed! I think it used to work, maybe a Battle Engine Core update broke it. Looks like adding this to Cae_BattleStepY fixes the issue:
JavaScript:
    Game_Actor.prototype.performEscapeSuccess = function() {
        if (this.battler()) {
            this.performEscape();
            this.battler().retreat();  // edit 1 of 1
        }
    }
For some reason Yanfly defines this performEscapeSuccess thing, but instead of calling the existing retreat method just tells the battler to move in the default retreat direction, i.e. 300 px to the right. :kaosigh:

I updated Cae_BattleStepY to v1.1 with that fix, same link as before. Seems to work OK for me! Since Google Drive isn't being very responsive for me lately, here's the updated plugin code:
JavaScript:
// ==============================================
// Cae_BattleStepY.js
// ==============================================

/*:
 * @plugindesc v1.1 - Makes sideview battle actors step up/down rather than left/right in battle. Compatible with Yanfly's Battle Engine Core.
 * @author Caethyril
 *
 * @help Plugin Commands:
 *   None.
 *
 * Suggested use: "back" view battle system with custom SV sprites.
 *
 * Note: if using Yanfly's Battle Engine Core, this plugin's parameters will be
 *   ignored. In that case, set the values using Yanfly's plugin instead.
 *
 * Compatibility:
 *   Yanfly's Battle Engine Core: load this plugin after Yanfly's.
 *   Overrides stepForward and retreat methods of Sprite_Actor.
 *   Conditionally aliases moveToStartPosition of Sprite_Actor.
 *   Also overrides Yanfly's stepFlinch method on Sprite_Actor.
 *
 * Terms of use:
 *   Free to use and modify.
 *
 * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 * Update log:
 *   1.1: Compatibility update for YEP Battle Engine Core (escape direction).
 *        Actors now move off-screen when escaping.
 *   1.0: Initial release.
 *
 * @param Home Position X
 * @text Home Position X
 * @type text
 * @desc Formula for party X positions.
 * @default Graphics.boxWidth / 2 + 96 * ($gameParty.battleMembers().length / 2 - index - 0.5)
 *
 * @param Home Position Y
 * @text Home Position Y
 * @type text
 * @desc Formula for party Y positions.
 * @default 440
 *
 * @param Step Distance
 * @text Step Distance
 * @type number
 * @desc How far characters step forward when it's their turn.
 * Default: 48 px
 * @default 48
 */

var Imported = Imported || {};			// Import namespace
Imported.Cae_BattleStepY = 1.0;			// Version declaration

var CAE = CAE || {};				// Author namespace
CAE.BattleStepY = CAE.BattleStepY || {};	// Plugin namespace

(function (_) {

'use strict';

// ============================ Initialisation ============================ //

	// Process user parameters...
	_.params = PluginManager.parameters('Cae_BattleStepY');
	_.pos = { x: _.params['Home Position X'] || '', y: _.params['Home Position Y'] || '' };
	_.step = Number(_.params['Step Distance'] || 48);

	// New function: returns distance from entry point (off-screen) to home.
	_.dEntry = function(sprite) {
        return Graphics.boxHeight - sprite._homeY + (sprite.bitmap ? sprite.bitmap.height : 0);
    };

	// New function: returns step distance, includes check for Yanfly BEC.
	_.stepDist = function() { return Imported.YEP_BattleEngineCore ? Yanfly.Param.BECStepDist : _.step; };

// ========== Overrides! Change move directions from x to y axis ========== //

	Sprite_Actor.prototype.stepForward = function() {
		this.startMove(0, -_.stepDist(), 12);
	};

	Sprite_Actor.prototype.retreat = function() { this.startMove(0, _.dEntry(this), 30); };

	Sprite_Actor.prototype.moveToStartPosition = function() { this.startMove(0, _.dEntry(this), 0); };

	Sprite_Battler.prototype.stepForward = function() {
		this.startMove(0, _.stepDist(), 12);
	};

	// ~v~v~v~v~v~ Yanfly Battle Engine Core compatibility ~v~v~v~v~v~ //

	Sprite_Actor.prototype.stepFlinch = function() {
		let flinchX = this.x - this._homeX;
		let flinchY = this.y - this._homeY + Yanfly.Param.BECFlinchDist;
		this.startMove(flinchX, flinchY, 6);
	};

	Sprite_Battler.prototype.stepFlinch = function() {
		var flinchX = this.x - this._homeX;
		var flinchY = this.y - this._homeY - Yanfly.Param.BECFlinchDist;
		this.startMove(flinchX, flinchY, 6);
	};

	Sprite_Battler.prototype.moveForward = function(distance, frames) {
		distance = parseInt(distance);
		frames = parseInt(frames);
		if (this._battler.isActor()) distance *= -1;
		var moveX = this.x - this._homeX;
		var moveY = this.y - this._homeY + distance;
		this.startMove(moveX, moveY, frames);
	};

	Sprite_Battler.prototype.stepSubBack = function() {
		var backX = -1 * this.width / 2;
		this.startMove(0, backX, 6);
	};

	Sprite_Actor.prototype.stepSubBack = function() {
		var backX = this._mainSprite.width / 2;
		this.startMove(0, backX, 6);
	};

    Game_Actor.prototype.performEscapeSuccess = function() {
        if (this.battler()) {
            this.performEscape();
            this.battler().retreat();   // v1.1 - call existing retreat method.
        }
    }

// ================ Override home positions if appropriate ================ //

	_.Sprite_Actor_setActorHome = Sprite_Actor.prototype.setActorHome;			// Alias
	Sprite_Actor.prototype.setActorHome = function(index) {
		if (Imported.Yanfly_BattleEngineCore || _.pos.x === '' || _.pos.y === '') {	// If positions not set or using BEC
			_.Sprite_Actor_setActorHome.call(this, index);				// Callback
		} else {
			try {
				let homeX = Number(eval(_.pos.x));
				let homeY = Number(eval(_.pos.y));
				// console.log(this._actor.name() + ':', homeX, homeY);
				this.setHome(homeX, homeY);
			} catch(e) {
				console.log('Cae_BattleStepY.js error!\nFailed to eval home position formula!', String(e));
				_.Sprite_Actor_setActorHome.call(this, index);			// Fallback
			}
		}
	};

	
})(CAE.BattleStepY);
Also, note that YEP Battle Engine Core has been updated since v1.5.0, so you might want to re-download that too.
 

Rune_The_Runey

Villager
Member
Joined
Aug 1, 2017
Messages
5
Reaction score
0
First Language
English
Primarily Uses
RMMZ
Don't mean to be a pain on this but I was looking at using the RandomTeleEvents plugin and have gotten a lot working. (I am using MZ and noticed it was for MV so I am aware that some things may not work as intended)

I'm using it as a random overworld encounter system where if you're good you can avoid all non-mandatory battles. So far it has been working for that but I was looking to add rare variants of enemies that are on a different timer for spawns but can't seem to find out how to adjust that without modifying the regular enemies one.

I do see the _teleCooldown but directions are a little unclear on how to use it.

Any help would be appreciated.
 

caethyril

^_^
Global Mod
Joined
Feb 21, 2018
Messages
4,646
Reaction score
3,776
First Language
EN
Primarily Uses
RMMZ
@The Rune Factory Guy - my RandomTeleEvents plugin is a bit niche: it's designed to reposition events within the specified regions repeatedly on a timer, not on demand. Typically for what you're describing, you'd use an event spawner plugin or just some event commands.

For example, you could use this, in a Script command, to store the X & Y coordinates of a random region-123 map tile in game variables 4 & 5 respectively:
JavaScript:
const regions = [123];
const tiles = [];
for (let x = $dataMap.width; x--;)
  for (let y = $dataMap.height; y--;)
    if (regions.contains($gameMap.regionId(x, y)))
      tiles.push({ x, y });
const tile = tiles.length ? tiles[Math.randomInt(tiles.length)] : {};
$gameVariables.setValue(4, tile.x || 0);
$gameVariables.setValue(5, tile.y || 0);
Then you could use those variables in a Set Event Location command or something~


The _teleCooldown property tracks how many frames remain until the character can teleport again. RandomTeleEvents uses a single cooldown value for all affected events. You'd need to change how the plugin resets the teleport cooldown for each event.
You could replace this line:
JavaScript:
_.applyCooldown = function(char) { char[_.propCool] = _.cooldown; };
...with this:
JavaScript:
_.applyCooldown = function(char) {
  char[_.propCool] = char._customTeleCooldown || _.cooldown;
};
This says "set the cooldown to this character's _customTeleCooldown value, or the default Teleport Cooldown value if the character doesn't have a custom one". You can set the _customTeleCooldown value manually, e.g.
  • "This Event" in a move route script command:

    this._customTeleCooldown = 60;
  • "This Event" in a standalone Script command:

    this.character(0)._customTeleCooldown = 60;
  • Event ID 123, in any script field:

    $gameMap.event(123)._customTeleCooldown = 60;
 

zelanius

Mechanics Freak
Veteran
Joined
Apr 29, 2020
Messages
177
Reaction score
48
First Language
English
Primarily Uses
RMMV
@caethyril , hi, a bit of a dumb question. I was trying to use your YEP Status Menu Extension plugin to try to display the JP Rate of my party members. I tried various codes like "this.actor().jpRate();", or "a.jpRate();" or even just "jpRate();" in the values section, but it kept returning 0%. I made sure to load the plugin below both, so I am not sure where I a doing wrong. Really appreciate your advise. Thank you in advance!
 

zelanius

Mechanics Freak
Veteran
Joined
Apr 29, 2020
Messages
177
Reaction score
48
First Language
English
Primarily Uses
RMMV
@caethyril , thank you so much! After seeing your response, I really had to facepalm myself. Thanks again!
 

zelanius

Mechanics Freak
Veteran
Joined
Apr 29, 2020
Messages
177
Reaction score
48
First Language
English
Primarily Uses
RMMV
@caethyril , another question on the Menu Extension plugin. If I am trying to display other rates, such as the gold or item drop rate of the party, is this possible?
 

caethyril

^_^
Global Mod
Joined
Feb 21, 2018
Messages
4,646
Reaction score
3,776
First Language
EN
Primarily Uses
RMMZ
If I am trying to display other rates, such as the gold or item drop rate of the party, is this possible?
Did you try the 2 examples in the plugin's help section? ^_^

Example formulae (for gold & item drop rates): - var nme = new Game_Enemy(1,0,0); nme.dropItemRate() This will return the item drop rate for enemy #1. - var trp = new Game_Troop(); trp.setup(1); trp.goldRate() This will return the gold drop rate for troop #1. Note that typically these rates are identical for all enemies/troops.
(That's actually the reason I originally wrote that plugin: Drop/Gold Rate Display.)
 

zelanius

Mechanics Freak
Veteran
Joined
Apr 29, 2020
Messages
177
Reaction score
48
First Language
English
Primarily Uses
RMMV
Thanks, @caethyril ! Apologies, I totally missed the last line and kept thinking it only pulls info from individual enemy troops.
Did you try the 2 examples in the plugin's help section? ^_^

Example formulae (for gold & item drop rates): - var nme = new Game_Enemy(1,0,0); nme.dropItemRate() This will return the item drop rate for enemy #1. - var trp = new Game_Troop(); trp.setup(1); trp.goldRate() This will return the gold drop rate for troop #1. Note that typically these rates are identical for all enemies/troops.

(That's actually the reason I originally wrote that plugin: Drop/Gold Rate Display.)

A follow up question on the same plugin, I am trying to pull the bonus BP Penetration Rate (the multiplicative bonus) from YEP's Aborption Barrier plugin as well. Somehow, due to the way Yanfly calculates the rates, it seems that as soon as 2 different bonuses are added, the display gets a bit off (e.g., if my class has +150% and an equip also has 150%, the displays 75% instead). I am not sure if you would know how to correctly display the rate? Appreciate any advice.
 

caethyril

^_^
Global Mod
Joined
Feb 21, 2018
Messages
4,646
Reaction score
3,776
First Language
EN
Primarily Uses
RMMZ
@zelanius - the absorption rate stacks multiplicatively (flat pen stacks additively). You can think of it like element rate vs resistance: penetration rate is kind of like "barrier resistance". This thread about YEP Armor Scaling may be helpful:

I haven't tested, but from a quick look at the code of YEP Absorption Barrier, I think these would be the correct values:
  • Flat:
    this._actor.barrierPenetrationFlat() + this._actor.barrierPenetrationFlatEval()
  • Rate:
    1 - (1 - this._actor.barrierPenetrationRate()) * (1 - this._actor.barrierPenetrationRateEval())
 

zelanius

Mechanics Freak
Veteran
Joined
Apr 29, 2020
Messages
177
Reaction score
48
First Language
English
Primarily Uses
RMMV
Thanks again, @caethyril , but it values does not seem to work. To simplify things, I was only dealing with the Penetration Rate (those with notetags of "<Barrier Penetration: +x%>"). However, it is appearing differently than what it should be. For example, I have a class with +115%, that wields a weapon with +125%. If the documentation of Yanfly is correct, this means that the multiplicative rate should be 1.15*1.25 = 144%, before being applied to a skill. However, what shows up is 96% instead. In any case, it is not a critical function for my game, so I might just let it go for now. Thanks for the response!
@zelanius - the absorption rate stacks multiplicatively (flat pen stacks additively). You can think of it like element rate vs resistance: penetration rate is kind of like "barrier resistance". This thread about YEP Armor Scaling may be helpful:

I haven't tested, but from a quick look at the code of YEP Absorption Barrier, I think these would be the correct values:
  • Flat:

    this._actor.barrierPenetrationFlat() + this._actor.barrierPenetrationFlatEval()

  • Rate:

    1 - (1 - this._actor.barrierPenetrationRate()) * (1 - this._actor.barrierPenetrationRateEval())

 

caethyril

^_^
Global Mod
Joined
Feb 21, 2018
Messages
4,646
Reaction score
3,776
First Language
EN
Primarily Uses
RMMZ
@zelanius - yes: 96.25%. I got that calculation from the calcBarrierPenetrationRate method of YEP Absorption Barrier. It's getting weird because you're using penetration values over 100%, i.e. you're ignoring all the barrier, plus a bit extra. (The final penetration rate is clamped between 0~100% anyway, so you'd never get 144% in-game.)

You might've meant to use +15% and +25% instead? I think they would combine to 36.25% (1 - 0.85 * 0.75).

If you're still confused about it, consider making a new thread in Plugin Support (or Plugin Requests if you want someone to write a patch for the penetration calculation). Happy RPG Making!
 

zelanius

Mechanics Freak
Veteran
Joined
Apr 29, 2020
Messages
177
Reaction score
48
First Language
English
Primarily Uses
RMMV
Hi @caethyril , thanks for the response. I think I got what you mean, and will try it after work. I think I got confused because of the multiplicative comment, which I thought to mean that you need +150% to multiple the rate of a skill by 1.5x (so if a skill has a rate of 50%, +150% will get you to 75%), because that is how most other multiplicative rate works.
@zelanius - yes: 96.25%. I got that calculation from the calcBarrierPenetrationRate method of YEP Absorption Barrier. It's getting weird because you're using penetration values over 100%, i.e. you're ignoring all the barrier, plus a bit extra. (The final penetration rate is clamped between 0~100% anyway, so you'd never get 144% in-game.)

You might've meant to use +15% and +25% instead? I think they would combine to 36.25% (1 - 0.85 * 0.75).

If you're still confused about it, consider making a new thread in Plugin Support (or Plugin Requests if you want someone to write a patch for the penetration calculation). Happy RPG Making!
EDIT: Update, yup, it solves the issue!
 
Last edited:

kouta555

Villager
Member
Joined
Sep 13, 2016
Messages
15
Reaction score
3
First Language
Russian
Primarily Uses
RMMZ
Hello, your Instannt step plugin is what i was needed, but if there a way to swith off or on it? cause i dont need it work all time, only in some moments/
 

caethyril

^_^
Global Mod
Joined
Feb 21, 2018
Messages
4,646
Reaction score
3,776
First Language
EN
Primarily Uses
RMMZ
Hello, your Instannt step plugin is what i was needed, but if there a way to swith off or on it?
Luckily, my MZ port of Cae_InstantMove has that feature, and seems to work in MV. It lets you choose a switch in the Plugin Manager: when that switch is on, instant move is on. You can find it here:
Let me know if you have problems with it! :kaohi:
 

HalcyanStudio

Eniko Ghosts of Grace Dev
Veteran
Joined
Mar 16, 2012
Messages
1,047
Reaction score
730
First Language
Dutch
Primarily Uses
RMMV
Hi, just a little request for the Gab Window extension. I understand if you don't have time/motivation to do it :)

Would it be possible to add a plugin command that allows to change the Y-position of the gab window? I use gabs for small dialogues but also for some other informational messages. I would liek to be able to have a different y-location for those messages.

Thanks!
 

Latest Threads

Latest Posts

Latest Profile Posts

Feeling a tad frustrated designing one map of my project... MC is supposed to grab a key from inside a kofun to escape a certain area. Unfortunately, kofuns are cramped, dark and claustrophobic: not exactly many places to run and hide in horror games. :ysad:
When ya accidentally delete a whole map and saved before you realized.

We really need a recycle bin
How the fusion of Batman+Spider-Man would be? Be creative on your replies.
Farm is all but done!

Map007.png


FarmerYard.png

Might add a wagon or something towards the bottom but I think we're good to go. ^_^

Forum statistics

Threads
131,720
Messages
1,222,618
Members
173,465
Latest member
joshywa
Top