A Lemony Call for CAOS Help

A Small Sample of the New Lemon Growth CycleMany know that I’ve been hard at work on an update for the Creatures 1 lemons, and a recent discovery gave me the images I was in desperate need of! Although I’m still far from polishing off the end product, enjoy this sneak peek at part of the brand new growth cycle! Lemons will no longer appear out of thin air, but will grow in a similar way to the carrots. Clearly I have some coding to work on in terms of the placement of the buds, yet I’m very pleased with the progress I’ve been able to make. Only one piece of CAOS has given me a bit of a headache… Ideally, I would love to have the buds randomly grow left or right, in order to give the lemon trellis a more realistic appearance. Only, I’ve had zero success!

Now is your chance to shed some light on the coding! I’m always grateful to those who point out my mistakes, since I’m still nowhere close to a CAOS expert. Learning by doing seems to work well, though! I read a tutorial written by Papriko about randomizing sprites. Although the instructions were written for C3/DS, the Creatures 1 CAOS seems to include enough to accomplish this task. I was actually able to get the game to randomize the position of the buds, so that some pointed left and others pointed right. Only trouble was that the growth cycle completely failed after reaching the end.

The CAOS Trouble with Randomizing a Lemon Bud

There are 18 images in the sprite file. Images 0-6 are for the right-facing buds, and sprites 7-13 are for the left-facing buds. Image 14 is for a held lemon, images 15-16 are for a dropped lemon, and image 17 is for a partially eaten lemon.

Partial Install Script
rndv var0 0 1
mulv var0 7
new: simp ulem 18 var0 500 0

Partial Timer Script
Looking at this again, I imagine I need some complex doif statements to state whether an object’s pose is below 7 for the right-facing buds, and somewhere between 7-13 for the left-facing buds. Only trouble is that I’m not entirely sure how to create a doif statement for poses within a certain range…

doif pose lt 14
setv obv1 pose
addv obv1 1
pose obv1

An Impending Release for Creatures 1Any and all help would be greatly appreciated! Sometimes it just takes someone else’s set of eyes to set things straight. I still have some more work to do in regards to polishing up the images and other areas of the CAOS scripting. It would be really neat to have a lemon trellis that didn’t end up like this, though! Fully-grown lemons will appear as pictured, which I like much better than having them defying gravity! I hope to have these at least ready for beta testing within the next week, or possibly even ready for release at that time. There are also some other updates to the lemons that should make them better than ever!

Tip: The best way to be confused and crash a world? Create a new sprite file and forget to put it in the images directory! I was baffled for a time about why I couldn’t even get the first lemon bud to show up without an error. It was one of those moments that really makes one point and laugh. I certainly was laughing at myself when I figured out what I did!

« Previous Post | Next Post »