oblerion / ZeroBrane-Studio-with-TIC-80

ZeroBrane Studio autocomplete and interpreter for TIC-80
GNU General Public License v3.0
1 stars 1 forks source link

tic80 unable to run cart through this interpreter #4

Closed atesin closed 3 weeks ago

atesin commented 3 weeks ago

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:

oblerion commented 3 weeks ago

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 commented 3 weeks ago

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 commented 3 weeks ago

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 commented 3 weeks ago

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 commented 3 weeks ago

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 commented 3 weeks ago

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 commented 3 weeks ago

ok, I'll edit it

Use love2d if you want to use require, tic80 support only one script. https://github.com/nesbox/TIC-80/issues/2639

atesin commented 3 weeks ago

actually not "supported", but still works, i hope for a long time... @joshgoebel put it me clear here = https://github.com/nesbox/TIC-80/issues/2426#issuecomment-1873031138

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 commented 2 weeks ago

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

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

oblerion commented 2 weeks ago

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.