CROSS ENGINE: Combining Chrono Engine with Altimit Movement

DTurtle

Regular
Regular
Joined
Nov 23, 2016
Messages
42
Reaction score
4
Primarily Uses
N/A
Code:
$gamePlayer.startMapEvent(this.character(0).x, this.character(0).y, [1, 2], false);
However I don't use your jump plugin, I use the jump_to function from Galv move route extras
Code:
this.character(-1).jump_to($gameVariables.value(30),$gameVariables.value(31));
ah, I also use Move Route Extras but for some reason they never work within tool page stuff, even if they're called by a common event. Works fine in any event outside of that though.
 

AquaEcho

Script Kitty
Regular
Joined
Sep 20, 2021
Messages
2,267
Reaction score
1,702
First Language
English
Primarily Uses
RMMV
ah, I also use Move Route Extras but for some reason they never work within tool page stuff, even if they're called by a common event. Works fine in any event outside of that though.
If you call a function that normally goes in a move route from the event page instead, or a common event page, you need to change this to this.character(0)
 

DTurtle

Regular
Regular
Joined
Nov 23, 2016
Messages
42
Reaction score
4
Primarily Uses
N/A
If you call a function that normally goes in a move route from the event page instead, or a common event page, you need to change this to this.character(0)
yeah, it doesn't move the character either way. Only thing that happens is the tool pose plays. I've tried -1 and 0 both inside and outside of a move route call. Testing trying to move it to a specific point before I spend a day trying to figure out how to move down 2 from any spot.
 

Attachments

  • Screen Shot 2023-08-31 at 2.51.03 PM.png
    Screen Shot 2023-08-31 at 2.51.03 PM.png
    76 KB · Views: 6
  • Screen Shot 2023-08-31 at 2.56.10 PM.png
    Screen Shot 2023-08-31 at 2.56.10 PM.png
    77.8 KB · Views: 6

AquaEcho

Script Kitty
Regular
Joined
Sep 20, 2021
Messages
2,267
Reaction score
1,702
First Language
English
Primarily Uses
RMMV
yeah, it doesn't move the character either way. Only thing that happens is the tool pose plays. I've tried -1 and 0 both inside and outside of a move route call. Testing trying to move it to a specific point before I spend a day trying to figure out how to move down 2 from any spot.
I just told you if you're using a move route then it's just "this", with "this" being the object of the movement route.

this.character(0) refers to the object where the code is called from), this.character(-1) is the player but those are object references you use on an event page outside a move route.

In your movement route you're already declaring the player as the object for the function to act on. If you do not use a movement route then the object is the Game Interpreter itself which movement functions don't work on, so you need to define this.character(eventNumber), or 0, or -1 so the Game Interpreter knows which event you actually want to move.
 
Last edited:

DTurtle

Regular
Regular
Joined
Nov 23, 2016
Messages
42
Reaction score
4
Primarily Uses
N/A
I just told you if you're using a move route then it's just "this", with this being the tool event itself.
this.character(0) refers to the tool event (more specifically the object where the code is called from), this.character(-1) is the player but those are object references you use on an event page outside a move route.
Looking through your replies and you didn't state this anywhere, I mean I appreciate the help but in general you're incredibly unclear. "this.jump_to(xy)" moves the character but doesn't trigger the event it lands on
 

AquaEcho

Script Kitty
Regular
Joined
Sep 20, 2021
Messages
2,267
Reaction score
1,702
First Language
English
Primarily Uses
RMMV
Looking through your replies and you didn't state this anywhere, I mean I appreciate the help but in general you're incredibly unclear. "this.jump_to(xy)" moves the character but doesn't trigger the event it lands on
Could you post your jump tool event page again?
 

TheSevenWonders

Villager
Member
Joined
May 19, 2018
Messages
27
Reaction score
7
First Language
English
Primarily Uses
RMMV
Latest Version: Cross Engine Alpha 0.20.06.26 Demo Project




What is Cross Engine?

Over the course of the last few months I've been working on my game, and I decided I wanted to combine Altimit Movement and Mog's Chrono Engine. Cross Engine is what I call the big pile of functions that makes both of them work together, giving both pixel movement and ABS mode.

It also includes bugfixes, and QoL features that came up when I was doing things (most of my notes to self thread is included). Basically, this is all stuff I found useful, and hope that other people will find useful as well.

Why's it called Cross Engine? Partially because it's a Cross-Compatible Engine for making games, but mostly because it's a followup to a beloved classic which killed off Chrono.


Compatibility Patches

Cross Engine now works with yanfly's itemcore, altimit movement, yanfly's item spawner, yanfly's doodads, and galv's camera plugin (the last of which is actually essential to avoiding event/doodad jitter).

Also, Ultra Mode 7.

8-directional, 2 directional, and 1-directional Spritesheets:

Sure, a lot of people have 8-directional spritesheets (and I support all the major formats), but how many people have ONE-directional spritesheets?

With Cross Engine, you can take any old image, give it a filename, and put it in.

ameEN5K.png

Save it as $Angel(f1)(d1).png, and BAM, it's usable as an event. No mucking around in photoshop making a spritesheet with four versions of the same sprite.

But that's not all! I also added intelligent sprite flipping, as well. If you named that angel $Angel(f1)(d-1).png instead, it will flip to face left if it moves left, and flip to face right if it moves right.

Split poses and actions
One of the things really dragging down the pace of a chrono engine game is that characters were locked in place while they animated. I have changed the engine so now you have a separate 'pose duration' and 'act duration'. Pose duration means your character is playing an animation, act duration means they can't move or cast anything. I've also added a 'cooldown duration', which lets you move, but doesn't let you cast any abilities.

Intelligent Tag Parsing
1) Tags parse from right-to-left, instead of left-to-right. This seems super minor, but it means that if your base character sprite is $Harold(f4)(d8), and he has a casting pose "_casting(f8)(d1)", then the new spritesheet sizes will take precedence!

2) Filename Completion: Let's say your idle sprite for harold is "$Harold(f4)(d8)_idle(f1)(d1)". In base Chrono engine this would cause rpgmaker to screech to a halt, because it can't find "$Harold(f4)(d8)_idle".

However, upon starting up the game, Cross Engine makes a list of every file in your characters folder. When it checks for poses, it will first check for an exact match. If it doesn't get it, it will check to see if there's any longer versions of that filename. If it checks for "$Harold(f4)(d8)_idle", and can't find it, it will return "$Harold(f4)(d8)_idle(f1)(d1)".

What if there's no match at all? The event keeps its base sprite. In playtesting, it will whine about it in the console. No crashing.

3) Negative values are now allowed for x and y offsets.

Walking actions
You know how in megaman you can shoot your little gun and megaman keeps on walking? Using the tag (walking) will keep your character in the same part of the animation cycle when transitioning into the new pose. Practically speaking, that means you can do the megaman things. If the character isn't moving, it will fall back onto a _static pose, so you don't run in place whenever you shoot.

Standing Pose
One of the big constraints on having fluid animation in rmmv is that your walking frames have to include a static pose used for standing. If you define a 'standing' pose, your character will use that instead when they aren't moving. While you can technically do this with an idle pose, I wanted to have both in my project.

Faint Poses
Mog was going to implement faint/death poses distinct from damage poses, but didn't end up finishing it. I have an implementation of this, so you can have a robot get banged up a bit when it gets hit, then violently explode into a miserable pile of circuits when it dies.

Basic Preloader Function
One thing you'll notice using chrono engine is that whenever creatures change poses for the first time, you'll sometimes see a flicker as the file loads. I have added a function which preloads all poses for a creature. If you enter ImageManager.preloadPoses('Ralph'), it will find 'Ralph_attack', 'Ralph_defense', 'Ralph_is_unstoppable(F4)(d8)(s2)(x4)', et cetera, and preload them. This doesn't happen automatically - you have to invoke it each time you're worried about preloading.

New plugin command: disable_idleposes
Turns off idle poses. Good for cutscenes where characters mugging at the camera is unwanted. Turn them back on with enable_idleposes

Intelligent Rotations

Do you want a magic circle of spinning runes? I've got you covered. In chrono engine, rotations are around the bottom center of the sprite, wherever it is. In Cross Engine, the axis of rotation is the base of the event - the offsets you put into filenames, (y124) or (x12) or whatever, move the sprite without changing where rotations are - so if you have a 128 pixel tall wheel and put (y64) into the filename, rotating it will spin it!

I also have functions that let you tell an event to spin its sprite, and whether or not there's an angle it should stop at. So you can have a compass that always points at the player or at a monster or something.

And if you use the this.rotFaceTarg() function, your bullets will point to face the direction that they're going to move towards. In a move route, put it on the same line, directly after one of the motion-ordering commands (like rLoc, tLoc, shootForward, or shootPastPlayer)

A big pile of helper functions
I've got a bunch of functions with short names for stuff that I ended up doing often, like converting directions to vectors or angles, or making characters move in a specific direction. For instance, being able to type in tLoc(x,y) to get a character to move directly to the location x,y makes writing moveroutes and scripts a lot easier.

Just like the Chrono Engine which preceded it, you're best off starting with the working demo project and building outwards. The cross engine plugin itself should be reasonably drop-in for an existing Chrono Engine project, but I honestly haven't tried it.

1) Will you make a compatibility patch for (this random plugin)?

If I end up using that plugin in my game, yes. Otherwise probably not, there's a lot of plugins out there.

2) I have a compatibility patch for chrono engine and (some plugin) - will you add it?

If it doesn't break anything, sure.

3) I have a bug report!

If it's in ABS mode, upload either a minimal test case or a bugfix.

4) What if I'm reporting a bug that isn't in ABS Mode?

We've moved on past Chrono Engine. This is the sequel, Cross Engine. Chrono died in the timeskip. It's sad but we all have to live with it. You can report Chrono bugs but I probably won't do anything about it.

4) But what if I have a bugfix for a bug in Chrono mode.

Oh well in that case, sure. Just because I don't care about poor dead Chrono doesn't mean other people don't.

5) I'm using yanfly item core with this and I'm just getting a 'cancel' beep when I try to use a sword or my shield isn't working or whatever

Turn on midgame note parsing.

6) What are the future plans?

I'll keep adding features that I personally find useful, and fix bugs I encounter.

7) I want to take cross engine and make my own thing based on it.

Go ahead, just credit with a linkback, and stick a link in this thread to wherever your project is.


PLUGIN ORDER:
This is from the demo project, but I'm putting this here as well
gvOI9Z8.png

LICENSE:
This is a cross compatibility patch, which means that it borrows heavily from the underlying plugins. Do whatever you want with my contributions, but don't take that as permission to violate any terms for the underlying plugins I'm stitching together. Use it commerically, noncommerically, as a basis for your own compatibility engine, whatever. Please credit.

CREDIT INSTRUCTIONS for using Cross Engine:
For Cross Engine specifically, credit 'Restart', and make sure you also credit Moghunter and Altimit Community Contributors for their massive contributions. Neither of those plugins' terms require it but I think they deserve it :).


DEMO CREDITS:
* Moghunter made the original Chrono Engine, as well as the original chrono engine demo which I'm including.

* The Altimit Community Contributors is the official copyright group listed for Altimit Movement, but I think we all know that it wouldn't have happened without Xilefian.

* Galv's Camera Plugin is included (with permission) in the bundle as well, because it's needed to control the unholy jitter this stack of plugins creates.

* Yanfly gave me permission to include some of the original code when making the YEP_EventSpawner compatibility patch.
Hello there, I want to use this plugin for a project, but the demo has graphical issues. Character attack animations do not work, and the sprites seem to be labeled incorrectly which make the 8 directional movement along with others glitch out. I hoped there would be an update as I tried using this a year ago but it's still the same. Can you possibly update the errors, so it works as intended?
 

OgreLeg

Regular
Regular
Joined
Nov 23, 2017
Messages
55
Reaction score
11
First Language
English
Primarily Uses
RMMV
I wrote this code to check every battler on screen every 60 frames/1 second for status conditions/states/buffs. Put it in a parallel common event. There's a line in there for poison damage (default state 4) to do 10 percent of the battler's max hp every second. Don't forget the Wait 60 frames at the end, otherwise it'll run 60 times a second. To control how long the state lasts you need to go to the MOG_ChronoEngine in the plugin list and change the States Duration value in the parameters.
Code:
for (var i = 0; i < $gameMap._battlersOnScreen.length; i++) {
battler = $gameMap._battlersOnScreen[i].battler();
if (!battler.isDead()){
if(battler.isStateAffected(4)){
this.changeHp(battler, -(Math.floor(battler.mhp*.10)), true);}
battler.startDamagePopup();
battler.updateStateTurns();
battler.updateBuffTurns();
battler.removeStatesAuto(1);
battler.removeStatesAuto(2);}}

I finally got around to trying this out. It did not work for me, but I was still able to find a solution because of it. That .battler() function was exactly what I needed.

var battler = this.battler(); if(battler.isStateAffected(4)){ this.act(73) };

I tacked that into the front of my NPC's custom move route and it ticks poison damage like a charm. Effectively, it gets the NPC to basically damage itself with a 0 range on-user projectile to simulate a DOT tick. Thanks for the help!
 

OgreLeg

Regular
Regular
Joined
Nov 23, 2017
Messages
55
Reaction score
11
First Language
English
Primarily Uses
RMMV
Looking through your replies and you didn't state this anywhere, I mean I appreciate the help but in general you're incredibly unclear. "this.jump_to(xy)" moves the character but doesn't trigger the event it lands on

If you post this as a script call right after the player lands from jumping it will activate any event the player happens to be standing on:

JavaScript:
$gameMap.refresh();
var radius = 0
var mapEv = $gameMap.events();
var listEv = mapEv.length;
var player = $gamePlayer;
for (var i = 0; (i < $gameMap.events().length + 1); i++) {
var thatEv = mapEv[i];
if (!!$gameMap.event(i) && $gameMap.event(i) != player) {
if (Math.round(Math.hypot($gameMap.event(i).x - player.x, $gameMap.event(i).y - player.y)) <= radius) {
$gameMap.event(i).start();
} } };

That "var radius = 0" part is the range of activation. If you want some sort of splash activation you can change that number. For example, a 2 would activate the event you landed on and also all events within a 2 tile radius.

If you're scripting inside a move route just put it all together as one line and paste it into your move route as a script call:

JavaScript:
$gameMap.refresh(); var radius = 0; var mapEv = $gameMap.events(); var listEv = mapEv.length; var player = $gamePlayer; for (var i = 0; (i < $gameMap.events().length + 1); i++) { var thatEv = mapEv[i]; if (!!$gameMap.event(i) && $gameMap.event(i) != player) { if (Math.round(Math.hypot($gameMap.event(i).x - player.x, $gameMap.event(i).y - player.y)) <= radius) { $gameMap.event(i).start(); } } };

P.S.
- Keep in mind that when working with move route scripting the Event's movement option for "Frequency" (Freq: under Speed:) will effect how quickly your scripts fire off just like it does with an event's movements.
 
Last edited:

AquaEcho

Script Kitty
Regular
Joined
Sep 20, 2021
Messages
2,267
Reaction score
1,702
First Language
English
Primarily Uses
RMMV
I finally got around to trying this out. It did not work for me, but I was still able to find a solution because of it. That .battler() function was exactly what I needed.

var battler = this.battler(); if(battler.isStateAffected(4)){ this.act(73) };

I tacked that into the front of my NPC's custom move route and it ticks poison damage like a charm. Effectively, it gets the NPC to basically damage itself with a 0 range on-user projectile to simulate a DOT tick. Thanks for the help!
You implemented something wrong because it does work. As I told DTurtle, I do in fact test the scripts I post before posting them. Also, my script checks for ALL status and buffs and will clear them up after so many frames. Just those two lines is for poison damage.

As an aside, I (and RCXGaming) recently fixed the hookshot to bounce against walls as defined by either a region ID or terrain tag
Put this script in a new plugin file at the end of your project's plugin list. Change where it says 100 to the region ID of your wall.

Code:
// altered hookshot so it retracts faster than it flies out.
Game_Character.prototype.processMoveCommandTool = function(command) {
    if (this._tool.boomerang[0]) {
        if (this._tool.boomerang[1] > 0) {
            this._tool.boomerang[1]--;
            this.moveForward();
        } else {
            this.moveTowardCharacter(this._tool.user);
            this._tool.forcingMove = 2;
        };
    } else if (this._tool.hookshot.enabled) {
    if($gameMap.regionId(this.x+.5,this.y+.5) === 100){
      this.hookShotTink();
      this.erase();
                  this.moveTowardCharacter(this._tool.user);
        this._tool.forcingMove = 2;
    }
        if (!this._tool.hookshot.locked) {
            this._directionFix = true;
            if (this._tool.hookshot.range > 0) {
                this._tool.hookshot.range--;
                this.moveForward();
            } else {
                if (this._tool.forcingMove != 2)
                {
                    //first time we change to retracting, increase speed
                    this._moveSpeed+=1;
                }
            
                this.moveTowardCharacter(this._tool.user);
                this._tool.forcingMove = 2;
            };
        } else {
            this._tool.forcingMove = 2;
        };
    };
};

If you want to use terrain tag instead change
Code:
$gameMap.regionId(this.x+.5,this.y+.5)
to
Code:
$gameMap.terrainTag(this.x+.5,this.y+.5)

Use it with the below hookshot settings
 

Attachments

  • 1694012106194.png
    1694012106194.png
    297.8 KB · Views: 3
Last edited:

OgreLeg

Regular
Regular
Joined
Nov 23, 2017
Messages
55
Reaction score
11
First Language
English
Primarily Uses
RMMV
You implemented something wrong because it does work. As I told DTurtle, I do in fact test the scripts I post before posting them. Also, my script checks for ALL status and buffs and will clear them up after so many frames. Just those two lines is for poison damage.

The code was fine, I was just saying it didn't work for me. I've got a lot of custom code flying around my project on top of various plugins. I didn't see any reason it shouldn't, it just wasn't firing off for me on my project for whatever reason. I saw what you were going for, though, and learned something new out of it that solved my problem so it all worked out in the end. Much obliged! o7

EDIT: Like, seriously thank you. I'd been at this particular issue a while and you saved me a lot of time.
 
Last edited:

AquaEcho

Script Kitty
Regular
Joined
Sep 20, 2021
Messages
2,267
Reaction score
1,702
First Language
English
Primarily Uses
RMMV
EDIT: Like, seriously thank you. I'd been at this particular issue a while and you saved me a lot of time.
It's fine. I just updated the script again because there was a bug: enemies that died from poison damage weren't being erased, toggling their self switch, and dropping treasure. This should fix that.
Edit: Updated again with a better damage function
Code:
for (var i = 0; i < $gameMap._battlersOnScreen.length; i++) {
char = $gameMap._battlersOnScreen[i];
battler = $gameMap._battlersOnScreen[i].battler();
 if(battler.isStateAffected(4)){battler.gainHp(-Math.floor(battler.mhp*.10));
  if(battler.isDead() && battler.isEnemy()){char.setDeadEnemy(char, battler);}}
battler.startDamagePopup();
battler.updateStateTurns(); battler.updateBuffTurns();
battler.removeStatesAuto(1); battler.removeStatesAuto(2);}
 

Attachments

  • 1694221416357.png
    1694221416357.png
    225.6 KB · Views: 3
Last edited:

AquaEcho

Script Kitty
Regular
Joined
Sep 20, 2021
Messages
2,267
Reaction score
1,702
First Language
English
Primarily Uses
RMMV
I was just saying it didn't work for me.
Ok, I think I know what your issue is: BattlersOnScreen wasn't being initialized in ABS mode unless you force it, but that has its own issues, in that it will either not affect enemies outside of when you force it, or crash the game if you refresh it with a new screen of enemies but an enemy from the previous screen is still affected by a state.

Try this instead, it'll sample the player and every enemy on the map
Code:
for (var i = 0; i < $gameMap.allEnemiesOnMap().length; i++) {
char = $gameMap.allEnemiesOnMap()[i];
battler = $gameMap.allEnemiesOnMap()[i].battler();
 if(battler.isStateAffected(4)){battler.gainHp(-Math.floor(battler.mhp*.10));
  if(battler.isDead() && battler.isEnemy()){char.setDeadEnemy(char, battler);}}
battler.startDamagePopup();
battler.updateStateTurns(); battler.updateBuffTurns();
battler.removeStatesAuto(1); battler.removeStatesAuto(2);}
JavaScript:
player = $gameMap.players()[0].battler();
if(player.isStateAffected(4)){player.gainHp(-Math.floor(player.mhp*.10));}
player.startDamagePopup();
player.updateStateTurns(); player.updateBuffTurns();
player.removeStatesAuto(1); player.removeStatesAuto(2);
 

Attachments

  • 1694225707888.png
    1694225707888.png
    334.6 KB · Views: 6
Last edited:

Ancient_Eagle

Regular
Regular
Joined
Dec 28, 2020
Messages
103
Reaction score
30
First Language
Arabic
Primarily Uses
RMMV
Hello everyone, I just want to ask you something when I test the game by using guns, when I equipped as a gun, It's good thing I can shoot while I walk, but it stop like 1 second and then move, it's break attack-move break attack-move break attack-move, I need to make this character can walk and run while he shooting without break.
Also, is there way to make a gun 4 directions? I just saw there a megagun only 2 direction (left and right).
 

AquaEcho

Script Kitty
Regular
Joined
Sep 20, 2021
Messages
2,267
Reaction score
1,702
First Language
English
Primarily Uses
RMMV
Hello everyone, I just want to ask you something when I test the game by using guns, when I equipped as a gun, It's good thing I can shoot while I walk, but it stop like 1 second and then move, it's break attack-move break attack-move break attack-move, I need to make this character can walk and run while he shooting without break.
Also, is there way to make a gun 4 directions? I just saw there a megagun only 2 direction (left and right).
There is a thread about gun tools here:
 

Ancient_Eagle

Regular
Regular
Joined
Dec 28, 2020
Messages
103
Reaction score
30
First Language
Arabic
Primarily Uses
RMMV
I did the same thing, but it keeps break 1 second and walk.

This script I found move route:
this.locate(this.user().x+Math.sign(this.user()._zoomData[0])*0.8,this.user().y-0.6); this._direction=5+Math.sign(this.user()._zoomData[0]);this.rLoc(20*this.user()._zoomData[0],0)

1695232183686.png
 

AquaEcho

Script Kitty
Regular
Joined
Sep 20, 2021
Messages
2,267
Reaction score
1,702
First Language
English
Primarily Uses
RMMV
Did you try setting the pose duration to 0? From that thread:
moving while firing can be accomplished by setting the pose duration on the arrow to 0.
 

Ancient_Eagle

Regular
Regular
Joined
Dec 28, 2020
Messages
103
Reaction score
30
First Language
Arabic
Primarily Uses
RMMV
I did like I said, it still break 1 sec and walk

1695232699433.png
 

AquaEcho

Script Kitty
Regular
Joined
Sep 20, 2021
Messages
2,267
Reaction score
1,702
First Language
English
Primarily Uses
RMMV
Could you try changing the tool cooldown duration to 0?
 

Ancient_Eagle

Regular
Regular
Joined
Dec 28, 2020
Messages
103
Reaction score
30
First Language
Arabic
Primarily Uses
RMMV
It goes faster, but still break and walk.
Edit: maybe there's something we can modify this event id 73, but I don't know how.
 

Latest Threads

Latest Posts

Latest Profile Posts

Approaching the Jam and the Cameo update on both games!
Lemme know what you need in the Cameo Update on its manual!
Perhaps some combo tips & tricks? Character Build Tips? or just general info?!
Alright.. now to get knee deep into Individual Items and Materia to create a MZ augment system. See ya'll in a week xD
BALDURS GATE 3 - GAME OF THE YEAR
mfw you spent 3 hours watching game awards and no elden ring DLC :)
Another day, another advent calendar addition. And now it's time to vote for what comes next! We've seen Strength with our adventurers and Charisma with our merchants, so which DnD stat would you like to see in the next NPC: Constitution or Wisdom?

Forum statistics

Threads
136,825
Messages
1,270,448
Members
180,586
Latest member
Baelhw
Top