Closed atesin closed 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 ^^
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:
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.
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?
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 .
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?
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
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
I made 2d game engine with lua. https://oblerion.itch.io/gba-engine
require() will work on it, userfull for modding game ^^.
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.
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:
F:\\Games\\tic80\\tic80.exe
for me, should work same as user config) (MUST DOUBLE ESCAPE BACKSLASHES!)new lua
andsave zbs-test
to generate<cart-folder>\zbs-test.tic
file<cart-folder>\zbs-test.lua
in same directory, butlua
insteadlooks like system confuses
tic
andlua
files, zerobrane output prints this:if i am doing wrong, please post correct usage instructions and tell me