Log In  

Hi, I'm trying to write a game in a very clean way instead of cramming multiple copies of the same code on multiple carts, most of this is solved with #include but for what I've tried, you can't do include from subfolders, what I mean is that for example, if I have a cart on a subfolder called "font" but wanna include functions from a cart located on the parent folder, something like
#include ../cart_with_functions.p8

won't work, is this even possible to do with include or am I just out of luck?

P#89642 2021-03-27 00:22

Have you actually saved the current cart yet?

I think PICO-8 doesn't know what folder the cart includes "from" until you save it.

This is because the current directory in the command prompt isn't always the same as the cart's directory.

P#89648 2021-03-27 01:06

Yeah I have, I even have 2 more carts #include'd on the cart and they work fine

P#89649 2021-03-27 01:08

What platform are you running PICO-8 on?

On Windows, #include ../file.lua or #include ../file.p8 works for me.

Are you trying to do nested #includes maybe?

P#89651 2021-03-27 01:41 ( Edited 2021-03-27 01:44)

[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2024-03-29 07:10:55 | 0.007s | Q:11