TheGentlemanLoser

"And when we fall, we will fall together..."
Veteran
Joined
Dec 30, 2020
Messages
277
Reaction score
302
First Language
English
Primarily Uses
RMMV
MOG_ChronoEngine Item Core Compatibilty
Chrono Engine is not compatible with yanfly's item core by default. This fixes that.
Code:
var _mog_toolSys_gmap_setup = Game_Map.prototype.setup;
Game_Map.prototype.setup = function(mapId) {
   //console.log("Game_Map.prototype.setup");
   _mog_toolSys_gmap_setup.call(this,mapId);
   this._treasureEvents = [];
   this._battlersOnScreen = [];
   this._enemiesOnScreen = [];
   this._actorsOnScreen = [];
   $gameSystem._toolsOnMap = [];
   $gameTemp.clearToolCursor();
   //console.log($gameSystem._toolsData);// with itemcore, this always returns an empty array []
   //without itemcore, it returns 'null', then an the proper item  list, so clearly _toolsdata isn't getting set right
   //I assume the 'null' gets overridden by one of yanfly's blanket definitions, and since I can't find that
   // I'm just testing to see if the list is empty.  If it is, grab the tools again
   // it seems to work!
   //if (!$gameSystem._toolsData) {this.dataMapToolClear()};
   if (!$gameSystem._toolsData) {this.dataMapToolClear()
       }else{ if ($gameSystem._toolsData.length == 0) {this.dataMapToolClear()};
       }
   for (var i = 0; i < $gameParty.members().length; i++) {
       var actor = $gameParty.members()[i];
       actor.clearActing();
       $gameSystem._toolHookshotSprite = [null,null,0];
   };
};

Did I ever tell you you're my hero?
You're everything I wish that I could be
 

KillerPixEEL

Killer Pixeel Games
Veteran
Joined
Sep 4, 2019
Messages
158
Reaction score
47
First Language
English
Primarily Uses
RMMV
Does anyone know how to set up a tool to change depending on direction of tool user to target? I need animations and movements to change depending on directions so they look cracks.
 

TheGentlemanLoser

"And when we fall, we will fall together..."
Veteran
Joined
Dec 30, 2020
Messages
277
Reaction score
302
First Language
English
Primarily Uses
RMMV
Hey Restart: this thread was closed because solved but with respect to it I just wanted to say: YOU ARE A GOLDEN GOD. (Also you were really insanely patient with that newb much moreso than I ever could have been.)

I am so happy I can have automatic weapons. I mean the resource management in the game is going to be tight so you would almost never spray on full auto unless you're really dumb but it's just a wonderful to have the option on the table. I was pleasantly surprised, nay, pleasantly shocked, to find someone had already addressed the incredibly specific issue of machineguns in the Chrono Engine. (im sending you a free copy of my game when it launches I don't even care if you want it or not lol)
 

Restart

Veteran
Veteran
Joined
Mar 15, 2019
Messages
832
Reaction score
671
First Language
English
Primarily Uses
RMMV
Hey Restart: this thread was closed because solved but with respect to it I just wanted to say: YOU ARE A GOLDEN GOD. (Also you were really insanely patient with that newb much moreso than I ever could have been.)

I am so happy I can have automatic weapons. I mean the resource management in the game is going to be tight so you would almost never spray on full auto unless you're really dumb but it's just a wonderful to have the option on the table. I was pleasantly surprised, nay, pleasantly shocked, to find someone had already addressed the incredibly specific issue of machineguns in the Chrono Engine. (im sending you a free copy of my game when it launches I don't even care if you want it or not lol)
Glad I could be helpful

I have a more robust implementation of a machinegun effect in my personal project using cross engine, but I can't guarantee that it'll be easy to back-port to baseline chrono, since I also ended up doing a full split between whether a character was casting and whether they were acting, and that got tied in.


This isn't all the functions needed (you still need to pass stuff into the actual firing etc, and I do weird stuff with that that's too much to get into), but it might be helpful if you want a timed reload or something
Code:
oldToolNotes = ToolEvent.prototype.checkToolNotes 
ToolEvent.prototype.checkToolNotes = function() {
	oldToolNotes.call(this)

	this.fireCount=0;//number of times it was fired.
	this.fireMax=9999;//set a high maximum so it isn't NaN
}


Game_CharacterBase.prototype.updateCooldownDuration = function() {
     this.battler()._ras.cooldownDuration--;
	 //play reload sound when player can fire again
	 if ( (this == $gamePlayer ) && (this.battler()._ras.cooldownDuration==0))
		 {
			 AudioManager.playSe({name: 'reload', pan: 0, pitch: 100, volume: 40});
			 
			 SceneManager._scene._toolHud[0].refreshHud();
			 SceneManager._scene._toolHud[1].refreshHud();
			 SceneManager._scene._toolHud[2].refreshHud();
			 SceneManager._scene._toolHud[3].refreshHud();
		 }
	 };

// You'll need the whole cooldown system with isInCooldown() and updateCooldownDuration() wrapped into the battler update, etc, that's all in cross engine

//handler for multihit weapons
Game_CharacterBase.prototype.autoWeaponFire = function()
{
	var weaponPrimary=this.user().battler().equips()[0]//$gameParty.members()[0].equips()[0]
	var fireRate=weaponPrimary.fireRate;
	var fireMax=weaponPrimary.fireMax;
	var actfire=weaponPrimary.actfire;
	var bulletType=weaponPrimary.customBullet || 161;
	var wiggle=weaponPrimary.wiggle  || false; //for automatic weapons, instead of random fire, wiggle back and forth
	var scalingInaccuracy=weaponPrimary.scalingInaccuracy || false; //if 'true', starts accurate and scales up to 2x inaccuracy level 
	var shotCost=weaponPrimary.shotCost || 0; //default to free
	var extraCooldown=weaponPrimary.cooldown;
	
	this.chargeup=weaponPrimary.chargeup;
	this.actCharge=weaponPrimary.chargeup||false;
	if (this.chargeup){this.fireMax+=1}
	
	if (wiggle)
	{
		//full wiggle once (so left->right=>left)
		// or 1 -> -1 -> 1
		$gamePlayer.wiggleStep = 2*Math.abs(1-2*(this.fireCount/(fireMax)))-1;
	}else{
		$gamePlayer.wiggleStep=undefined
	}
	
	if ((this.fireCount==0) &&(this.chargeup))
	{
		if (this.chargeup<35)
		{
			AudioManager.playSe({name: 'sn_windup005', pan: 0, pitch: 100, volume: 90});
			//half a second
		}else{
			AudioManager.playSe({name: 'sn_windup01', pan: 0, pitch: 100, volume: 90});
			//full second
		}
		this._waitCount+=this.chargeup;
		$gamePlayer.battler()._ras.cooldownDuration+=this.chargeup;
		$gamePlayer.battler()._ras.poseDuration+=this.chargeup;
		if (this.actCharge)
		{
			$gamePlayer.battler()._ras.actDuration+=this.chargeup;
		}
	}else{
		if(Input.isPressed(Moghunter.ras_buttonWeapon) && (this.fireCount<fireMax) &&($gamePlayer.battler().mp>shotCost))
		{
			$gamePlayer.battler()._mp -= shotCost;
			$gamePlayer.act(bulletType)//our generic multibullet
		}else{
			$gamePlayer.battler()._ras.cooldownDuration+=extraCooldown
			this.erase();
		}
		
		if(actfire)
		{
			$gamePlayer.battler()._ras.actDuration+=fireRate;
		}
		this._waitCount+=fireRate;
	}
	this.fireCount++;
	
	if($gamePlayer.battler()._ras.poseDuration>0)
	{
		$gamePlayer.battler()._ras.poseDuration+=fireRate+1;
	}
	
	if($gamePlayer.battler()._ras.cooldownDuration>0)
	{
		$gamePlayer.battler()._ras.cooldownDuration+=fireRate+1;
	}

}

and then had something in the weapon notes like this to set custom params
Code:
Tool Id : 162

  <On Creation Eval>
   item.fireMax= 10; //maximum bullets fired
   item.inaccuracy=25; //amount of inaccuracy
   item.fireRate=4;//frames between shots
  </On Creation Eval>

anyway dunno if that'll be helpful or not, but figured I might as well dump some code in my code dump thread
 
Last edited:

thesupernova

Villager
Member
Joined
Sep 14, 2020
Messages
17
Reaction score
3
First Language
English
Primarily Uses
RMMV
@Restart I was wondering if you had any plans to work in a multiplayer component. One thing I’ve been wanting to do with my Chrono engine game is multiplayer a la Legend Of Zelda: Four Swords, but I’m still learning JS and am a long way off from doing this myself. If not, that’s cool, but you seem to be the guy for Chrono engine stuff.
 

Restart

Veteran
Veteran
Joined
Mar 15, 2019
Messages
832
Reaction score
671
First Language
English
Primarily Uses
RMMV
@Restart I was wondering if you had any plans to work in a multiplayer component. One thing I’ve been wanting to do with my Chrono engine game is multiplayer a la Legend Of Zelda: Four Swords, but I’m still learning JS and am a long way off from doing this myself. If not, that’s cool, but you seem to be the guy for Chrono engine stuff.
Nah, that's a pretty big project and it's outside the scope of what I'm doing. There are a few people who have done multiplayer plugins, you might awant to try those.

That said I'm not super optimistic about it, there's a lot of under-the-hood changes that need to be made to accomplish that.
 

thesupernova

Villager
Member
Joined
Sep 14, 2020
Messages
17
Reaction score
3
First Language
English
Primarily Uses
RMMV
Nah, that's a pretty big project and it's outside the scope of what I'm doing. There are a few people who have done multiplayer plugins, you might awant to try those.

That said I'm not super optimistic about it, there's a lot of under-the-hood changes that need to be made to accomplish that.
Yeah, I’ve been messing with a few different ones. They work great on most engines but they tend to conflict with moghunter’s engines. It’s all good. It will force me to get better at JS anyways. I appreciate the reply.
 

Restart

Veteran
Veteran
Joined
Mar 15, 2019
Messages
832
Reaction score
671
First Language
English
Primarily Uses
RMMV
The post is currently in review, but I just put together a plugin called FOSSIL, which lets MV plugins work in MZ.

Most importantly, it works with Chrono Engine!

 

FlintX

ChronoEngine enthusiast
Member
Joined
Apr 24, 2021
Messages
9
Reaction score
5
First Language
Portuguese
Primarily Uses
RMMV
Hello there @Restart. I know you don't seem to care too much about the Chrono mode of the Chrono Engine, but I started using your Cross Engine recently and I'm afraid something in there made some things not properly work anymore in said mode.

For example: In the original Chrono Engine when starting a battle in Chrono mode, the followers characters moves to positions relative to the player character as some sort of battle formation, just before the battle starts. With Cross Engine however, this feature is not present anymore and the player character and followers just stand still on their respective default places.

Something directly in Cross Engine is confirmed to be the cause of the issue because I tested it on your raw demo with default settings, and the same thing happens. So it is not a an issue caused by something I edited in my project, neither a conflict with other pluggins or with the pluggings order placement in the list. I also tried swapping and placing them in different positions, but obviously Cross Engine will cause any other kind of issues if moved anywhere above Moghunter pluggins.

Turning off Cross Engine alone makes it work again. So AltimitMovement is not the cause of the issue, or at least I think it isn't. However, AltimitMovement doesn't work in Chrono Engine without Cross Engine regardless. So... No Chrono mode if you want to use them together, or at least not a fully working Chrono Mode.

Anyways, you don't have any reasons to care about this in the first place, but just in case you happen to know or have a way to fix this issue, please let me know. I really like to use your unlocked frames feature, Altimit movement and other Cross Engine features on Chrono Mode. Really nice stuff. Stay safe.
 

EndriuHagrid

Veteran
Veteran
Joined
May 4, 2021
Messages
30
Reaction score
1
First Language
English
Primarily Uses
RMMV
Unlocking Character Poses
One thing that was annoying about chrono engine was the limitation on character poses. By default it parses the first of a given tag in a character image filename, so having a character with nonstandard frames locks all the poses to be identical.

For instance, if you had $Harold(f6)(f2) as your protagonist, your idle pose can ONLY be named $Harold(f6)(f2)_idle, and so is forced to be a 6 frame pose going at 2x speed


These three functions, combined, remove that limit. Now you can put $Harold(f6)(f2)_idle(f4)(s1) into your folder, and harold will settle down to 1x speed when doing a 4-frame idle pose.


How does it work?

First, the initialize tweak means that we create a full list of character names when the game first starts up.

The setPose tweak uses that character name list. It will still default to whatever exact pose you select, but if it doesn't find that EXACT pose, it will check to see if there's a character image which is that pose followed by some suffixes.

Finally, the setCharacterFrames tweaks the parsing on the filename tags, so it always picks the LAST one instead of the first one. So the pose's tags will override the main image name. As a bonus, it will also parse negative direction shifts as well as positive.

Code:
var _crossengine_game_sys_init = Game_System.prototype.initialize
Game_System.prototype.initialize = function() {
     _crossengine_game_sys_init.call(this);
    this.crossEngine={};
    this.rebuildFileList();
   
};

Game_System.prototype.rebuildFileList = function () {
    //create a list of image files in our character directory. 
    // This is necessary for the automatic pose recognition
    // so for example you can have $Character(f6).png and $Character(f6)_idle(f3).png
    // and the default pose code to apply _idle will detect the right character name
    //
   
    var fs = require ("fs");
    var path = require('path');
    var base = path.dirname(process.mainModule.filename);
    //let dir = fs.readdirSync( './img/characters/' );
    let dir = fs.readdirSync( path.join(base, '/img/characters/'));
    this.crossEngine.characterNameList = dir.filter( elm => elm.match(new RegExp(`.*\.(png)`, 'ig')));
    this.crossEngine.characterNameListLC=['hello world'];//this should never appear in game.
    //slice off the .png extension
    for (var index =0; index<this.crossEngine.characterNameList.length;index++)
    {
        this.crossEngine.characterNameList[index]=this.crossEngine.characterNameList[index].slice(0, -4);
        //create a lower case version of it so that we can do case matching for poses
        this.crossEngine.characterNameListLC[index]=this.crossEngine.characterNameList[index].toLowerCase();
    }
}

//rebuild our file list whenever we load a save game (to make testing easier)

var _cross_onLoadSuccess = Scene_Load.prototype.onLoadSuccess;
Scene_Load.prototype.onLoadSuccess=function(){
        _cross_onLoadSuccess.call(this)
        $gameSystem.rebuildFileList();
}


//==============================
// * From Mog_CharPoses.js
//==============================
// I have altered this with a fallback that CHECKS to see if a pose exists.
//if it DOES exist, then we proceed as normal.
//if it does NOT exist, then we first check to see if there's a pose with different
//parameters (like _idle(f3) instead of just _idle
//if that exists, then we use that one instead
//if it does not exist, we don't load anything
//and whine in the console about it

//BASICALLY:
// set your frames and speed and y offset and all that jazz
// at the end of your original image name
// AND at the end of any poses
// and everything will be fine and dandy
// if you have multiple versions of a pose file I think it PROBABLY just picks
// whichever is alphabetically first if you don't specify the exact file name
// but honestly that's a weird edge case and if you REALLY want to get that effect
// you're better off manipulating the framerate or y offset or whatever dynamically
// instead of having seperate files

// ALSO: since this scans once when the game initializes
// if your image files change midgame the list will get stale
// but like
// don't do that, alright?  That's weird, and if you have something that complex
// you should just code your own system.
Game_CharacterBase.prototype.setPose = function() {
     this._poses.idle[3] = false;
     //default to keeping the same pose
     var newPose=this._originalName.name;
     if (this.isFaintPose()) {
         newPose = this.setFaintPose();
     } else if (this.isKnockbackPose()) {
         newPose = this.setKnockbackPose();
     } else if (this.isGuardPose()) {
         newPose = this.setGuardingPose();        
     } else if (this.isActionPose()) {
         newPose = this.setActionPose();
     } else if (this.isVictoryPose()) {
         newPose = this.setVictoryPose();   
     } else if (this.isCastingPose()) {
         newPose = this.setCastingPose();   
     } else if (this.isAttackingPose()) {
         newPose = this.setAttackingPose();                      
     } else if (this.isPickUPPose()) {
         newPose = this.setPickUPPose();
     } else if (this.isPushPullPose()) {
         newPose = this.setPushPullPose();    
     } else if (this.isDashingPose()) {
         newPose = this.setDashPose();
     } else if (this.isJumpingPose()) {
         newPose = this.setJumpPose();
     } else if (this.isIdlePose()) {
         newPose = this.setIdlePose();    
     };
     // this code didn't do anything in stock chrono engine.  Mog was probably
     // planning to expand this.  Commented out for now
     /* if (this.isDiagonalDefaultPose()) {
         newPose = this.setDiagonalDefaultPose();
     } else {
         newPose = this._originalName.name;
     }; */
   

    //if the pose exists, return with it.  Otherwise we will have to see if the
    //parameters are different
    var fs = require ("fs");
    if ( fs.existsSync("./img/characters/" + newPose+'.png'))
    {
        //console.log(newPose)
        return newPose
    }else{
        for (var index =0; index<$gameSystem.crossEngine.characterNameList.length;index++)
        {
            if ($gameSystem.crossEngine.characterNameList[index].startsWith (newPose))
            {
                return $gameSystem.crossEngine.characterNameList[index];
            }
        }
        console.log('Could not find '+newPose+', using base image.')
        return this._originalName.name
    }
       
};

//From MOG_CharPoses
//==============================
// * Set Character Frames
//==============================
// I have edited this so you can have both negative offsets for x and y
// AND it now checks the LAST offset, not the first one.
// this means that if you have a pose with a different number of frames
// than the default, it'll pick up on that!
// for example, if the base character is Bob(f3), you can now have
// Bob(f3)_punch(f12)
Game_Character.prototype.setCharacterFrames = function() {
    this.clearCharacterFrames();
    var frames = this._characterName.match(/(\(F(\d+\.*\d*))/gi)
    if (frames) {
       this._frames.enabled = true;
       this._frames.index = 0;
       this._frames.max = Number(frames[frames.length-1].match(/\d+/i));
    }
        //edited to include support for negative offsets
    var ex = this._characterName.match(/(X(-?\d+\.*\d*))/gi)
    if (ex) {this._frames.x = Number(ex[ex.length-1].match(/-?\d+/i))};
    var ey = this._characterName.match(/(Y(-?\d+\.*\d*))/gi)
    if (ey) {this._frames.y = Number(ey[ey.length-1].match(/-?\d+/i))};
    var sp = this._characterName.match(/(S(\d+\.*\d*))/gi)
    if (sp) {this._frames.speed = Number(sp[sp.length-1].match(/\d+/i))};
    if (this._frames.enabled) {this._pattern = 0};
    this._pattern = this._frames.enabled ? 0 : 1;
};
Where I should paste this code to make it work without errors?
 

Zyeard

Villager
Member
Joined
May 28, 2014
Messages
10
Reaction score
3
First Language
portugues
Primarily Uses
RMXP
Hi, Restart, could you or someone help me edit the position of the enemy HP bar!?
I use the Mog Enemy HP plugin, but in the original project, the bar only appears on the screen, and I'd like it to be positioned above the enemy event on the map, I would, I'm using the phone, but once I'm home, can I attach a copy of the plugin.
 

Zyeard

Villager
Member
Joined
May 28, 2014
Messages
10
Reaction score
3
First Language
portugues
Primarily Uses
RMXP
As I said, here is a copy of the Moghunter plugin, thanks for any help!
 

Restart

Veteran
Veteran
Joined
Mar 15, 2019
Messages
832
Reaction score
671
First Language
English
Primarily Uses
RMMV
Sorry, don't have time to do commissions.

Anyway, here's another bugfix for chrono engine that I had to make in my project.

One thing you'll sometimes notice (especially if your map has a lot of doodads) is that sometimes shooting a bullet in chrono engine will make some of the events and doodads on the screen flicker - they vanish for one frame, then reappear.

This appears to be because mog adds the sprite to the list without sorting it, so under rare circumstances rpgmaker gets confused and puts that sprite (and everything after it in the list) below the tile map, effectively hiding them from view.

The trick is to just sort the list whenever we add a sprite - here's the replacement function for addToolSprite.

Code:
//==============================
// * Add Tool Sprite
//==============================
Spriteset_Map.prototype.addToolSprite = function() {
    $gameSystem._eventDataToolRequestAddSprite = false;
    $gameMap.events().forEach(function(event) {
        if (event._tool.addSprite) {
            this._characterSprites.push(new Sprite_Character(event));
            var index = this._characterSprites.length - 1;
            if (this._characterSprites[index]) {
                this._tilemap.addChild(this._characterSprites[index]);
            };
            event._tool.addSprite = false;
            this._tilemap._sortChildren(); //if this doesn't get sorted, 
            //sometimes if you create a tool, there will be random one frame flickers
            //as sprites get pushed to below the tilemap and vanish from sight.
            //this can be VERY noticeable with doodads.
        };
    }, this);    
};
 

Uranium

Game Dev, Pixel Artist
Veteran
Joined
Jan 13, 2017
Messages
162
Reaction score
61
First Language
English
Primarily Uses
RMMV
Unlocking Character Poses
One thing that was annoying about chrono engine was the limitation on character poses. By default it parses the first of a given tag in a character image filename, so having a character with nonstandard frames locks all the poses to be identical.

For instance, if you had $Harold(f6)(f2) as your protagonist, your idle pose can ONLY be named $Harold(f6)(f2)_idle, and so is forced to be a 6 frame pose going at 2x speed


These three functions, combined, remove that limit. Now you can put $Harold(f6)(f2)_idle(f4)(s1) into your folder, and harold will settle down to 1x speed when doing a 4-frame idle pose.


How does it work?

First, the initialize tweak means that we create a full list of character names when the game first starts up.

The setPose tweak uses that character name list. It will still default to whatever exact pose you select, but if it doesn't find that EXACT pose, it will check to see if there's a character image which is that pose followed by some suffixes.

Finally, the setCharacterFrames tweaks the parsing on the filename tags, so it always picks the LAST one instead of the first one. So the pose's tags will override the main image name. As a bonus, it will also parse negative direction shifts as well as positive.

Code:
var _crossengine_game_sys_init = Game_System.prototype.initialize
Game_System.prototype.initialize = function() {
     _crossengine_game_sys_init.call(this);
    this.crossEngine={};
    this.rebuildFileList();
  
};

Game_System.prototype.rebuildFileList = function () {
    //create a list of image files in our character directory.
    // This is necessary for the automatic pose recognition
    // so for example you can have $Character(f6).png and $Character(f6)_idle(f3).png
    // and the default pose code to apply _idle will detect the right character name
    //
  
    var fs = require ("fs");
    var path = require('path');
    var base = path.dirname(process.mainModule.filename);
    //let dir = fs.readdirSync( './img/characters/' );
    let dir = fs.readdirSync( path.join(base, '/img/characters/'));
    this.crossEngine.characterNameList = dir.filter( elm => elm.match(new RegExp(`.*\.(png)`, 'ig')));
    this.crossEngine.characterNameListLC=['hello world'];//this should never appear in game.
    //slice off the .png extension
    for (var index =0; index<this.crossEngine.characterNameList.length;index++)
    {
        this.crossEngine.characterNameList[index]=this.crossEngine.characterNameList[index].slice(0, -4);
        //create a lower case version of it so that we can do case matching for poses
        this.crossEngine.characterNameListLC[index]=this.crossEngine.characterNameList[index].toLowerCase();
    }
}

//rebuild our file list whenever we load a save game (to make testing easier)

var _cross_onLoadSuccess = Scene_Load.prototype.onLoadSuccess;
Scene_Load.prototype.onLoadSuccess=function(){
        _cross_onLoadSuccess.call(this)
        $gameSystem.rebuildFileList();
}


//==============================
// * From Mog_CharPoses.js
//==============================
// I have altered this with a fallback that CHECKS to see if a pose exists.
//if it DOES exist, then we proceed as normal.
//if it does NOT exist, then we first check to see if there's a pose with different
//parameters (like _idle(f3) instead of just _idle
//if that exists, then we use that one instead
//if it does not exist, we don't load anything
//and whine in the console about it

//BASICALLY:
// set your frames and speed and y offset and all that jazz
// at the end of your original image name
// AND at the end of any poses
// and everything will be fine and dandy
// if you have multiple versions of a pose file I think it PROBABLY just picks
// whichever is alphabetically first if you don't specify the exact file name
// but honestly that's a weird edge case and if you REALLY want to get that effect
// you're better off manipulating the framerate or y offset or whatever dynamically
// instead of having seperate files

// ALSO: since this scans once when the game initializes
// if your image files change midgame the list will get stale
// but like
// don't do that, alright?  That's weird, and if you have something that complex
// you should just code your own system.
Game_CharacterBase.prototype.setPose = function() {
     this._poses.idle[3] = false;
     //default to keeping the same pose
     var newPose=this._originalName.name;
     if (this.isFaintPose()) {
         newPose = this.setFaintPose();
     } else if (this.isKnockbackPose()) {
         newPose = this.setKnockbackPose();
     } else if (this.isGuardPose()) {
         newPose = this.setGuardingPose();       
     } else if (this.isActionPose()) {
         newPose = this.setActionPose();
     } else if (this.isVictoryPose()) {
         newPose = this.setVictoryPose();  
     } else if (this.isCastingPose()) {
         newPose = this.setCastingPose();  
     } else if (this.isAttackingPose()) {
         newPose = this.setAttackingPose();                     
     } else if (this.isPickUPPose()) {
         newPose = this.setPickUPPose();
     } else if (this.isPushPullPose()) {
         newPose = this.setPushPullPose();   
     } else if (this.isDashingPose()) {
         newPose = this.setDashPose();
     } else if (this.isJumpingPose()) {
         newPose = this.setJumpPose();
     } else if (this.isIdlePose()) {
         newPose = this.setIdlePose();   
     };
     // this code didn't do anything in stock chrono engine.  Mog was probably
     // planning to expand this.  Commented out for now
     /* if (this.isDiagonalDefaultPose()) {
         newPose = this.setDiagonalDefaultPose();
     } else {
         newPose = this._originalName.name;
     }; */
  

    //if the pose exists, return with it.  Otherwise we will have to see if the
    //parameters are different
    var fs = require ("fs");
    if ( fs.existsSync("./img/characters/" + newPose+'.png'))
    {
        //console.log(newPose)
        return newPose
    }else{
        for (var index =0; index<$gameSystem.crossEngine.characterNameList.length;index++)
        {
            if ($gameSystem.crossEngine.characterNameList[index].startsWith (newPose))
            {
                return $gameSystem.crossEngine.characterNameList[index];
            }
        }
        console.log('Could not find '+newPose+', using base image.')
        return this._originalName.name
    }
      
};

//From MOG_CharPoses
//==============================
// * Set Character Frames
//==============================
// I have edited this so you can have both negative offsets for x and y
// AND it now checks the LAST offset, not the first one.
// this means that if you have a pose with a different number of frames
// than the default, it'll pick up on that!
// for example, if the base character is Bob(f3), you can now have
// Bob(f3)_punch(f12)
Game_Character.prototype.setCharacterFrames = function() {
    this.clearCharacterFrames();
    var frames = this._characterName.match(/(\(F(\d+\.*\d*))/gi)
    if (frames) {
       this._frames.enabled = true;
       this._frames.index = 0;
       this._frames.max = Number(frames[frames.length-1].match(/\d+/i));
    }
        //edited to include support for negative offsets
    var ex = this._characterName.match(/(X(-?\d+\.*\d*))/gi)
    if (ex) {this._frames.x = Number(ex[ex.length-1].match(/-?\d+/i))};
    var ey = this._characterName.match(/(Y(-?\d+\.*\d*))/gi)
    if (ey) {this._frames.y = Number(ey[ey.length-1].match(/-?\d+/i))};
    var sp = this._characterName.match(/(S(\d+\.*\d*))/gi)
    if (sp) {this._frames.speed = Number(sp[sp.length-1].match(/\d+/i))};
    if (this._frames.enabled) {this._pattern = 0};
    this._pattern = this._frames.enabled ? 0 : 1;
};


Do I need to use CrossEngine plugin to utilize the Unlocking of Character Poses?
I tried adding all of this above code to a JS and import it but did nothing. How exactly do I go about implementing these 3 steps??

Do I create a new .JS for the First part of code? ie....

var _crossengine_game_sys_init = Game_System.prototype.initialize
Game_System.prototype.initialize = function() {
_crossengine_game_sys_init.call(this);
this.crossEngine={};
this.rebuildFileList();

};

Game_System.prototype.rebuildFileList = function () {
//create a list of image files in our character directory.
// This is necessary for the automatic pose recognition
// so for example you can have $Character(f6).png and $Character(f6)_idle(f3).png
// and the default pose code to apply _idle will detect the right character name
//

var fs = require ("fs");
var path = require('path');
var base = path.dirname(process.mainModule.filename);
//let dir = fs.readdirSync( './img/characters/' );
let dir = fs.readdirSync( path.join(base, '/img/characters/'));
this.crossEngine.characterNameList = dir.filter( elm => elm.match(new RegExp(`.*\.(png)`, 'ig')));
this.crossEngine.characterNameListLC=['hello world'];//this should never appear in game.
//slice off the .png extension
for (var index =0; index<this.crossEngine.characterNameList.length;index++)
{
this.crossEngine.characterNameList[index]=this.crossEngine.characterNameList[index].slice(0, -4);
//create a lower case version of it so that we can do case matching for poses
this.crossEngine.characterNameListLC[index]=this.crossEngine.characterNameList[index].toLowerCase();
}
}

//rebuild our file list whenever we load a save game (to make testing easier)

var _cross_onLoadSuccess = Scene_Load.prototype.onLoadSuccess;
Scene_Load.prototype.onLoadSuccess=function(){
_cross_onLoadSuccess.call(this)
$gameSystem.rebuildFileList();
}



And then Do I edit the .js MOG.CharaPoses for the second and third part of this process?




I cant figure out how to get this working so I can use different names Example... $Hero01(F8)(S1)_act01(F5)(S3)
 
Last edited:

Restart

Veteran
Veteran
Joined
Mar 15, 2019
Messages
832
Reaction score
671
First Language
English
Primarily Uses
RMMV
cross engine contains basically all these snippits and shouldn't be required to use them

basically just paste the snippits into a new js file and import it as a plugin to overwrite the existing moghunter function
 

Uranium

Game Dev, Pixel Artist
Veteran
Joined
Jan 13, 2017
Messages
162
Reaction score
61
First Language
English
Primarily Uses
RMMV
cross engine contains basically all these snippits and shouldn't be required to use them

basically just paste the snippits into a new js file and import it as a plugin to overwrite the existing moghunter function
Okay so basically all I need to do is copy and paste everything inside the "Code" box that you posted and paste into a New Javascript, save that file import into rpg maker and should be all good?

Is it okay to have all your explanation in there also?? or do I just have to paste the code snippets.
 

Restart

Veteran
Veteran
Joined
Mar 15, 2019
Messages
832
Reaction score
671
First Language
English
Primarily Uses
RMMV
just put the code in as code
 

Zyeard

Villager
Member
Joined
May 28, 2014
Messages
10
Reaction score
3
First Language
portugues
Primarily Uses
RMXP
Hello , once again asking for help to save my project, well this time the problem is with the ToolSkill Menu, when I select the empty space it shows this error, does anyone know how to fix it?
I really appreciate it, any help!
 

Latest Threads

Latest Posts

Latest Profile Posts

After so long, my random sprites set is complete! I wonder who could guess them all? :kaothx:
2COlHup.png

And yes, I'm doing more.
I'm thinking of devouring some tutorials for RPG Maker MV. Just all kinds: mapping, spriting, programming, ect. the whole works! :)

Maybe videos, my brother and I can sit down and watch them during one of our weekly business meetings.
Ami
trying to make a Dialogue Script in Indonesian,first. then translate into English.

this is the reason why i'm terrible at this section beside making the enemies :stare:
Made a Mapping Tutorial on Adding Lighting/Shadows using Tileset

Forum statistics

Threads
113,921
Messages
1,078,398
Members
148,031
Latest member
HellionX
Top