Altimit Character Animations [0.01α]

Discussion in 'JS Plugin Releases (RMMV)' started by xilefian, Jan 6, 2018.

  1. xilefian

    xilefian Veteran Veteran

    Messages:
    120
    Likes Received:
    176
    First Language:
    English
    Altimit Character Animations 0.01 alpha

    This is an open-source project, feel free to clone the repository and make pull requests.

    About

    This Plugin adds the ability to greatly extend the animation system for character sprites.

    Altimit Character Animations offers flexibility that no-other character animation Plugin can through the use of Javascript as a scripting method for selecting your animation states.

    This allows custom states to be created and custom conditions to be written to massively expand how character animations can be done.

    The goal is for Altimit Character Animations to be the ultimate extra-frames Plugin.

    Download Latest Version
    Features
    • 8 direction support
    • Unlimited animation frames
    • Any sized, any layout sprite-sheets
    • Compatibility with Altimit Movement, including XML defined colliders
    • Javascript scripting interface
    Alpha Release

    The alpha release is the early days of the Plugin whilst the API is assessed and features added.

    The goal is to bring it up to par with other existing extra-frames Plugins and provide everything needed for developers to create a game using all the features available with the Plugin.

    Known Issues

    The latest issues are listed on the project page at the following URL: github.com/AltimitSystems/mv-plugins/issues

    Feel free to report issues in this thread or create a new issue on the project tracker (label as Altimit Character Animations).

    API

    $params includes the following properties:
    • direction - character facing direction
    • direction4 - direction limited to up, down, left, right
    • direction8 - for use with 8 direction movement, some Plugins will let you use normal "direction"
    • travelled - How many pixels has the character moved since the last frame
    • state - contains character's current state and how many frames they've been in the state
    • lastState - contains character's previous state (if there is one)
    • override - Boolean set to true if the state has been overridden with a custom state
    • tilesetId - sprite tileset ID
    • tileId - sprite tile ID
    • characterName - This should be the same as the XML file name
    • characterIndex - Sprite index on multi-sprite character sheets
    • character - Game_Character, comes with all properties that Game_Character has. Very powerful!
    • isDebugThrough - Boolean set to true when debug walk-through-walls is active
    • isDashButtonPressed - Different to $params.state.dashing
    • isOnDamageFloor - Character on floor damage tile (applies only to Player by default)
    The in-built states are:
    • state.bush - Character is in a bush
    • state.dashing - Character is dashing (running)
    • state.jumping - Character is jumping
    • state.ladder - Character is on ladder
    • state.moving - Character is moving
    • state.idle - Character is doing nothing
    Custom states should not use these names. So if you want a state for when your character is handsome, don't call it "dashing", call it "handsome" and then you can reference it with $params.state.handsome

    The animation return structure has the following options:
    • animation - ID of the XML animation to play-back
    • oneShot - Boolean, if set to true then the animation will play once and stop on the last frame (default false)
    • scaleX - Scales sprite in X axis (default 1)
    • scaleY - Scales sprite in Y axis(default 1)
    • speed - Play-back speed multiplier (default 1)
    Both the XML animation-list and animation tags support scaling properties "sx" and "sy":
    Code:
    <!-- All sprite frames will be 2x bigger -->
    <animation-list sheet="my_sheet" sx="2" sy="2">
    
        <!-- When this animation is playing, sprite will be 50% sized -->
        <!-- Combined with the animation-list scale, this results in a 1x (normal!) sized sprite -->
        <animation id="my_animation" sx="0.5" sy="0.5">
    
            <!-- Frames go here -->
    
        </animation>
    
    </animation-list>
    These scaling properties can be used to mirror sprites; simply scale with a negative value. This is useful if you want to re-use sprite frames for both the left and right directions.

    Usage

    To add a character animation extension to a sprite sheet simply create an XML file in the img/characters folder with the same file name as the character sheet you wish to extend.

    For example, to extend Actor1.png we'd create Actor1.xml next to it.

    There are two required structures in the XML file:
    • animation-list
    • script
    The animation list must contain a property defining which image to use as a source of the extra frames.

    So to extend Actor1.png with Actor1_extra.png our XML file should look similar to this:
    HTML:
    <!-- Notice Actor1_extra, this says "Use Actor1_extra.png for these frames" -->
    <animation-list sheet="Actor1_extra">
    </animation-list>
    
    <!-- The script is where we write our animation state logic -->
    <script>
    </script>
    Let's say we want to add an "idle" animation for when the first Actor1 character is waiting around for more than 10 seconds (600 frames).

    We first need to write out where in the Actor1_extra these "idle" animation frames are.
    HTML:
    <animation-list sheet="Actor1_extra">
    
        <!-- Our idle animation for when the character is facing "down" -->
        <!-- The "rate" is the frames-per-second of the animation -->
        <animation id="idle_south" rate="10">
    
            <!-- The animation frames -->
            <!-- These are texture co-ordinates on the sprite sheet -->
            <!-- In this example, one frame is 64x64 pixels and there are 5 frames, left-to-right -->
            <frame x="0" y="0" width="64" height="64" />
            <frame x="64" y="0" width="64" height="64" />
            <frame x="128" y="0" width="64" height="64" />
            <frame x="196" y="0" width="64" height="64" />
            <frame x="256" y="0" width="64" height="64" />
    
        </animation>
    
    </animation-list>
    
    <script>
    </script>
    Now that we've written out where the animation frames for our down-facing idle animation is we need to write script logic for selecting the frames.

    HTML:
    <animation-list sheet="Actor1_extra">
    
        <animation id="idle_south" rate="10">
    
            <frame x="0" y="0" width="64" height="64" />
            <frame x="64" y="0" width="64" height="64" />
            <frame x="128" y="0" width="64" height="64" />
            <frame x="196" y="0" width="64" height="64" />
            <frame x="256" y="0" width="64" height="64" />
    
        </animation>
    
    </animation-list>
    
    <!-- Scripting is in Javascript -->
    <script>
        // The $params variable holds information about the current state
        // The script must return a structure defining the animation
      
        // If we are facing south and have been idle for over 10 seconds (600 frames)
        if ( $params.direction == 2 && $params.state.idle > 600 ) {
            // Play the idle_south animation, defined in XML
            // oneShot will play the animation once and stay on the final frame
            return { animation: "idle_south", oneShot: true };
        }
    </script>
    For an idea of how advanced this can be, animations for "enter idle" can be defined and the $params.state.idle frames can be used to detect the start of idling, then after N frames it can play an "idle loop" animation.

    Character states can be override with custom states also. If I wanted to set a "fishing" state to $gamePlayer I can call $gamePlayer.extraStateSet( ["fishing"] ). If I want to stop overriding states (such as fishing has been completed) I can use $gamePlayer.extraStateReset().
     
    #1
  2. AndromedaFr

    AndromedaFr Warper Member

    Messages:
    3
    Likes Received:
    0
    First Language:
    Dutch
    Primarily Uses:
    RMMV
    Hello, thank you for this script!

    Could you list the $params.direction number corresponding to directions north, east and west?
    South = 2
    North = ?
    Etc.

    Thank you.
    (I'm not experienced with coding so I may have overlooked something or asked for common knowledge, if so, apologies.)
     
    #2
  3. xilefian

    xilefian Veteran Veteran

    Messages:
    120
    Likes Received:
    176
    First Language:
    English
    Look at the NumPad on your keyboard.
    North = 8
    East = 6
    South = 2
    West = 4
     
    #3
    AndromedaFr likes this.
  4. Sissel Cabanela

    Sissel Cabanela Veteran Veteran

    Messages:
    80
    Likes Received:
    14
    First Language:
    English
    Interesting. Do you think this script could be applied to Tomoaky's Jump Action plugin? To my knowledge, that's the main issue I see with that plugin as your character just performs actions without visual effect.
     
    #4
  5. xilefian

    xilefian Veteran Veteran

    Messages:
    120
    Likes Received:
    176
    First Language:
    English
    The infinite possibility with the use of Javascript in this character animations Plugin makes this a "yes", but you'll have to write Javascript to detect the jumping state.
     
    #5
  6. heidenreich69

    heidenreich69 Warper Member

    Messages:
    4
    Likes Received:
    0
    First Language:
    english
    Primarily Uses:
    RMMV
    free for commercial use?
     
    #6
  7. Aiaz-Marx

    Aiaz-Marx Warper Member

    Messages:
    1
    Likes Received:
    0
    First Language:
    Russian,Spanish
    Primarily Uses:
    RMMV
    Are u still working on it? With all these Javascript and XML files it looks kind of difficult, at least for me :kaocry:
     
    Last edited: Jun 6, 2018
    #7
  8. GoldenIron

    GoldenIron Warper Member

    Messages:
    1
    Likes Received:
    1
    Location:
    Germany
    First Language:
    German
    Primarily Uses:
    RMMV
    Could you make a demo project, displaying the capabilities?
     
    #8
    NM Play likes this.
  9. Sissel Cabanela

    Sissel Cabanela Veteran Veteran

    Messages:
    80
    Likes Received:
    14
    First Language:
    English
    The default XML used as an example is incorrect. It returns an error: "The markup in the document following the root element must be well-formed." at the first <script>

    I'm not sure how this plugin in supposed to be put into effect with a faulty XML system
     
    #9
  10. NM Play

    NM Play ~ 0..0 ~ Veteran

    Messages:
    46
    Likes Received:
    24
    Location:
    Spain
    First Language:
    Spanish
    the idea of a simple demo with examples will be really helpfull
     
    #10
  11. Esh

    Esh ☣☣☣_CrAzY-CoDeR_☣☣☣ Member

    Messages:
    9
    Likes Received:
    4
    Location:
    Russia
    First Language:
    Russian
    Primarily Uses:
    RMMV
    This plugin works fine. It is not clear why no one has provide out an example code... I'm fixing this.[​IMG]

    File "Actor1.xml"
    DEMO

    The contents of the file "Actor1.xml"
    Code:
    <animation-list sheet="Actor1_extra">
        <animation id="run_east" rate="16">
            <frame x="0" y="0" width="128" height="128" />
            <frame x="128" y="0" width="128" height="128" />
            <frame x="256" y="0" width="128" height="128" />
            <frame x="384" y="0" width="128" height="128" />
            <frame x="512" y="0" width="128" height="128" />
            <frame x="640" y="0" width="128" height="128" />
            <frame x="768" y="0" width="128" height="128" />
            <frame x="896" y="0" width="128" height="128" />
            <frame x="1024" y="0" width="128" height="128" />
            <frame x="1152" y="0" width="128" height="128" />
            <frame x="1280" y="0" width="128" height="128" />
            <frame x="1408" y="0" width="128" height="128" />
            <frame x="1536" y="0" width="128" height="128" />
            <frame x="1664" y="0" width="128" height="128" />
            <frame x="1792" y="0" width="128" height="128" />
            <frame x="1920" y="0" width="128" height="128" />
        </animation>
        <animation id="run_north" rate="16">
            <frame x="0" y="128" width="128" height="128" />
            <frame x="128" y="128" width="128" height="128" />
            <frame x="256" y="128" width="128" height="128" />
            <frame x="384" y="128" width="128" height="128" />
            <frame x="512" y="128" width="128" height="128" />
            <frame x="640" y="128" width="128" height="128" />
            <frame x="768" y="128" width="128" height="128" />
            <frame x="896" y="128" width="128" height="128" />
            <frame x="1024" y="128" width="128" height="128" />
            <frame x="1152" y="128" width="128" height="128" />
            <frame x="1280" y="128" width="128" height="128" />
            <frame x="1408" y="128" width="128" height="128" />
            <frame x="1536" y="128" width="128" height="128" />
            <frame x="1664" y="128" width="128" height="128" />
            <frame x="1792" y="128" width="128" height="128" />
            <frame x="1920" y="128" width="128" height="128" />
        </animation>
        <animation id="run_northeast" rate="16">
            <frame x="0" y="256" width="128" height="128" />
            <frame x="128" y="256" width="128" height="128" />
            <frame x="256" y="256" width="128" height="128" />
            <frame x="384" y="256" width="128" height="128" />
            <frame x="512" y="256" width="128" height="128" />
            <frame x="640" y="256" width="128" height="128" />
            <frame x="768" y="256" width="128" height="128" />
            <frame x="896" y="256" width="128" height="128" />
            <frame x="1024" y="256" width="128" height="128" />
            <frame x="1152" y="256" width="128" height="128" />
            <frame x="1280" y="256" width="128" height="128" />
            <frame x="1408" y="256" width="128" height="128" />
            <frame x="1536" y="256" width="128" height="128" />
            <frame x="1664" y="256" width="128" height="128" />
            <frame x="1792" y="256" width="128" height="128" />
            <frame x="1920" y="256" width="128" height="128" />
        </animation>
        <animation id="run_northwest" rate="16">
            <frame x="0" y="384" width="128" height="128" />
            <frame x="128" y="384" width="128" height="128" />
            <frame x="256" y="384" width="128" height="128" />
            <frame x="384" y="384" width="128" height="128" />
            <frame x="512" y="384" width="128" height="128" />
            <frame x="640" y="384" width="128" height="128" />
            <frame x="768" y="384" width="128" height="128" />
            <frame x="896" y="384" width="128" height="128" />
            <frame x="1024" y="384" width="128" height="128" />
            <frame x="1152" y="384" width="128" height="128" />
            <frame x="1280" y="384" width="128" height="128" />
            <frame x="1408" y="384" width="128" height="128" />
            <frame x="1536" y="384" width="128" height="128" />
            <frame x="1664" y="384" width="128" height="128" />
            <frame x="1792" y="384" width="128" height="128" />
            <frame x="1920" y="384" width="128" height="128" />
        </animation>
        <animation id="run_south" rate="16">
            <frame x="0" y="512" width="128" height="128" />
            <frame x="128" y="512" width="128" height="128" />
            <frame x="256" y="512" width="128" height="128" />
            <frame x="384" y="512" width="128" height="128" />
            <frame x="512" y="512" width="128" height="128" />
            <frame x="640" y="512" width="128" height="128" />
            <frame x="768" y="512" width="128" height="128" />
            <frame x="896" y="512" width="128" height="128" />
            <frame x="1024" y="512" width="128" height="128" />
            <frame x="1152" y="512" width="128" height="128" />
            <frame x="1280" y="512" width="128" height="128" />
            <frame x="1408" y="512" width="128" height="128" />
            <frame x="1536" y="512" width="128" height="128" />
            <frame x="1664" y="512" width="128" height="128" />
            <frame x="1792" y="512" width="128" height="128" />
            <frame x="1920" y="512" width="128" height="128" />
        </animation>
        <animation id="run_southeast" rate="16">
            <frame x="0" y="640" width="128" height="128" />
            <frame x="128" y="640" width="128" height="128" />
            <frame x="256" y="640" width="128" height="128" />
            <frame x="384" y="640" width="128" height="128" />
            <frame x="512" y="640" width="128" height="128" />
            <frame x="640" y="640" width="128" height="128" />
            <frame x="768" y="640" width="128" height="128" />
            <frame x="896" y="640" width="128" height="128" />
            <frame x="1024" y="640" width="128" height="128" />
            <frame x="1152" y="640" width="128" height="128" />
            <frame x="1280" y="640" width="128" height="128" />
            <frame x="1408" y="640" width="128" height="128" />
            <frame x="1536" y="640" width="128" height="128" />
            <frame x="1664" y="640" width="128" height="128" />
            <frame x="1792" y="640" width="128" height="128" />
            <frame x="1920" y="640" width="128" height="128" />
        </animation>
        <animation id="run_southwest" rate="16">
            <frame x="0" y="768" width="128" height="128" />
            <frame x="128" y="768" width="128" height="128" />
            <frame x="256" y="768" width="128" height="128" />
            <frame x="384" y="768" width="128" height="128" />
            <frame x="512" y="768" width="128" height="128" />
            <frame x="640" y="768" width="128" height="128" />
            <frame x="768" y="768" width="128" height="128" />
            <frame x="896" y="768" width="128" height="128" />
            <frame x="1024" y="768" width="128" height="128" />
            <frame x="1152" y="768" width="128" height="128" />
            <frame x="1280" y="768" width="128" height="128" />
            <frame x="1408" y="768" width="128" height="128" />
            <frame x="1536" y="768" width="128" height="128" />
            <frame x="1664" y="768" width="128" height="128" />
            <frame x="1792" y="768" width="128" height="128" />
            <frame x="1920" y="768" width="128" height="128" />
        </animation>
        <animation id="run_west" rate="16">
            <frame x="0" y="896" width="128" height="128" />
            <frame x="128" y="896" width="128" height="128" />
            <frame x="256" y="896" width="128" height="128" />
            <frame x="384" y="896" width="128" height="128" />
            <frame x="512" y="896" width="128" height="128" />
            <frame x="640" y="896" width="128" height="128" />
            <frame x="768" y="896" width="128" height="128" />
            <frame x="896" y="896" width="128" height="128" />
            <frame x="1024" y="896" width="128" height="128" />
            <frame x="1152" y="896" width="128" height="128" />
            <frame x="1280" y="896" width="128" height="128" />
            <frame x="1408" y="896" width="128" height="128" />
            <frame x="1536" y="896" width="128" height="128" />
            <frame x="1664" y="896" width="128" height="128" />
            <frame x="1792" y="896" width="128" height="128" />
            <frame x="1920" y="896" width="128" height="128" />
        </animation>
        <animation id="idle_east" rate="16">
            <frame x="0" y="1024" width="128" height="128" />
            <frame x="128" y="1024" width="128" height="128" />
            <frame x="256" y="1024" width="128" height="128" />
            <frame x="384" y="1024" width="128" height="128" />
            <frame x="512" y="1024" width="128" height="128" />
            <frame x="640" y="1024" width="128" height="128" />
            <frame x="768" y="1024" width="128" height="128" />
            <frame x="896" y="1024" width="128" height="128" />
            <frame x="1024" y="1024" width="128" height="128" />
            <frame x="1152" y="1024" width="128" height="128" />
            <frame x="1280" y="1024" width="128" height="128" />
            <frame x="1408" y="1024" width="128" height="128" />
            <frame x="1536" y="1024" width="128" height="128" />
            <frame x="1664" y="1024" width="128" height="128" />
            <frame x="1792" y="1024" width="128" height="128" />
            <frame x="1920" y="1024" width="128" height="128" />
        </animation>
        <animation id="idle_north" rate="16">
            <frame x="0" y="1152" width="128" height="128" />
            <frame x="128" y="1152" width="128" height="128" />
            <frame x="256" y="1152" width="128" height="128" />
            <frame x="384" y="1152" width="128" height="128" />
            <frame x="512" y="1152" width="128" height="128" />
            <frame x="640" y="1152" width="128" height="128" />
            <frame x="768" y="1152" width="128" height="128" />
            <frame x="896" y="1152" width="128" height="128" />
            <frame x="1024" y="1152" width="128" height="128" />
            <frame x="1152" y="1152" width="128" height="128" />
            <frame x="1280" y="1152" width="128" height="128" />
            <frame x="1408" y="1152" width="128" height="128" />
            <frame x="1536" y="1152" width="128" height="128" />
            <frame x="1664" y="1152" width="128" height="128" />
            <frame x="1792" y="1152" width="128" height="128" />
            <frame x="1920" y="1152" width="128" height="128" />
        </animation>
        <animation id="idle_northeast" rate="16">
            <frame x="0" y="1280" width="128" height="128" />
            <frame x="128" y="1280" width="128" height="128" />
            <frame x="256" y="1280" width="128" height="128" />
            <frame x="384" y="1280" width="128" height="128" />
            <frame x="512" y="1280" width="128" height="128" />
            <frame x="640" y="1280" width="128" height="128" />
            <frame x="768" y="1280" width="128" height="128" />
            <frame x="896" y="1280" width="128" height="128" />
            <frame x="1024" y="1280" width="128" height="128" />
            <frame x="1152" y="1280" width="128" height="128" />
            <frame x="1280" y="1280" width="128" height="128" />
            <frame x="1408" y="1280" width="128" height="128" />
            <frame x="1536" y="1280" width="128" height="128" />
            <frame x="1664" y="1280" width="128" height="128" />
            <frame x="1792" y="1280" width="128" height="128" />
            <frame x="1920" y="1280" width="128" height="128" />
        </animation>
        <animation id="idle_northwest" rate="16">
            <frame x="0" y="1408" width="128" height="128" />
            <frame x="128" y="1408" width="128" height="128" />
            <frame x="256" y="1408" width="128" height="128" />
            <frame x="384" y="1408" width="128" height="128" />
            <frame x="512" y="1408" width="128" height="128" />
            <frame x="640" y="1408" width="128" height="128" />
            <frame x="768" y="1408" width="128" height="128" />
            <frame x="896" y="1408" width="128" height="128" />
            <frame x="1024" y="1408" width="128" height="128" />
            <frame x="1152" y="1408" width="128" height="128" />
            <frame x="1280" y="1408" width="128" height="128" />
            <frame x="1408" y="1408" width="128" height="128" />
            <frame x="1536" y="1408" width="128" height="128" />
            <frame x="1664" y="1408" width="128" height="128" />
            <frame x="1792" y="1408" width="128" height="128" />
            <frame x="1920" y="1408" width="128" height="128" />
        </animation>
        <animation id="idle_south" rate="16">
            <frame x="0" y="1536" width="128" height="128" />
            <frame x="128" y="1536" width="128" height="128" />
            <frame x="256" y="1536" width="128" height="128" />
            <frame x="384" y="1536" width="128" height="128" />
            <frame x="512" y="1536" width="128" height="128" />
            <frame x="640" y="1536" width="128" height="128" />
            <frame x="768" y="1536" width="128" height="128" />
            <frame x="896" y="1536" width="128" height="128" />
            <frame x="1024" y="1536" width="128" height="128" />
            <frame x="1152" y="1536" width="128" height="128" />
            <frame x="1280" y="1536" width="128" height="128" />
            <frame x="1408" y="1536" width="128" height="128" />
            <frame x="1536" y="1536" width="128" height="128" />
            <frame x="1664" y="1536" width="128" height="128" />
            <frame x="1792" y="1536" width="128" height="128" />
            <frame x="1920" y="1536" width="128" height="128" />
        </animation>
        <animation id="idle_southeast" rate="16">
            <frame x="0" y="1664" width="128" height="128" />
            <frame x="128" y="1664" width="128" height="128" />
            <frame x="256" y="1664" width="128" height="128" />
            <frame x="384" y="1664" width="128" height="128" />
            <frame x="512" y="1664" width="128" height="128" />
            <frame x="640" y="1664" width="128" height="128" />
            <frame x="768" y="1664" width="128" height="128" />
            <frame x="896" y="1664" width="128" height="128" />
            <frame x="1024" y="1664" width="128" height="128" />
            <frame x="1152" y="1664" width="128" height="128" />
            <frame x="1280" y="1664" width="128" height="128" />
            <frame x="1408" y="1664" width="128" height="128" />
            <frame x="1536" y="1664" width="128" height="128" />
            <frame x="1664" y="1664" width="128" height="128" />
            <frame x="1792" y="1664" width="128" height="128" />
            <frame x="1920" y="1664" width="128" height="128" />
        </animation>
        <animation id="idle_southwest" rate="16">
            <frame x="0" y="1792" width="128" height="128" />
            <frame x="128" y="1792" width="128" height="128" />
            <frame x="256" y="1792" width="128" height="128" />
            <frame x="384" y="1792" width="128" height="128" />
            <frame x="512" y="1792" width="128" height="128" />
            <frame x="640" y="1792" width="128" height="128" />
            <frame x="768" y="1792" width="128" height="128" />
            <frame x="896" y="1792" width="128" height="128" />
            <frame x="1024" y="1792" width="128" height="128" />
            <frame x="1152" y="1792" width="128" height="128" />
            <frame x="1280" y="1792" width="128" height="128" />
            <frame x="1408" y="1792" width="128" height="128" />
            <frame x="1536" y="1792" width="128" height="128" />
            <frame x="1664" y="1792" width="128" height="128" />
            <frame x="1792" y="1792" width="128" height="128" />
            <frame x="1920" y="1792" width="128" height="128" />
        </animation>
        <animation id="idle_west" rate="16">
            <frame x="0" y="1920" width="128" height="128" />
            <frame x="128" y="1920" width="128" height="128" />
            <frame x="256" y="1920" width="128" height="128" />
            <frame x="384" y="1920" width="128" height="128" />
            <frame x="512" y="1920" width="128" height="128" />
            <frame x="640" y="1920" width="128" height="128" />
            <frame x="768" y="1920" width="128" height="128" />
            <frame x="896" y="1920" width="128" height="128" />
            <frame x="1024" y="1920" width="128" height="128" />
            <frame x="1152" y="1920" width="128" height="128" />
            <frame x="1280" y="1920" width="128" height="128" />
            <frame x="1408" y="1920" width="128" height="128" />
            <frame x="1536" y="1920" width="128" height="128" />
            <frame x="1664" y="1920" width="128" height="128" />
            <frame x="1792" y="1920" width="128" height="128" />
            <frame x="1920" y="1920" width="128" height="128" />
        </animation>
    </animation-list>
    <script>
    if ($params.state.idle > 1) {
    switch ( $params.direction8 ) {
            case 6:  return { animation: "idle_east" };             break;
            case 8:  return { animation: "idle_north" };          break;
            case 9:  return { animation: "idle_northeast" };    break;
            case 7:  return { animation: "idle_northwest" };    break;
            case 2:  return { animation: "idle_south" };           break;
            case 3:  return { animation: "idle_southeast" };    break;
            case 1:  return { animation: "idle_southwest" };    break;
            case 4:  return { animation: "idle_west" };             break;
            default: return { animation: "idle_south" };
    }
    } else {
    switch ( $params.direction8 ) {
            case 6:  return { animation: "run_east" };           break;
            case 8:  return { animation: "run_north" };         break;
            case 9:  return { animation: "run_northeast" };  break;
            case 7:  return { animation: "run_northwest" };  break;
            case 2:  return { animation: "run_south" };         break;
            case 3:  return { animation: "run_southeast" };  break;
            case 1:  return { animation: "run_southwest" };  break;
            case 4:  return { animation: "run_west" };           break;
            case 6:  return { animation: "idle_east" };           break;
            case 8:  return { animation: "idle_north" };         break;
            default: return { animation: "idle_south" };
    }
    }
    </script>
    Actor1_extra.png
     
    Last edited: Aug 27, 2018
    #11
    NM Play likes this.
  12. slimmmeiske2

    slimmmeiske2 Little Red Riding Hood Moderator

    Messages:
    5,635
    Likes Received:
    4,146
    Location:
    Belgium
    First Language:
    Dutch
    Primarily Uses:
    RMXP
    @Esh Please refrain from using red or blue in your text, as these are colours used by moderators as warnings/actions.
     
    #12
  13. Sissel Cabanela

    Sissel Cabanela Veteran Veteran

    Messages:
    80
    Likes Received:
    14
    First Language:
    English
    @Esh
    That's...sort of a lot. I appreciate that you have it working, but if you're posting examples, could I trouble you to post a...smaller template instead of all that? I'm not entirely sure what all I'm looking at to decipher what I did wrong on my end, sorry.
     
    #13
  14. Esh

    Esh ☣☣☣_CrAzY-CoDeR_☣☣☣ Member

    Messages:
    9
    Likes Received:
    4
    Location:
    Russia
    First Language:
    Russian
    Primarily Uses:
    RMMV
    I'm pologize. Corrected.
     
    #14
    slimmmeiske2 likes this.
  15. Esh

    Esh ☣☣☣_CrAzY-CoDeR_☣☣☣ Member

    Messages:
    9
    Likes Received:
    4
    Location:
    Russia
    First Language:
    Russian
    Primarily Uses:
    RMMV
    Post has been updated. Added demo project and added xml file.[​IMG]
     
    #15
    Piirakka and NM Play like this.
  16. Kenode

    Kenode Veteran Veteran

    Messages:
    66
    Likes Received:
    24
    First Language:
    Spanish
    Primarily Uses:
    RMMV
    Great work on the plugin so far. Is it still under development? It's probably the best one yet but...

    1) I've found a bug: When under a bush tile, I get a really weird issue: the sprite looks duplicated (It also happens in Esh's demo)

    2) I also have a few requests for the API:
    • A way to get information from event comments (I've seen a few plugins doing this, GALV footsteps and MBS Sound Emittance for example)
    • A way to get event data (such as $gameMap.event(this._eventId))
    • A way to write into the game variables and switches (such as $gameVariables.setValue)
    • A way to execute common events in specific frames
    I have a common event I use for player footsteps, and another I use for all event footsteps. I was executing them through plugins (messing around with GALV's footstep plugin, basically) after a lot of trial and error, using variables to relay information. The reason I want to use common events for them is because this way I can do more than just sounds, but unfortunately I can't use GALV's footstep plugin with this, it requires its own character frames plugin.
     
    #16

Share This Page