New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build step #15

Merged
merged 7 commits into from Mar 31, 2018

Conversation

Projects
None yet
2 participants
@benwiley4000
Contributor

benwiley4000 commented Mar 30, 2018

Closes #14.

  • I created a fork of picotool called picotool-scumm-8 which contains the changes you made to the library. I registered it as a git submodule for this repo. I'd be happy to transfer ownership of picotool-scumm-8 to you!
  • I added a build.py script which requires python3 and automates all the steps you described here (except for actually copying the lib into your own cart).
  • Since there's no point to outputting the whole thing, I just output a .min.lua file containing just the library itself.
  • The build files are ignored in .gitignore. This seems inconsistent with the current practice so I un-ignored it.

Here's the scumm-8.min.lua file.

How's that look?

@benwiley4000 benwiley4000 referenced this pull request Mar 30, 2018

Closed

Build step #14

@Liquidream

This comment has been minimized.

Owner

Liquidream commented Mar 30, 2018

Wow! This is awesome... 😮
Thank you SO much for putting this all together. 😄

I never thought to fork picotool and have it as a submodule (TBH, I've never used them before - but this seems a perfect fit)
TBH, I'm kinda new to testing & accepting PR's, so please bear with me (plus I'm away from my comp 'till tomorrow), but I'll try to get this all in as soon as I can.
Your offer to transfer ownership of picotool-scumm-8 as well, is also VERY much appreciated. 👍
Thanks again!

@benwiley4000

This comment has been minimized.

Contributor

benwiley4000 commented Mar 30, 2018

Just transferred the fork!

Also I was thinking of adding generation for the game.p8 and template.p8 files (what's the difference?).

I've also never used submodules before but yeah, this seems like a good fit!

@benwiley4000

This comment has been minimized.

Contributor

benwiley4000 commented Mar 31, 2018

Hey, just updated the branch.

The build step now regenerates the template.p8 and game.p8 files. To make things less confusing, I moved those files (and the minified engine-only lua file) into a directory called dist/. I moved scumm-8.p8, and versions of template.p8 and game.p8 without the engine included (they have a token instead which gets replaced at build time), into a directory called src/.

The one thing that isn't automated is generating the template.p8.png file... it doesn't seem there is currently a way to do this.

@Liquidream

This comment has been minimized.

Owner

Liquidream commented Mar 31, 2018

Hey Ben,
Thanks for the extra updates.

Yeah, as you've probably realised now - the two files are quite different:
(I should probably highlight these differences in the ReadMe!)

  • game.p8: Is the full code for my biggest example game "Return of the SCUMM"
  • template.p8: Is a minimal/starter SCUMM-8 example, with single room and one or two objects.

I never thought of auto-including updated engine code to the dependant carts, this is so cool. Thanks!
(I just need to always remember to always copy any future updates to those example carts back to the \src folder - simple enough!)

A couple of things from trying these changes:

  1. Am I right in thinking that, thanks to your transfer - the submodule reference now needs to change in .gitmodules to my account? e.g. url = https://github.com/Liquidream/picotool-scumm8.git
    I would've updated the PR code myself, but I wasn't 100% sure I was right (or that I had permission!)

  2. I still get the following error when running build.py (even with the change above):

Traceback (most recent call last):
  File "build.py", line 32, in <module>
    from picotool_scumm8.pico8 import tool
ImportError: No module named picotool_scumm8.pico8

I dunno if it's coz I'm using Python 2 (v2.7.10 - the version that comes with my Mac)?

@benwiley4000

This comment has been minimized.

Contributor

benwiley4000 commented Mar 31, 2018

(I just need to always remember to always copy any future updates to those example carts back to the \src folder - simple enough!)

Well I think the idea would be to only ever directly edit the src directory (except when generating png files).

Am I right in thinking that, thanks to your transfer - the submodule reference now needs to change in .gitmodulesto my account?

I considered doing this and perhaps I should, but GitHub stores a history of repository addresses so that one automatically gets forwarded to the current location, so it should work anyway.

I still get the following error when running build.py. I dunno if it's coz I'm using Python 2 (v2.7.10 - the version that comes with my Mac?

I would first of all undo any changes to the .gitmodules file if you made them, and try using python 3. picotool depends on it. You might already have it installed on your system as python3 (so many applications depend on python 2 being called python that most OS's refer to them separately). If not, I would install it with brew or something.

@benwiley4000

This comment has been minimized.

Contributor

benwiley4000 commented Mar 31, 2018

The other thing is python might be swallowing up the git output so you could try running git submodule init and git submodule update from your terminal and check the error output.

@Liquidream

This comment has been minimized.

Owner

Liquidream commented Mar 31, 2018

Well I think the idea would be to only ever directly edit the src directory (except when generating png files).

Oh ok, so you mean to make a change in \src, build it, then test run the \dist copy in PICO-8?
(Coz you can't test the original in PICO-8, as it will barf on the "Token" used for placement)

I considered doing this ... it should work anyway

Ah, yes - that explains why it DID work - so that's fine then.

I would first of all undo any changes to the .gitmodules file if you made them, and try using python 3...

Yup, that did it - I didn't realise that I already had v3 installed.
Running it as instructed works perfectly! 👍 (my bad)

With regards to the template.p8.png, we don't really need it in the repo - I'm not sure why I put it in there in the first place (probably just to show ppl new to PICO-8 that it can be saved to a .png)? Either way, I'm happy for it to be removed - what dya think?

@benwiley4000

This comment has been minimized.

Contributor

benwiley4000 commented Mar 31, 2018

BTW I just pushed another commit to update the submodule URL to your version. You might have to run git submodule sync if you already initialized the git submodule.

@benwiley4000

This comment has been minimized.

Contributor

benwiley4000 commented Mar 31, 2018

Haha! awesome!

Yeah, I noticed png files are in the .gitignore, but you must have added it before. I would agree with just removing it.

@Liquidream

This comment has been minimized.

Owner

Liquidream commented Mar 31, 2018

Ok, here we go then... 😬
#HoldOntoYourButts

@Liquidream Liquidream merged commit 6c4edc3 into Liquidream:master Mar 31, 2018

@benwiley4000

This comment has been minimized.

Contributor

benwiley4000 commented Mar 31, 2018

Yay!

@Liquidream

This comment has been minimized.

Owner

Liquidream commented Mar 31, 2018

Thanks again for this - much appreciated.
I'm not looking forward to ever having to maintain/tweak the Python build script - so fingers-crossed it'll serve us well for the foreseeable! 😆

@benwiley4000

This comment has been minimized.

Contributor

benwiley4000 commented Mar 31, 2018

Hopefully it will be flexible enough. I extracted variables like the lib start pattern and the carts to interpolate to the top, so it should be easy to update if those need to change for whatever reason. 🙂

@benwiley4000

This comment has been minimized.

Contributor

benwiley4000 commented Mar 31, 2018

P.S. looks like with pico-8 v0.2 you'll be able to pull the template.p8 and game.p8 files out of the src/dist folders and just use #include: https://twitter.com/lexaloffle/status/974556612135337984?s=09

@benwiley4000 benwiley4000 deleted the benwiley4000:build-step branch Mar 31, 2018

@Liquidream

This comment has been minimized.

Owner

Liquidream commented Mar 31, 2018

Good point! 👍
I remember seeing Zep's tweet, but didn't immediately notice the benefit it could have.
That will do nicely (when it happens!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment