mailsprower1 [Lexaloffle Blog Feed]https://www.lexaloffle.com/bbs/?uid=9739 Set up portable, cross-platform PICO-8 <p>Heyo, BBS!</p> <p>I was setting up PICO-8 to be portable on my flash drive. It's easily doable, but one extra requirement I had is to make the same PICO directory available offline from Windows and Mac without hassle, since I had to move between platforms often. I also wanted to avoid using symlinks, Automator actions and other unnecessary dependencies. It's no harder, but I wanted to share a bit on how I did it for future reference. There is a <a href="https://www.lexaloffle.com/bbs/?tid=2781">handy similar thread</a> that I was referring to, but I haven't found all the info there, so I decided to gather some tricks in one place. </p> <p>First of all, if you need to prepare your existing PICO-8 data for transfer, locate your current <strong>home</strong> folder and copy it entirely into wherever you're going to store the program on the portable drive (consult <a href="https://pico-8.fandom.com/wiki/Configuration">the wiki</a> for default locations).</p> <p>Second, put PICO-8 executables for necessary platforms into the same location along with the <strong>home</strong> folder.</p> <p>The main trick is that now we need to set up shortcuts to launch PICO for each OS, with parameters that define the new portable folder locations, overriding the default configurations (which would otherwise be automatically loaded from the <strong>config.txt</strong> file). We need two folders, &quot;<strong>home</strong>&quot; for all the main stuff and &quot;<strong>desktop</strong>&quot; for saved screenshots. I put both right alongside the executables.<br /> Here's the way I did the shortcuts:</p> <h3>Windows</h3> <p>Make a shortcut for pico8.exe. Let's edit its properties. If you're going to move the shortcut elsewhere, make sure you put the directory where <strong>pico8.exe</strong> lies into &quot;Start in&quot;. In &quot;Target&quot;, append a couple parameters to the .exe path, specifying the new &quot;<strong>home</strong>&quot; and &quot;<strong>desktop</strong>&quot; directories. Mine looked like this:</p> <div> <div class=scrollable_with_touch style="width:100%; max-width:800px; overflow:auto; margin-bottom:12px"> <table style="width:100%" cellspacing=0 cellpadding=0> <tr><td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> <td background=/gfx/code_bg0.png> <div style="font-family : courier; color: #000000; display:absolute; padding-left:10px; padding-top:4px; padding-bottom:4px; "> <pre>M:\Applications\PICO-8\pico8.exe -home ./home/ -desktop ./desktop/</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>&quot;<strong>./</strong>&quot; is the root directory, so this way our carts should now be loaded not from <strong>%appdata%</strong>, but from wherever PICO-8 is. Screenshots will be saved into &quot;<strong>desktop</strong>&quot;, alongside &quot;<strong>home</strong>&quot;.</p> <h3>Mac</h3> <p>Make a text file, change its extension to <strong>.sh</strong> and put it where the <strong>PICO-8.app</strong> executable is. We can use the <strong>--args</strong> parameter of Mac's <strong>open</strong> command to do the same thing as we did on Windows. Let's put this into <strong>pico-8.sh</strong>:</p> <div> <div class=scrollable_with_touch style="width:100%; max-width:800px; overflow:auto; margin-bottom:12px"> <table style="width:100%" cellspacing=0 cellpadding=0> <tr><td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> <td background=/gfx/code_bg0.png> <div style="font-family : courier; color: #000000; display:absolute; padding-left:10px; padding-top:4px; padding-bottom:4px; "> <pre>#!/bin/bash cd &quot;$(dirname &quot;$0&quot;)&quot; open ./PICO-8.app --args -home $(dirname &quot;$0&quot;)/home/ -desktop $(dirname &quot;$0&quot;)/desktop/</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>The <strong>$(dirname &quot;$0&quot;)</strong> part changes the script execution directory to wherever this script file lies, so we get the same effect as on Windows.<br /> Now go to the script file's properties and choose the Terminal as the default application to open this (or all other) <strong>.sh</strong> files. Double-clicking <strong>pico-8.sh</strong> should now launch PICO-8 the same way it does in Windows, and all of your cart data and settings will be shared across the systems!<br /> You may want to get rid of the rudimentary Terminal window hanging out after PICO is launched. For this, you can go to Terminal's preferences -&gt; Profiles -&gt; [your current default profile] -&gt; Shell, and under &quot;When the shell exits&quot; pick &quot;Close if the shell exited cleanly&quot;.</p> <p>That's it!</p> <p>I have no Linux system to test this setup. Maybe somebody can provide us with a similar trick to make it ready for three systems!</p> <p>Please point out if you think I missed something. I'm no profound tech junkie, but I'll be glad if somebody needs this like I did!</p> https://www.lexaloffle.com/bbs/?tid=44705 https://www.lexaloffle.com/bbs/?tid=44705 Tue, 21 Sep 2021 19:03:58 UTC