Coder Social home page Coder Social logo

Comments (6)

chronoDave avatar chronoDave commented on May 21, 2024 1

@lenaschimmel @Kyratech New version (3.3.0) has been published with asset support.

You can now declare files as assets by adding assets: [] to your configuration, similar to files: []. Assets will only have their asset data copied over (all code information is stripped) and files will only have their code information copied.

For example, a file like this:

--script: lua

test = 'tic-bundle'

-- test
-- <TILES>
-- 000:0100000010100000010000000000000000000000000000000000000000000000
-- </TILES>

-- <SPRITES>
-- 000:8000000080000000800000008000000080000000800000000000000000000000
-- </SPRITES>

-- <PALETTE>
-- 000:301c00000000000000000000000000000000000000000000009900000000000000000000000000000000000000000000
-- </PALETTE>

Would only have

--script: lua

test = 'tic-bundle'

-- test

copied over if it was declared a file and only

-- <TILES>
-- 000:0100000010100000010000000000000000000000000000000000000000000000
-- </TILES>

-- <SPRITES>
-- 000:8000000080000000800000008000000080000000800000000000000000000000
-- </SPRITES>

-- <PALETTE>
-- 000:301c00000000000000000000000000000000000000000000009900000000000000000000000000000000000000000000
-- </PALETTE>

if it is declared as an asset. I hope that helps!

from tic-bundle.

lenaschimmel avatar lenaschimmel commented on May 21, 2024 1

Thanks for the quick reaction, @chronoDave!

And thank you @Kyratech for describing a possible workflow. That seems doable, but is not nearly as easy and elegant as I had hoped.

Oh, you just published a version while I was still writing :D I will probably give your solution a shot in a day or two. If it's not what I need, I will probably try to make a quick fork and PR at some time, but currently can't tell when that is going to happen…

from tic-bundle.

Kyratech avatar Kyratech commented on May 21, 2024 1

Hi @chronoDave
Thanks for the quick update! The change is really useful already - hopefully Lena finds it works for her too.

from tic-bundle.

chronoDave avatar chronoDave commented on May 21, 2024

Thank you for the very detailed issue description!

I downloaded your repo and tried to understand the issue you're describing. If I'm correct, you're taking these steps:

  1. Create source files in src
  2. Bundle these files into your output file, dyke.lua
  3. Editing the output file
  4. Losing your changes when you edit your source files

If so, then yes, tic-bundle assumes your output file is always generated, never edited. I noticed your sprites are defined in src/main.lua so you'd load that into TIC-80 and change the sprites there if you want to see them in your bundled file.

I hope this answers your question, if not, please let me know.

from tic-bundle.

Kyratech avatar Kyratech commented on May 21, 2024

I use tic-bundle for my project and this is my workflow for working with this behaviour:

  1. In my source files, I created a new file metadata.lua.
  2. I added metadata.lua to the end of the files list in .ticbundle.json.
  3. When I edit any assets in my project, I save it as a separate file from build.lua, called meta.lua.
  4. I copy the asset comments from meta.lua into metadata.lua.
  5. tic-bundle notices one of the source files has updated, so a rebuild is triggered and the new metadata is incorporated into the new version of build.lua.
  6. I re-load build.lua in TIC-80.

Now that I've established this workflow, I find that it's pretty usable.

I would be in favour of an optional feature that prevents overwriting the metadata though, because it would skip all the manual copying and pasting.

from tic-bundle.

chronoDave avatar chronoDave commented on May 21, 2024

I use tic-bundle for my project and this is my workflow for working with this behaviour:

1. In my source files, I created a new file `metadata.lua`.

2. I added `metadata.lua` to the end of the files list in `.ticbundle.json`.

3. When I edit any assets in my project, I save it as a separate file from `build.lua`, called `meta.lua`.

4. I copy the asset comments from `meta.lua` into `metadata.lua`.

5. tic-bundle notices one of the source files has updated, so a rebuild is triggered and the new metadata is incorporated into the new version of `build.lua`.

6. I re-load `build.lua` in TIC-80.

Now that I've established this workflow, I find that it's pretty usable.

I would be in favour of an optional feature that prevents overwriting the metadata though, because it would skip all the manual copying and pasting.

I've been playing around in TIC-80 and see the problem you're facing. It's possible to create a blank cart and create graphics, but a loadable file must contain a valid script tag (which gets copied over as well of course). I'll add support and documentation for asset cart (such as graphics and sound) support.

from tic-bundle.

Related Issues (5)

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.