Log In  

I've been trying to use the new (although not that new now) #include command but I can't seem to get it working.

Code on pico-8 cart

#include testfile.lua

test()

Code on testfile.lua

function test()
    print("test",100,0,8)
end

When I run I get the error:

testfile.lua line 3
syntax error line 1 (tab 0)
endnd
syntax error near `test`
P#69921 2019-11-15 12:25 ( Edited 2019-11-15 12:26)

include is flawed, @Retrokin.

also you cannot use char #13 in your include file which is why I suspect it does not work.

If you just want to include one line, leave out the carriage return. If you want more than one line you can cram it all on one line, that will also work.

3rd alternative is to use the PICO-8 editor to write out the original code, then use PRINTH() to export the "p8" include file.

There is another way around this using NOTEPAD++ but it's a lot more complex.

It's also suggested you do not use the extension LUA and instead use P8 as the code is not 100% compatible with each other.

P#69924 2019-11-15 15:44

[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2024-03-29 09:03:54 | 0.011s | Q:12