Log In  

Hi,

My game (which uses includes) runs perfectly from within the Pico 8 environment. It also runs perfectly when I export it without using includes (that is, when I pre-merge all the files together and then export).

But when I export it with includes (either to a standalone .bin or to an html page) I get the following error when I try to run the exported version:

could not #include file:
init_functions.p8

stopped. press button to exit

init_functions.p8 is one of the files I'm including from the main file.

Here is the code from the main program:

pico-8 cartridge // http://www.pico-8.com
version 18
__lua__

#include init_functions.p8
#include main_controllers.p8
#include start_functions.p8

#include game_functions.p8
#include ugene_functions.p8
#include actor_functions.p8
#include ui_functions.p8
#include common_functions.p8
#include gameover_functions.p8

__gfx__
(and all the graphics data is here)

and here is the first few lines from the first include, which I'm showing here in case it has something to do with the header portion?

pico-8 cartridge // http://www.pico-8.com
version 18
__lua__

function _init()

    mode="start"
    sash=0
    offscreen=128

(etc)

Am I doing something wrong? Again I want to emphasize that everything works perfectly when running this from within Pico 8, just not when I export it.

I've searched for an answer to why this might be happening, to no avail.

Thanks for any light anyone could shine on this!

lazzoak

P#68157 2019-09-26 18:48 ( Edited 2019-09-29 22:13)

1

Hi! I believe you are referring to this bug:

https://www.lexaloffle.com/bbs/?tid=34100

It is a known bug and will be fixed in the next version:

https://twitter.com/lexaloffle/status/1173881754987331584

Until then, there is a very easy workaround: save a copy of your cart as a .p8.png first, which does correctly flatten the #includes. Then export that version.

P#68167 2019-09-26 22:34 ( Edited 2019-09-26 22:35)

Thank you kittenm4ster!

P#68170 2019-09-26 23:09

[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2024-03-28 21:06:31 | 0.005s | Q:12