Altimit Pixel Movement [0.50β]

Discussion in 'JS Plugin Releases (RMMV)' started by xilefian, Oct 9, 2017.

  1. ---

    --- - Member

    Messages:
    26
    Likes Received:
    5
    First Language:
    -
    Primarily Uses:
    RMMV
    @xilefian

    By any chance, have you planned to split this plugin into several parts?

    I would like to use the part that the random movement routes also make diagonal movement.
     
  2. xilefian

    xilefian Veteran Veteran

    Messages:
    119
    Likes Received:
    176
    First Language:
    English
    Yep I've been aware of this one for a while. Need to re-write the "follow" logic to see what's up.

    EDIT: Updated with a small fix for web-deployed games; Plugin-defined colliders weren't loading correctly, this broke the web demo for a while, which is now fixed.

    @El Dragón Blanco what do you mean by using the random movement part? This Plugin won't get split into parts as it is meant as a drop-in replacement for default movement. Some candidates for being split include the extra frames addition, but there's no effort to split that off at the time being.
     
    Last edited: Dec 31, 2017
  3. operamaniac

    operamaniac Newbie^2 Member

    Messages:
    16
    Likes Received:
    2
    Location:
    Indonesia
    First Language:
    Indonesia
    Primarily Uses:
    RMMV
    Hi xilefan, I really like this plugin! Will you add diagonal sprites option in the future? I know there's so many already, but it either break something or it displaying the sprite incorrectly.

    NEVERMIND! I found a solution! I'm using your plugin with Victor Engine Diagonal Movement, I always put your plugin under his plugin and the problem always happen. I thought it was problem with the diagonal movement script. Then, after a week of frustation I tried to put yours above Victor's and it works flawlessly!!

    Thanks for this wonderful plugin!!!!!! :D
     
    Last edited: Dec 31, 2017
  4. xilefian

    xilefian Veteran Veteran

    Messages:
    119
    Likes Received:
    176
    First Language:
    English
    This Plugin already has support for diagonal sprites. You need to create an XML file defining the frames for your diagonal sprite. A guide will be written in the future and currently there's no support for sprite indexes.

    Here's an example XML file for adding 8 direction frames to Actor1: https://github.com/AltimitSystems/mv-plugins/issues/22#issuecomment-348990865
     
  5. operamaniac

    operamaniac Newbie^2 Member

    Messages:
    16
    Likes Received:
    2
    Location:
    Indonesia
    First Language:
    Indonesia
    Primarily Uses:
    RMMV
    That's even better! I don't know about that.
    I will look that up later.

    Will you add support for running sprites too? Maybe it's too early to mention that, but I'm just curious if it's on your plan for this awesome plugin. :)
     
  6. xilefian

    xilefian Veteran Veteran

    Messages:
    119
    Likes Received:
    176
    First Language:
    English
    There's already support for running sprites. In that example I linked they're called "dashing" sprites - so it's the "dashing" state that sets them.

    There's plans to add more states, like idling and jumping, as well as custom states like swimming or swinging a sword/casting a fishing rod with configurable playback support.
     
    vico likes this.
  7. Solarphantom

    Solarphantom A badass Member

    Messages:
    19
    Likes Received:
    9
    First Language:
    English
    Primarily Uses:
    N/A
    Ok so I have some questions about this plug in. First, Is it free or a paid licensed to use in a project I plan on selling?

    Would I be able to use the XML to use more than 3 frames for the movement animations or sprites larger than 48x48?

    I was going to try to make one myself but after my spaghetti code fell apart in unreal, I kinda lost faith in my own ability to program.
     
    vico likes this.
  8. xilefian

    xilefian Veteran Veteran

    Messages:
    119
    Likes Received:
    176
    First Language:
    English
    Free license, it's MIT, so don't pretend you made it yourself.

    Yes XML defines extra frames and sprites can be any size you want.

    EDIT: Beta is now at 0.41

    This brings a re-write of the mouse/touch input system, so it is now far more reliable than it was before (please give it a test) and fixes a bug related to interacting over counters.

    This also has a re-write of the follower logic. Whilst the cause of the "falling behind" was not solved, the followers will now be more strict about keeping up with the player. The teleportation logic has been improved too, so followers will only teleport to "catch up" when they are off the screen, rather than a certain distance to who they are following (fixes being able to see them teleport away).

    I also improved the characters wobbling on the map issue. It does look like a bug in MV and I've identified the source of it, so I will investigate further and then make a bug report in the official MV github project.

    This also looks to be the same source of the characters-disconnect-on-map-seams bug, but I don't have confirmation that this is fixed.
     
    Last edited: Jan 2, 2018
    ∊η∊ηra likes this.
  9. Solarphantom

    Solarphantom A badass Member

    Messages:
    19
    Likes Received:
    9
    First Language:
    English
    Primarily Uses:
    N/A
    Ohh dont worry, I couldn't claim something as small as a pixel as my own if I didn't make it.
    I was just wondering because if it was a paid license I would probably have to sell my soul lol.
     
  10. operamaniac

    operamaniac Newbie^2 Member

    Messages:
    16
    Likes Received:
    2
    Location:
    Indonesia
    First Language:
    Indonesia
    Primarily Uses:
    RMMV
    Glad to hear that. Looking forward to your amazing work!
     
  11. ---

    --- - Member

    Messages:
    26
    Likes Received:
    5
    First Language:
    -
    Primarily Uses:
    RMMV
    @xilefian

    After installing your plugin, the events can move in diagonal directions when you put random movement in movement routes. Now good?
     
  12. vico

    vico Veteran Veteran

    Messages:
    160
    Likes Received:
    18
    First Language:
    Portuguese
    Primarily Uses:
    RMMV
    Isnt this "falling behind" a feature, like how Chrono Trigger followers have a delay when player starts dashing??
     
  13. xilefian

    xilefian Veteran Veteran

    Messages:
    119
    Likes Received:
    176
    First Language:
    English
    Sorry I don't understand what you are asking here. I can't remember how the random movement works, I'll look it up, but I'll definitely make diagonal movement configurable from the Plugin parameters.

    It only happens in certain movement patterns (moving south east tends to trigger it), so it is a bug. I haven't coded any logic for the Chrono Trigger style behaviour (but I certainly am considering it).
     
  14. RZephyr07

    RZephyr07 Villager Member

    Messages:
    28
    Likes Received:
    1
    First Language:
    English
    Do you have a roadmap of features planned, xilefian? If we were to *cough* line your pocketbook a bit, are there certain features you might consider more strongly adding?

    For instance, I'd love to see customizable acceleration/momentum added. Right now, movement is very rigid.

    Image based collision maps is something I've seen on some of the other plugins. Yours could really benefit from something similar.

    Some light platforming features would put me on the moon (jumping, platforms... see Victor's work in Ace) and I'd definitely donate a good amount for something like that.
     
  15. xilefian

    xilefian Veteran Veteran

    Messages:
    119
    Likes Received:
    176
    First Language:
    English
    Yes any funding will help with development tremendously. You can pretty much pay me to add any feature you want (after I assess its viability).

    Acceleration/momentum is something we've discussed before, it's totally possible, just need to implement it in a good way. Image based collision maps is also very possible and I've thought about this one and investigated it already - just need the excuse to implement it.

    As for platforming, I won't be adding this feature as part of the Plugin. There's already some platforming Plugins out there that are designed with that genre in mind (so they do a better job than what hacking together this Plugin will do). Although it is possible to hack it together (all you really need to do is say "gravity goes down, jump makes you go up") I definitely do not want to make it part of the core Plugin.
     
    operamaniac likes this.
  16. Ace of Spades

    Ace of Spades Veteran Veteran

    Messages:
    48
    Likes Received:
    67
    First Language:
    English
    I've noticed that this plugin changes the default $gamePlayer.isMoving() function, which is interfering with another plugin I'm using. Is there any other way to have a conditional branch check if the player is moving?
     
  17. xilefian

    xilefian Veteran Veteran

    Messages:
    119
    Likes Received:
    176
    First Language:
    English
    You should just be able to plug $gamePlayer.isMoving() into the script section of the conditional branch (page 4). You definitely don't need a Plugin to do something that simple.

    Also try putting your other Plugin below Altimit Movement. I expect your other Plugin should be calling the isMoving base method.

    When I get round to it I'll see about removing this particular override. I think it was there for compatibility with vanilla MV for something that is now replaced in Altimit Movement, I will need to check.
     
  18. Ace of Spades

    Ace of Spades Veteran Veteran

    Messages:
    48
    Likes Received:
    67
    First Language:
    English
    Thank you for the help. Just to clarify, putting $gamePlayer.isMoving() into the script section of a conditional branch no longer returns true while the player is moving.

    The other plugin I was using is Galv's Character Animations plugin, and I believe you are correct; it appears to be calling the isMoving function to determine when to show the walking/dashing animation as well as idle animation. Unfortunately, putting the plugin below yours didn't resolve the problem.


    //-----------------------------------------------------------------------------
    // Galv's Character Animations
    //-----------------------------------------------------------------------------
    // For: RPGMAKER MV
    // GALV_CharacterAnimations.js
    //-----------------------------------------------------------------------------
    // 2017-10-28 - Version 1.7 - Fixed follower dash bug I made with last update
    // 2017-10-26 - Version 1.6 - Added ability for events to use char anims
    // 2017-07-02 - Version 1.5 - Changed to reset animation frame to first when
    // - switching between idle, run, walk, jump
    // 2016-07-01 - Version 1.4 - Fixed bug when event running idle not working
    // 2016-04-18 - Version 1.3 - Added graphic change when jumping
    // 2015-11-16 - Version 1.2 - Fixed a bug with idle not activating in event
    // 2015-11-11 - Version 1.1 - added Galv plugin command efficiency code
    // 2015-11-03 - Version 1.0 - release
    //-----------------------------------------------------------------------------
    // Terms can be found at:
    // galvs-scripts.com
    //-----------------------------------------------------------------------------

    var Imported = Imported || {};
    Imported.Galv_CharacterAnimations = true;

    var Galv = Galv || {}; // Galv's main object
    Galv.pCmd = Galv.pCmd || {}; // Plugin Command manager
    Galv.CA = Galv.CA || {}; // Galv's stuff

    //-----------------------------------------------------------------------------
    /*:
    * @plugindesc (v.1.7) Make the player and follower characters use different
    * graphics for idle, walk and run. View HELP for more info.
    *
    * @author Galv - galvs-scripts.com
    *
    * @param Use Jump Graphic
    * @desc true or false. If true, when jumping, player will use 4th character slot in their character sheet
    * @Default true
    *
    * @param Common Event ID
    * @desc The common event ID that runs when the idle time expires
    * @Default 0
    *
    * @param Common Event Time
    * @desc Amount of frames the player is idle until above common event
    * is activated
    * @Default 0
    *
    * @param Repeat Common Event
    * @desc Can be 0 or 1. If 1, the above common event is repeated
    * every time the Common Event Time passes. 0 is no repeat
    * @Default 0
    *
    * @Help
    * Galv's Character Animations
    * ----------------------------------------------------------------------------
    * To use this script, you will need a character spritesheet for each of your
    * actors that will be in the party (the full 8 character sheet). While on
    * the map, the characters will change their appearance within their sheets.
    * While not moving (idle) they will use the first character. While walking,
    * they will use the second character. And while running, they will use the
    * third character.
    * If you have "Use Jump Graphic" set to true, they will use the forth
    * character as the jump graphic. The jumping graphic will use each frame in
    * a different way.
    * Left = start of jump, mid = middle of jump, right = end of jump
    *
    * While this is happening, the player's step animation is active (meaning
    * while stopped, the idle pose will be stepping). This is so you can make
    * movement in your idle poses.
    *
    * The settings in the plugin allow you to run a common event after the player
    * has been idle for a certain amount of frames. (60 frames per second).
    *
    * The plugin command below can be used to turn functionality on and off.
    * (For Actors Only)
    *
    * ----------------------------------------------------------------------------
    * PLUGIN COMMAND
    * ----------------------------------------------------------------------------
    *
    * CHARANIM STATUS // STATUS can be TRUE or FALSE
    *
    * ----------------------------------------------------------------------------
    * Example:
    * CHARANIM FALSE // Disables the character animations
    * CHARANIM TRUE // Enables them again. They are enabled by default
    * ----------------------------------------------------------------------------
    *
    * ----------------------------------------------------------------------------
    * EVENTS
    * ----------------------------------------------------------------------------
    *
    * Event functionality is now also possible for any event with the note tag:
    *
    * <charAnims>
    *
    * Events will use idle, walk and jump automatically but as they do not have
    * a way to dash/run by default, you need to use in a move route the script:
    *
    * this._isDashing = status; // status can be true or false
    *
    * This will make it when they move they will use the dashing pose or walking
    * id turned on or off respectively;
    *
    * You can temporarily disable an event's character animation functionality
    * in a move route using:
    *
    * this.disableCharAnims = status; // true to disable, false to re-enable
    *
    * NOTE: When exiting/re-entering the map or changing scenes, this will
    * revert to it's original state. Only use for special event motions for
    * example in cutscenes for events that have charAnims on.
    *
    *
    * For events, you can set which poses are used for idle, walk, dash, jump by
    * using another note tag (the first is still required):
    *
    * <charAnimSetup:i,w,d,j> // i = idle index (0 for first character)
    * // w = walk index
    * // d = dash index
    * // j = jump index
    *
    * ----------------------------------------------------------------------------
    * Find the plugin demo for examples!
    * ----------------------------------------------------------------------------
    */


    //-----------------------------------------------------------------------------
    // CODE STUFFS
    //-----------------------------------------------------------------------------



    (function() {
    Galv.CA.ceventId = Number(PluginManager.parameters('Galv_CharacterAnimations')["Common Event ID"]);
    Galv.CA.ceventId = Number(PluginManager.parameters('Galv_CharacterAnimations')["Common Event ID"]);
    Galv.CA.ceventTime = Number(PluginManager.parameters('Galv_CharacterAnimations')["Common Event Time"]);
    Galv.CA.ceventRepeat = Number(PluginManager.parameters('Galv_CharacterAnimations')["Repeat Common Event"]);
    Galv.CA.useJump = PluginManager.parameters('Galv_CharacterAnimations')["Use Jump Graphic"].toLowerCase() == 'true' ? true : false;


    // GALV'S PLUGIN MANAGEMENT. INCLUDED IN ALL GALV PLUGINS THAT HAVE PLUGIN COMMAND CALLS, BUT ONLY RUN ONCE.
    if (!Galv.aliased) {
    var Galv_Game_Interpreter_pluginCommand = Game_Interpreter.prototype.pluginCommand;
    Game_Interpreter.prototype.pluginCommand = function(command, args) {
    if (Galv.pCmd[command]) {
    Galv.pCmd[command](args);
    return;
    };
    Galv_Game_Interpreter_pluginCommand.call(this, command, args);
    };
    Galv.aliased = true; // Don't keep aliasing for other Galv scripts.
    };

    // Direct to Plugin Object
    Galv.pCmd.CHARANIM = function(arguments) {
    Galv.CA.animChange(arguments);
    };
    // END GALV'S PLUGIN MANAGEMENT


    Galv.CA.animChange = function(status) {
    if (status[0] === "TRUE") {
    $gamePlayer.disableCharAnims = false;
    $gamePlayer._stepAnime = true;
    } else if (status[0] === "FALSE") {
    $gamePlayer.disableCharAnims = true;
    $gamePlayer._stepAnime = false;
    };
    };


    //-----------------------------------------------------------------------------
    // Game Character
    //-----------------------------------------------------------------------------

    Galv.CA.Game_Character_initMembers = Game_Character.prototype.initMembers;
    Game_Character.prototype.initMembers = function() {
    Galv.CA.Game_Character_initMembers.call(this);
    this.idleTime = 0;
    this._currentAnimIndex = 0;
    this._charAnimIndex = [0,1,2,3]; // [idle, walk, run, jump
    };

    Galv.CA.Game_Character_update = Game_Character.prototype.update;
    Game_Character.prototype.update = function(sceneActive) {
    Galv.CA.Game_Character_update.call(this,sceneActive);
    if (!this.disableCharAnims) this.updateCharAnims();
    };

    if (Galv.CA.useJump) {
    Galv.CA.Game_Character_jump = Game_Character.prototype.jump;
    Game_Character.prototype.jump = function(xPlus, yPlus) {
    Galv.CA.Game_Character_jump.call(this, xPlus, yPlus);
    this._jumpValues = [this._jumpCount * 0.3, this._jumpCount * 0.7];
    this._stopCount = 0;
    this._pattern = 0;
    };

    // update with jump
    Game_Character.prototype.updateCharAnims = function() {
    if (this.isJumping()) {
    this.charAnimJump();
    } else if (this.isMoving()) {
    this.charAnimMove();
    } else {
    this.charAnimCheckIdle();
    };
    };
    } else {
    // update without jump
    Game_Character.prototype.updateCharAnims = function() {
    if (this.isMoving()) {
    this.charAnimMove();
    } else {
    this.charAnimCheckIdle();
    };
    };
    };

    Game_Character.prototype.charAnimJump = function() {
    this._stopCount = 0;
    if (this._jumpCount > this._jumpValues[1]) { // start of jump
    this._pattern = 0;
    } else if (!this._jumpCount || this._jumpCount < this._jumpValues[0]) { // end of jump
    this._pattern = 2;
    } else {
    this._pattern = 1;
    };
    this.setAnimIndex(3);
    this.idleTime = 0;
    };

    Game_Character.prototype.charAnimMove = function() {
    if (this.isDashing()) {
    this.setAnimIndex(2);
    } else {
    this.setAnimIndex(1);
    };
    this.idleTime = 0;
    };

    Game_Character.prototype.charAnimCheckIdle = function() {
    this.idleTime += 1;
    if (this.idleTime === 5) this.charAnimIdle();
    };

    Game_Character.prototype.charAnimIdle = function() {
    this._stepAnime = true;
    this.setAnimIndex(0);
    };

    Game_Character.prototype.setAnimIndex = function(ind) {
    var ind = this._charAnimIndex[ind];
    if (this._currentAnimIndex != ind) {
    this._pattern = 0;
    this._animationCount = 0;
    this._currentAnimIndex = ind;
    };
    this._characterIndex = ind;
    };


    //-----------------------------------------------------------------------------
    // Game Player
    //-----------------------------------------------------------------------------

    Game_Player.prototype.charAnimCheckIdle = function() {
    Game_Character.prototype.charAnimCheckIdle.call(this);
    if (this.idleTime === Galv.CA.ceventTime) this.charAnimCevent();
    };

    Game_Player.prototype.charAnimCevent = function() {
    if ($gameMap._interpreter.isRunning()) return this.idleTime = 0;
    $gameTemp.reserveCommonEvent(Galv.CA.ceventId);
    if (Galv.CA.ceventRepeat === 1) return this.idleTime = 0;
    };

    Game_Player.prototype.setAnimIndex = function(ind) {
    var ind = this._charAnimIndex[ind];
    if (this._currentAnimIndex != ind) {
    this._pattern = 0;
    this._animationCount = 0;
    this.followers()._data.forEach(function(actor) {
    actor._pattern = 0;
    actor._animationCount = 0;
    }
    );
    this._currentAnimIndex = ind;
    };

    this._characterIndex = ind;
    this.followers()._data.forEach(function(actor) {
    actor._characterIndex = ind;
    }
    );
    };


    //-----------------------------------------------------------------------------
    // Game Follower
    //-----------------------------------------------------------------------------

    Game_Follower.prototype.charAnimMove = function() {
    if ($gamePlayer.isDashing()) {
    this.setAnimIndex(2);
    } else {
    this.setAnimIndex(1);
    };
    this.idleTime = 0;
    };


    //-----------------------------------------------------------------------------
    // Game Event
    //-----------------------------------------------------------------------------

    Galv.CA.Game_Event_initialize = Game_Event.prototype.initialize;
    Game_Event.prototype.initialize = function(mapId, eventId) {
    this._isDashing = false;
    Galv.CA.Game_Event_initialize.call(this, mapId, eventId);
    this.disableCharAnims = !this.event().meta.charAnims;
    this.charAnimSetup();
    };

    Game_Event.prototype.charAnimSetup = function(mapId, eventId) {
    // setup new indexes for character animations based on tag <charAnimSetup:i,w,d,j>
    var tag = this.event().meta.charAnimSetup;
    if (tag) {
    var array = tag.split(',');
    for (var i = 0; i < array.length; i++) {
    this._charAnimIndex = Number(array);
    }
    }
    };

    Game_Event.prototype.isDashing = function() {
    return this._isDashing;
    };

    })();
     
  19. vico

    vico Veteran Veteran

    Messages:
    160
    Likes Received:
    18
    First Language:
    Portuguese
    Primarily Uses:
    RMMV
    I think some features of Galv's character animation are already built in Altimit's plugin, but i could be wrong...
     
  20. xilefian

    xilefian Veteran Veteran

    Messages:
    119
    Likes Received:
    176
    First Language:
    English
    Yes you're right, some of the features are implemented, but not all of them. Animations for standing, moving and dashing are in place at the moment, but I haven't added support for jumping, idling or "low-health" and I haven't added support for custom states.

    EDIT: I'm still strongly considering separating the extra frames module into its own Plugin that works without Altimit Movement. This will allow some dedicated development and its own bug/feature tracker (and documentation).

    It's a bit more work for me in the short term, but a lot less work in the long term. What are everyone's thoughts on this idea?

    I'd probably make it support the QSprite JSON format in addition, so people can use the QSprite editor with it. There's a lot of planning to do, I added it into Altimit Movement for the extra walk frames and 8 directions, however the feature creep is real and I need this system for my studio's own project too.
     
    Last edited: Jan 4, 2018

Share This Page