Woes of CAOS Coding in Creatures 1

Solving the Riddles of Carrot CAOSThe good news about the C1 carrot update is that the project is nearing completion! The more important elements of the scripts have been lightly tested, and will be put through more robust testing. First, though, I seem to have run across a couple of puzzling errors. I figured I would put these up for discussion, since there are many talented CAOS users in the Creatures community! A lot of this has been a learning experience for me, so I’m sure that I simply may be trying to do certain things that Creatures 1 can’t handle. This screenshot actually shows one of the updates, although it might not be too obvious. I’ll leave that a not-so-exciting surprise for the time being! Make sure to brush up on your CAOS skills, and perhaps you’ll even have a possible solution!

One Coding Mistake in CAOS and the ResultCAOS Problem #1
Ah, a lovely macro script error! What I’m trying to do is to make each carrot point either left or right each time it is dropped. I added in a new image in the sprite file, edited the other scripts to update the total number of images in the sprite file, and wrote a bit of CAOS. I have tried practically everything in the book that I can think of to make this pose load correctly… To no avail.

Here is the annotated script. Don’t worry if it looks completely foreign to you! I will be going into this in more depth as we explore CAOS more in the future. This version is mostly to figure out what I’m doing wrong!

CAOS Code Explanation
scrp 2 6 3 5 This is the script for what to do when a carrot is dropped.
snde drop When a carrot is dropped, it plays the drop.wav sound file.
rndv var0 6 7 A random value between 6 and 7 (inclusive) is chosen and assigned to var0, a variable. I’ve tried all different iterations here, with other variables and object variables. The goal here is to choose either pose 6 or 7 in the sprite file, which corresponds to a dropped carrot pointing left or right.
setv pose var0 I believe this is the root of all my issues! This line is supposed to set the pose of the current carrot to whatever random variable was chosen above (6 or 7). It never works. I’ve tried this with and without the setv command, and with the other variables mentioned above. Perhaps this is beyond the scope of Creatures 1, though. Can the pose command only take a set number, and not a variable?
endi This marks the end of a doif statement… Although there isn’t one in this script. Possibly the cause of my problem, now that I see it?
endm The end of the script.

CAOS Problem #2
This may or may not be related to CAOS, but the carrots refuse to show up correctly in my world when I edit the sprite file. It is pars.spr, correct? I get distorted images every way I try it. Yet if I create a new sprite file with a different name, I have no issues. The bitmaps are all the same… Baffling! The screenshot at the top shows the carrots and how they appear correctly. Every pose works, aside from the two dropped poses, since I haven’t been able to get that CAOS working just yet. Is it possible to edit existing sprite files? I had no problems with all of my updated egg sprites. Perhaps I simply have to try this out a few more times, as it could be something obvious I’m just missing! Feel free to share any thoughts!

Help is greatly appreciated, and anyone who might be able to offer up a solution or two will receive a mention in the credits section when this carrot update is complete! There might even be some beta testing opportunities coming up…

« Previous Post | Next Post »