Original Source
- Original title: dopan's prioCharZ.js
- Original author: dopan
- Original date: November 8, 2022
- Source thread: https://forums.rpgmakerweb.com/threads/dopans-priocharz-js.152546/
- Source forum path: Game Development Engines > RPG Maker Javascript Plugins > JS Plugin Releases (RMMV)
Summary
dopan's prioCharZ.js By default we could only change chars Z anchor by editing the "priorityType".. This can be done with funny numbers to get the wanted result, but it overwrites the default data which is not stored anywhere else. By default "priorityTypes" are the trigger for screenZ:
Archived First Post
dopan's prioCharZ.js
By default we could only change chars Z anchor by editing the "priorityType"..
This can be done with funny numbers to get the wanted result, but it overwrites the default data which is not stored anywhere else.
By default "priorityTypes" are the trigger for screenZ:
if priorityType = 0 # thats "below chara" and "screenZ_1"
if priorityType = 1 # thats "same as chara" and "screenZ_3"
if priorityType = 2 # thats "above chara" and "screenZ_5"
That happens because of these default rpgMV Functions:
Game_CharacterBase.prototype.screenZ = function() {
return this._priorityType * 2 + 1;
};
//"screenZ()" gets updated with this from the Sprite_Character
Sprite_Character.prototype.updatePosition = function() {
this.x = this._character.screenX();
this.y = this._character.screenY();
this.z = this._character.screenZ();
};
This plugin Provides you with scriptcalls that can replace "priorityType", without overwriting it.
It can be reseted to default with scriptcalls aswell and the "priorityType" wont be Touched/Edited. It will be replaced instead.
(default "priorityType" remains as system default storage)
Basicly "._charZ" the PluginData which replaces "._priorityType", when "._charZ" is not Undefined, is a PlaceHolder & Script Clone of the "._priorityType"-script.
(on these examples Number of eventId & dataId & _charZ must be added)
- $gameMap.event(eventId)._charZ;
# eventId start with 1 #
- $gamePlayer._charZ;
# ._charZ can be any number that returns a valid z.Anchor #
- $gamePlayer._followers._data[dataId]._charZ;
# dataId start with 0 #
The plugin provides you with more scriptcalls and Infos, i just wanted to show the basic infos here
MIT Licence
Free to Use for any Project
GitHub Link
Plugin Code:
//=============================================================================
// prioCharZ.js
//=============================================================================
/*:
* @plugindesc v1.0 <prioCharZ> Controll the Z_Anchor of Chars & manipulate prioType
* @author dopan
*
*
*
*
* @help
*
* this plugin allows to change the z data of Chars
*
* it works for $gameMap.event(id) & $gamePlayer & "gameFollowers"
*
* this wont edit the prioType directly, and can be reseted to default prioType
*
* the default prioTypes have following default rpgMV maker system Z data:
*
* # prio0 = screenZ_1 # prio1 = screenZ_3 # prio2 = screenZ_5 #
*
* default rpgMV maker system prio 0 is called "belowChara"
*
* default rpgMV maker system prio 1 is called "sameAsChara"
*
* default rpgMV maker system prio 2 is called "aboveChara"
*
*
* __Plugin ScriptCalls __ ALWAYS INSERT NUMBERS AS DATA TO THE ScriptCall-ARRAYS
*
* # for $gameMap.event(id) # insert eventId number & zValue number
*
* - $gameMap.setCharPrio(eventId, zValue); # eventId of manipulated event ,zValue is the z Achor and can be any Number
*
* - $gameMap.resetCharPrio(eventId); # eventId of event ,that will be reseted to default prioType data
*
* # for $gamePlayer # insert zValue number
*
* - $gamePlayer.setCharPrio(zValue); # zValue is the z Achor and can be any Number, it replaces the prioType data
*
* - $gamePlayer.resetCharPrio(); # reset $gamePlayer to default prioType data
*
* # for $gamePlayer._followers # insert dataId number & zValue number
*
* - $gamePlayer._followers.setCharPrio([dataId], zValue); # dataId starts with 0 (decides which follower is triggered), zValue is the new Z Anchor
*
* - $gamePlayer._followers.resetCharPrio([dataId]); # dataId starts with 0 (decides which follower is triggered)
*
*
*
*
* # default rpgMV maker system Scriptcalls to double check ScreenZ:
* (it cant change data it only shows the final data which is used, its often updated by the system)
*
* # for $gameMap.event(id) # insert eventId
*
* - $gameMap.event(eventId).screenZ(); # shows the Final Z data which is used for eventCharAnchor based on eventId
*
* # for $gamePlayer # insert nothing
*
* - $gamePlayer.screenZ(); # shows the Final Z data which is used for gamePlayer Char Anchor
*
* # for $gamePlayer._followers # insert dataId number
*
* - $gamePlayer._followers._data[dataId].screenZ(); # dataId starts with 0 (decides which follower is triggered)
*---------------------------------------------------------------------------------------------------------------
*
* pls Note: All scriptCalls return the current active Z anchor in Console F8 !
*
*(Plugin scriptCalls return false if any added data/eventId/Number ect is wrong)
*
* CREDITS to Eliaquim who mentioned a similar idea in rpg maker Forum
*
* ============================================================================
* Terms of Use (MIT License)
* ============================================================================
* Free for any commercial or non-commercial project!
* (edits are allowed but pls dont claim it as yours without Credits.thx)
* ============================================================================
* Changelog
* ============================================================================
* Version 1.0:
* - first Release 08.11.2022 for rpg mv!
*/
(function() {
// Plugin param Variables:
var parameters = PluginManager.parameters("prioCharZ") ||
$plugins.filter(function (plugin) {return plugin.description.contains('<prioCharZ>')});
//-----------------------------------------------------------------------------------------
// replace Default function
// dopan add Z controll.. by default=> # prio0 = screenZ 1 # prio1 = screenZ 3 # prio2 = screenZ 5 #
Game_CharacterBase.prototype.screenZ = function() {
// if new Z was installed
if (this._charZ !== undefined) return this._charZ;
// default function usage
return this._priorityType * 2 + 1;
};
// new functions:
Game_Map.prototype.setCharPrio = function(eventId, zValue) {
var evId = eventId; var charZ = zValue;
if (this.event(evId) && charZ) this.event(evId)._charZ = charZ; return this.event(evId)._charZ
return false;
};
Game_Map.prototype.resetCharPrio = function(eventId) {
if (this.event(evId)._charZ !== undefined) this.event(evId)._charZ = undefined; return this.event(evId).screenZ();
return false;
};
Game_Player.prototype.setCharPrio = function(zValue) {
var charZ = zValue;
if (charZ) this._charZ = charZ; return this._charZ
return false;
};
Game_Player.prototype.resetCharPrio = function() {
if (this._charZ !== undefined) this._charZ = undefined; return this.screenZ();
return false;
};
Game_Followers.prototype.setCharPrio = function(dataId, zValue) {
var dId = dataId; var charZ = zValue;
if (dId && charZ) this._data[dId]._charZ = charZ; return this._data[dId]._charZ
return false;
};
Game_Followers.prototype.resetCharPrio = function(dataId) {
var dId = dataId;
if (dId && this._charZ !== undefined) this._data[dId]._charZ = undefined; return this._data[dId].screenZ();
return false;
};
//--End:
})();
----
----
SideNote:
if anybody is looking for a free plugin that can manipulate the x/y Anchors of Chars pls visit here:
Character Anchors
forums.rpgmakerweb.com
Downloads / Referenced Files
Log in, then follow the RPG Maker Developers Group to see these download links.
Log in to downloadLicense / Terms Note
* CREDITS to Eliaquim who mentioned a similar idea in rpg maker Forum * * ============================================================================ * Terms of Use (MIT License)
Referenced Images / Attachments
Creator Claims / Removal
If you are the original creator and want this listing reassigned, edited, or removed, join BMMPlay and contact the moderators with proof that matches the original RPG Maker Web profile, linked GitHub, itch.io page, or another public creator identity.
Replies (0)
No replies yet.
Topic Summary
Loading summary...