chickenxhat [Lexaloffle Blog Feed]https://www.lexaloffle.com/bbs/?uid=24211 Boot Pico 8 directly into a game? <p>I've been searching around various forums and can't seem to find a definitive answer. Is it possible to set up Pico 8 to boot directly into a game, and have it run automatically? Pico 8 is an awesome platform for writing silly applications and I would love to make a dedicated hardware setup that boots directly into one of these applications (think: cosplay gadgets!). Anyone have experience with this?</p> https://www.lexaloffle.com/bbs/?tid=31779 https://www.lexaloffle.com/bbs/?tid=31779 Fri, 31 Aug 2018 10:41:54 UTC Yurt (help?) <p> <table><tr><td> <a href="/bbs/?pid=52646#p"> <img src="/bbs/thumbs/pico52950.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=52646#p"> Yurt - interactive novel / adventure game (work in progress)</a><br><br> by <a href="/bbs/?uid=24211"> chickenxhat</a> <br><br><br> <a href="/bbs/?pid=52646#p"> [Click to Play]</a> </td></tr></table> </p> <p>Several updates, but one new curious problem:</p> <p>I'm attempting to transition the player to a third scene (the second floor of the yurt), which sets player.x=#, in this case around 340, which is the appropriate x value relative to the area of the map I've used to design that scene. However, it appears using the code I've designed (which has worked just fine for transitions between the first and second scenes) the largest X coordinate value I can assign in this transition method is x=295. Setting to x=296 causes the player to become stuck, and no button input is registering. Its almost as if the draw method is no longer working at that point, because the player doesn't move at all. Typically when I've accidentally made the player's coordinates persistent, pushing in the directions still causes the directional animations to play out, but not in this situation. Is this a known issue that I'm unaware of, asking the player's x value to be set higher than 296? If so, how do we get usage out of the total map area? I'm at a loss here.</p> <p>Curious.</p> <p> <table><tr><td> <a href="/bbs/?pid=52646#p"> <img src="/bbs/thumbs/pico52820.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=52646#p"> Yurt - interactive novel / adventure game (work in progress)</a><br><br> by <a href="/bbs/?uid=24211"> chickenxhat</a> <br><br><br> <a href="/bbs/?pid=52646#p"> [Click to Play]</a> </td></tr></table> </p> <p>Davbo with the win!</p> <p>Needed to use elseif to split the two different condition sets for the door transition. It works like a charm, and was just as simple of a fix as I suspected it would be. Yeesh.</p> <p>Time to program the interactive objects for multi-purpose use (computer, dresser, any other items I can come up with for this &quot;tech demo&quot;).</p> <p>Wooh!</p> <p> <table><tr><td> <a href="/bbs/?pid=52646#p"> <img src="/bbs/thumbs/pico52796.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=52646#p"> Yurt (help?) 5/15 9PM update</a><br><br> by <a href="/bbs/?uid=24211"> chickenxhat</a> <br><br><br> <a href="/bbs/?pid=52646#p"> [Click to Play]</a> </td></tr></table> </p> <p>Uploaded now is a version where I've commented out the attempt to return the game state to the first level, at around line 304 in-code. As you can see, the transition works perfectly one-way, I just want to be able to return the game state to its original form when interacting with the &quot;transition&quot; object while in the &quot;yurt interior&quot; game state. It really seems like it should be simple, but there's some arcane order-of-operations stuff that I'm ignorant to thats preventing me from making it happen.</p> <p>Anyone willing to have a look?</p> <p> <table><tr><td> <a href="/bbs/?pid=52646#p"> <img src="/bbs/thumbs/pico52795.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=52646#p"> Yurt (help?)</a><br><br> by <a href="/bbs/?uid=24211"> chickenxhat</a> <br><br><br> <a href="/bbs/?pid=52646#p"> [Click to Play]</a> </td></tr></table> </p> <p>I've basically arranged everything as I'd like, and am ready to begin creating scenes that are more than simply tech demos for programming purposes. I've run into an issue that should likely be resolved by discovering an already-invented wheel, if someone can point me in the right direction.</p> <p>In short:</p> <p>A flag (game.stage) is set to a string (&quot;island&quot; or &quot;yurt&quot;) depending on which scene I'd like to depict. Modifying this flag occurs when the player is &quot;proximal&quot; to an object called &quot;transition&quot;. In the most update to date code I have, I'm attempting to set the flag to game.stage = &quot;yurt&quot; if the transition object is interacted with only if the currect game.stage==&quot;island&quot;, and then vice versa. You can see my attempt at this at around line 295 (using Atom which I believe is offset three lines from what PICO-8 sees).</p> <p>From what I can tell is happening, the program checks to see if btnp(4) and transition.proximal and game.stage==&quot;island&quot; and attempts to make the transition, but as-designed it loops through the next if-statement and resets game.stage back to &quot;island&quot;. I would have though that using btnp() would prevent this from happening, but I must be failing to understand how this is working. As I have it written now, it seems like it should &quot;just work&quot;, but... alas.</p> <p>Here's where the already-invented-wheels might come in. Hopefully I've explained this simply so that it can be understood easily. How do I achieve what I'm attempting to do without the btnp(4) causing the scene to switch and switch back in one go? I can tell its partially working because one of the effects of switching to game.stage=&quot;yurt&quot; is that the player's coordinates are reset per lines 303 and 304.</p> <p>Anyone willing to review and advise?</p> <p> <table><tr><td> <a href="/bbs/?pid=52646#p"> <img src="/bbs/thumbs/pico52764.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=52646#p"> Yurt 5/14 midnight update</a><br><br> by <a href="/bbs/?uid=24211"> chickenxhat</a> <br><br><br> <a href="/bbs/?pid=52646#p"> [Click to Play]</a> </td></tr></table> </p> <p>Shifted to a system where every actor / object will be created at _init(), plotted onto the absolute X/Y coordinates of the map system, rather than screen real estate. When interacting with transition object the camera and map are adjusted as necessary to actually transition to the next scene on the map. Objects like the mom and dad characters can be moved when the scene.counter variable changes, but the may simply be left behind if no longer needed. I suspect as the little game scenario plays out that certain actors will need to be relocated for further narrative interaction.</p> <p>One of my last issues was figuring out how to move the player along with these transitions without the new coordinates being persistent and thus keeping the player trapped in place. It seems obvious now, but adjusting the player's coordinates in the check for interaction with the transition object associated with a btnp() to trigger did the trick.</p> <p> <table><tr><td> <a href="/bbs/?pid=52646#p"> <img src="/bbs/thumbs/pico52746.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=52646#p"> Yurt 5/14 update</a><br><br> by <a href="/bbs/?uid=24211"> chickenxhat</a> <br><br><br> <a href="/bbs/?pid=52646#p"> [Click to Play]</a> </td></tr></table> <br /> More updates.</p> <p>Bridgs' object creation method appears to work great when the only time it is called is on _init (once), otherwise it creates a new object every time the game updates. Using the coin collection method she created where the object is only drawn when a certain variable is true (or not false..), I was able to adapt that for when to show the invisible barrier objects on the island. This means I had to create new invisible barrier objects for any other scenes to come, like the yurt interior that is transitioned to when you enter the door, so thats less than ideal</p> <p>The _draw() function works just fine for drawing non-interactive props like the moving waves and the computer inside the yurt, and for establishing what cls() color to use, what section of the map data to draw to the screen, etc. It can't be used to call additional objects though, and apparently neither can the _update() function, as these care called constantly, creating more and more iterations of the objects that are created using the make_game_object function.</p> <p>I can continue to adapt this for my purposes, but I think perhaps a meaningful further piece of guidance in any further tutorials in this series from bridgs (thanks again!) would be more ways to interact with the objects as designed in the tutorial, namely to move them! All I'd like to do is move existing objects! Clearly there's something about the method as-designed that I'm failing to comprehend or grapple with.</p> <p>Paging <a href="https://www.lexaloffle.com/bbs/?uid=16414"> @bridgs</a>?</p> <p> <table><tr><td> <a href="/bbs/?pid=52646#p"> <img src="/bbs/thumbs/pico52703.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=52646#p"> Yurt 5/13 update</a><br><br> by <a href="/bbs/?uid=24211"> chickenxhat</a> <br><br><br> <a href="/bbs/?pid=52646#p"> [Click to Play]</a> </td></tr></table> </p> <p>Made several additions.</p> <p>I've changed the invisible barriers to a highly visible sprite for testing, and added a teleport block that when proximal to and btnp(4) changes the scene to the interior of the house, as a means of transitioning.</p> <p>As the barriers, player and &quot;mom&quot; and &quot;dad&quot; actors are created with the &quot;make_game_object&quot; function from bridgs' excellent tutorials (but not created by me...) I do not fully understand how to manage moving those objects when transferring from the first scene to the next. I can manage removing the sprites that are simply drawn to the screen only when the first scene is active, but the other interactive objects I'm stumped on. I'll have to keep reviewing bridgs' tutorials and get a better understanding of the syntax and how to continue to adapt it for my purposes.</p> <p>My best estimate is that due to how the player, barriers, mom/dad are initialized to the screen, my method of transitioning from one scene to another won't be able to affect those objects without changing some states and values of their properties as established in the &quot;make_game_object&quot; function as it relates to each specific object. Lots more to ponder.</p> <p>Definitely a great way to learn this, but also poses some challenge when you don't fully understand shared code..</p> <p> <table><tr><td> <a href="/bbs/?pid=52646#p"> <img src="/bbs/thumbs/pico52645.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=52646#p"> Yurt</a><br><br> by <a href="/bbs/?uid=24211"> chickenxhat</a> <br><br><br> <a href="/bbs/?pid=52646#p"> [Click to Play]</a> </td></tr></table> </p> <p>Special thanks to <a href="https://www.lexaloffle.com/bbs/?uid=16414"> @bridgs</a>_dev for her excellent tutorials on Youtube. I've converted my first piece of learning script from last year to utilize her game logic, and have made my own alterations. My previous attempt was --terrible-- and running into her tutorials delivered a better method to accomplish the same things I was trying to do, and even showed me the &quot;right&quot; way to do it, as well as clued me in further on Lua syntax. I'm improving!</p> <p>I'm posting this basically just to keep her updated. Still absolutely a work in progress.</p> <p>I don't intend to create an RPG or anything of that sort, but closer to a &quot;visual novel&quot; or a mix between a top-down action game and a point-and-click adventure.</p> <p>I intend to make a series of these types of &quot;games&quot; and have the scenarios be &quot;social stories&quot;, which are a teaching tool for Early Childhood Education. Most of them you can find out there are incredibly rudimentary 4-6 page doodled comics showcasing appropriate behavior or short narratives about how a child should tackle a problem or situation. I think PICO-8 is perfect for doing this in a far more entertaining way.</p> https://www.lexaloffle.com/bbs/?tid=31267 https://www.lexaloffle.com/bbs/?tid=31267 Sat, 12 May 2018 11:50:15 UTC Need assistance changing map / camera / etc <p> <table><tr><td> <a href="/bbs/?pid=40303#p"> <img src="/bbs/thumbs/pico40365.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=40303#p"> Yurt - an engine WIP UPDATED 5/8</a><br><br> by <a href="/bbs/?uid=24211"> chickenxhat</a> <br><br><br> <a href="/bbs/?pid=40303#p"> [Click to Play]</a> </td></tr></table> </p> <p> <table><tr><td> <a href="/bbs/?pid=40303#p"> <img src="/bbs/thumbs/pico40299.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=40303#p"> Yurt - an engine WIP</a><br><br> by <a href="/bbs/?uid=24211"> chickenxhat</a> <br><br><br> <a href="/bbs/?pid=40303#p"> [Click to Play]</a> </td></tr></table> </p> <p>Hello!</p> <p>New user here, and absolutely in love with Pico-8!</p> <p>Having followed several available tutorials online, I've cobbled together a few concepts to get this game running. Its just a player moving around a game field with some actors standing in the first screen. The player is repelled by the actors, which is sortof how I want to handle collision between the player and most objects. I may tweak that depending on what the player is bumping into.</p> <p>I'm posting here because I've run into a dead end with my attempts to change the map displayed on screen. I intend to set triggers that switch what area is displayed on the screen (like the player walking onto a door tile), but currently I'm trying to figure out the necessary code to change what is displayed while the &quot;trigger&quot; is tied to btn4.</p> <p>As you can see in the referenced WIP cartridge, scene_counter is set to &quot;1&quot; in _init, and if scene_counter == 1 then the map region (0,0,0,0) is drawn to the screen. However, if btnp(4) then the map region is changed to (16,0,0,0), which is the next region on the map data I'd like the &quot;scene&quot; to be framed at. With my current code the map background is changed correctly (and an empty desert scene is drawn, with marker-tiles on the outer corners to ensure I've set the new map coordinates correctly), however --</p> <p>As you can see (if you run the game and press Z) the map is changed but the player appears to still be interacting with the constraints of the previous map scene on the island. Moving up and down, you still interact with the screen as if the two NPC actors are still present, and as if you are still on the island with the un-walkable water tiles and the yurt present in the center. You should don't see them.</p> <p>I'm curious if anyone can review my code (and identify which tutorial I pulled the concepts from ;) ) and assist me in identifying why my game is showing the map correctly, but not actually moving the coordinates of where the action is taking place to the correct region in the map-editor data? Am I understanding whats happening correctly?</p> <p>Any assistance would be great, and any constructive criticism would also be helpful. As a side note, it should be painfully obvious from my code that I'm a novice to any and all programming and could probably get done what I'm doing here with shorter code, likely with more advanced methods. I'm manually checking a lot of coordinates for my &quot;collision detection&quot;, which works but is taking up more tokens that it probably should.</p> <p>As an additional note, please ignore my in-code comments at the beginning. They're mostly just for me so I don't forget how the heck this all works, and more then a bit pretentious.</p> <p>Thanks, and enjoy!</p> https://www.lexaloffle.com/bbs/?tid=29291 https://www.lexaloffle.com/bbs/?tid=29291 Mon, 08 May 2017 02:24:07 UTC