Skip to content
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

tic80 unable to run cart through this interpreter #4

Closed
atesin opened this issue Aug 28, 2024 · 10 comments
Closed

tic80 unable to run cart through this interpreter #4

atesin opened this issue Aug 28, 2024 · 10 comments

Comments

@atesin
Copy link

atesin commented Aug 28, 2024

i like this project, but it lacks detailed instructions on how to USE IT, in addition to installation instructions

i tried to use it how i think it should be but failed, steps to reproduce:

  • install zerobrane and set this interpreter, follow instructions in readme.md
  • set tic80.exe custom path in global config (F:\\Games\\tic80\\tic80.exe for me, should work same as user config) (MUST DOUBLE ESCAPE BACKSLASHES!)
  • create a cart in tic80 console with new lua and save zbs-test to generate <cart-folder>\zbs-test.tic file
  • create file <cart-folder>\zbs-test.lua in same directory, but lua instead
  • looks like system confuses tic and lua files, zerobrane output prints this:
Program starting as 'F:\Games\tic80\tic80.exe C:\Users\atesin\AppData\Roaming\com.nesbox.tic\TIC-80\zbs-test.lua --cmd="import code C:\Users\atesin\AppData\Roaming\com.nesbox.tic\TIC-80\zbs-test.lua"'.
Program 'tic80.exe' started in 'C:\Users\atesin\AppData\Roaming\com.nesbox.tic\TIC-80' (pid: 5432).

 TIC-80 tiny computer
 version 1.1.2837 (be42d6f)
 https://tic80.com (C) 2017-2023
error: cart `C:\Users\atesin\AppData\Roaming\com.nesbox.tic\TIC-80\zbs-test.lua` not loaded
Program completed in 0.21 seconds (pid: 5432).

if i am doing wrong, please post correct usage instructions and tell me

@oblerion
Copy link
Owner

I called a zb function inside my functions and it didn't work, so I kept it outside.
fixed now

note: on linux this works with confuse tic and lua

thanks for reporting this bug ^^

@atesin
Copy link
Author

atesin commented Aug 28, 2024

another VERY NICE and practical feature for this interpreter, would be to read and write lua code DIRECTLY INSIDE THE .TIC FILE... this actually will kill the need to work in a separate lua file and import code later (aside plain .lua files for includes)

for this you could read these tic80 documents (.tic file format) to know offsets:

https://github.com/nesbox/TIC-80/wiki/.tic-File-Format

@oblerion
Copy link
Owner

In CLI tic80 can load .lua and save .tic . Without start gui.

tic80 load test.lua --cli --cmd="save test.tic"

tic80 can create it but if early exist that not work.

@atesin
Copy link
Author

atesin commented Aug 28, 2024

so excuse me to being stubborn, but the name of the .lua file must be the same of the .tic file for this to work ?? ... please add it to readme.md, or whatever how to use it so everybody could know

what will happen in the case the project has multiple required files?, which one will be considered the main file and how the package will locate the related .tic file?

@oblerion
Copy link
Owner

oblerion commented Aug 29, 2024

Yes, you can use other name.

With multiple file, you need to shear .lua require with your game .tic.
It's more easy to keep all in one .lua .

@atesin
Copy link
Author

atesin commented Aug 29, 2024

according official tic80 documentation:

tic80 load test.lua is illegal in current build, but maybe similar expected result could be achieved with something like:

create> tic80 --cmd "new lua & import code mycart.lua & save mycart.tic & run"
update> tic80 --cmd "load mycart.tic & import code mycart.lua & save & run"

but... imagine our project has 3 lua files: stage2.lua, music.lua and readinput.lua (supposing one of them has the first require()) .. how can we specify from which file to import code and to which .tic file, if possible?

@oblerion
Copy link
Owner

ok, I'll edit it

Use love2d if you want to use require, tic80 support only one script.
nesbox/TIC-80#2639

@atesin
Copy link
Author

atesin commented Aug 30, 2024

actually not "supported", but still works, i hope for a long time... @joshgoebel put it me clear here = nesbox/TIC-80#2426 (comment)

after read josh reply i understand "not supported" as "it may works, but you won't get any help if got broken"... so let's use it now that still works, maybe never got "fixed"

i am learning some programming, i think tic80 is a good starting point, maybe later i will move to love2d, then to godot... who knows xD ... i found tic80 very familiar because i had an atari when was a kid, and have some similarities ... but certainly until @nesbox put his best effort, using an external project ide will be easier than tic80 internal editor

@oblerion
Copy link
Owner

oblerion commented Aug 31, 2024

I made 2d game engine with lua.
https://oblerion.itch.io/gba-engine

require() will work on it, userfull for modding game ^^.

@oblerion
Copy link
Owner

oblerion commented Aug 31, 2024

i am learning some programming, i think tic80 is a good starting point, maybe later i will move to love2d, then to godot... who knows xD ... i found tic80 very familiar because i had an atari when was a kid, and have some similarities ... but certainly until @nesbox put his best effort, using an external project ide will be easier than tic80 internal editor

I didn't live through that era (70-90), but it inspires me to create.
I make 3d game on godot and it is good but to complex for make 2d game.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants