Giter Club home page Giter Club logo

asesync23's Introduction

AseSync23

This tool automatically updates sprites in your GameMaker Studio 2.3+ project when the matching Aseprite file is changed on disk!

In some way it can be seen as successor to lazyload, except without Topher's tasteful UI or much other polish.

Update: There's a frontend for the tool now that you can use.

Requirements

  • GameMaker Studio 2.3 or higher (tested with 2.3.4)
  • Aseprite (this tool uses Aseprite CLI to get frame data)
  • Adequate backups/version control (in case something breaks)

Basic use

  • Create a sprite called spr_asebase.
    This will be used as the template for newly added sprites.
    If you don't want to use frame delays from Aseprite, set the animation type to "frame per game frame".
  • Arrange your Aseprite sprites into a directory.
    If there are subdirectories, these will become as resource tree folders.
  • Run the tool, give it your project path and aseprite directory path.
    (on Windows, just run the exe, on Mac/Linux install Neko VM runtime and run the tool from terminal via neko AseSync.n)
  • Edit some [ase]sprites!
    The tool will automatically update the frames in existing sprites and add new ones as necessary.

Advanced use

The tool can be ran from CLI with additional parameters, like so:

AseSync <YYP path> <sprites directory> [...additional parameters]

Supported parameters:

  • --folder <path>: Allows to specify the resource tree folder to dump new sprites in.
    Defaults to Sprites, but can be Sprites/subfolder, etc.
  • --base <name>: Specifies the sprite to use as a template.
    Defaults to spr_asebase, failing that will pick the first sprite in project.
  • --sync: Goes over all of the sprites in directory on startup.
    This is good if you've received a bunch of new sprites and would rather not open-save each of them.
  • --once: Goes over all of the sprites in directory and then quits.
    (without watching for changes)
  • --consent: Forces backup/source control consent without waiting for input.
    (so you can run this tool completely automated, but still, use source control)
  • --aseprite <path>: Overrides Aseprite path for a session.

Compiling

Initial setup:

haxelib git yyjson https://github.com/YAL-Haxe/yyjson
haxelib install haxe-files
haxelib install format

Neko build:

haxe -lib yyjson -lib haxe-files -lib format -cp . -neko bin/AseSync.n -main AseSync

C# build:

haxe -debug -lib yyjson -lib haxe-files -lib format -cp . -cs bin/cs -main AseSync
copy /Y bin\cs\bin\AseSync-Debug.exe bin\AseSync.exe

asesync23's People

Contributors

nkrapivin avatar yellowafterlife avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

asesync23's Issues

Object reference not set to an instance of an object.

Hello!

I keep getting the following error when trying to sync files via sahaun's GUI, as well as my feeble attempts at trying to compile from this source repository.
I'm not too sure what has happened, as the tool was working fine in older gamemaker projects until now, I've attempted clearing the folder in %appdata% and running the program to no avail.

Currently using:

  • GMS v2022.8.1.37
  • Aseprite (Steam) v1.2.40-x64

Please enter the path to your project YYP file
[you can shift-right-click the file in Explorer and pick 'Copy as path']
> "D:\Grant\Documents\GameMakerStudio2\GB-Jam10_2022\GB-Jam10_2022.yyp"
""D:\Grant\Documents\GameMakerStudio2\GB-Jam10_2022\GB-Jam10_2022.yyp"" does not exist!
Please enter the path to your project YYP file
> D:\Grant\Documents\GameMakerStudio2\GB-Jam10_2022\GB-Jam10_2022.yyp
Please enter the path to a folder with your Aseprite files
> D:\Grant\Documents\GameMakerStudio2\GB-Jam10_2022\__project\sprites
Please enter the path to Aseprite executable
> C:\Program Files (x86)\Steam\steamapps\common\Aseprite\Aseprite.exe
Please enter "y" to confirm that you understand the risks of modifying your project files and are using adequate backups or version control.
> y
Watching the sprites directory for changes...
You can close the window when you're done.
AseSync.hx:212: FILE_MODIFIED(D:\Grant\Documents\GameMakerStudio2\GB-Jam10_2022\__project\sprites\test\spr_tester.aseprite,hx.files.watcher.FileAttrs,hx.files.watcher.FileAttrs)
Syncing spr_tester (D:/Grant/Documents/GameMakerStudio2/GB-Jam10_2022/__project/sprites/test/spr_tester.aseprite)...
[spr_tester] ref frame time: 100, FPS: 10
An error occurred: System.NullReferenceException: Object reference not set to an instance of an object.
   at AseSyncSprite.sync(String asePath) in d:\Grant\Downloads\AseSync23-master(1)\AseSync23-master\AseSyncSprite.hx:line 178
   at AseSync.main_1() in d:\Grant\Downloads\AseSync23-master(1)\AseSync23-master\AseSync.hx:line 242
   at AseSync.main() in d:\Grant\Downloads\AseSync23-master(1)\AseSync23-master\AseSync.hx:line 254

Called from AseSyncSprite.sync (d:\Grant\Downloads\AseSync23-master(1)\AseSync23-master\AseSyncSprite.hx line 178)
Called from AseSync.main_1 (d:\Grant\Downloads\AseSync23-master(1)\AseSync23-master\AseSync.hx line 242)
Press Enter to exit!

Include the nested tags feature

We collaborated on making it work, i think it should be added (in case i loose the files ever lol)
also for the off-chance that the gui version get's updated

--consent parameter

A --consent parameter, which would set consent to true.
Useful for executing AseSync without having to provide input.

add a button to select which FPS we wants.

it would be extra convenient to select which one i wanted it to be played instead of doing it from CLI command... and i had no idea what command is that.

by default, it was set to frames per second instead of frame per game frame.

Unable to find the aseprite executable

I'm trying to use AseSync23 on MacOS. Installed NekoVM to be able to run AseSync23.n but I'm having trouble in telling it the location of an Aseprite binary.

I've tried /Users/youzer/Library/Application\ Support/Steam/steamapps/common/Aseprite/Aseprite.app/Contents/MacOS/aseprite but it throws that that it doesn't exist. I've run that binary independently and it does in fact exist and work. I've tried the .app file as well with the same result. Any idea what might be going wrong here?


PS Thank you for making this tool, I'm excited to get it working and improving my workflow! ๐Ÿ˜„

Errors when changing number of frames

Syncing an already-synced .ASE after adding a new frame corrupts the sprites in GM:
To reproduce:

  1. open GM
  2. open shark_chomp in GM
  3. sync shark_chomp.aseprite
  4. add at least one frame to shark_chomp.aseprite and save
  5. close and re-open the shark_chomp sprite in GM for the new frame to display correctly
  6. observe corruption artifacts and/or sprites being wildly offset or sometimes a white rectangle with a red x in it

If you run the game the new frame tends to be invisible.
If you close and re-open GM the new frame will become invisible in the editor.
If you delete the new frame in Aseprite and sync, Asesync will throw an error: Invalid field access : FrameId because the GM sprite has more frames than the aseprite.

Additionally I've seen a funny bug where GM seemingly creates a frame that is... 10 frames long?? pic related
Not sure how to reproduce but I suspect it is also related to frame number changes


IDE v2023.6.0.89 Runtime v2023.6.0.137

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.