creatures caves welcome, guest
downloads   gallery   dev   community   creatchi   forum   mycaves
bookmarks | search | post new topic
Help Forum
old
CAOS for the First Time   
Delcron

Delcron



  4/10/2020

Hi all, I'm really sorry for asking so many questions today, but I'm stuck... again. I was determined to learn how to do CAOS for agents, and I got through the basic coding without much incident, thanks to Rascii https://creaturescaves.com/community.php?section=Resources&view=2 . I knew I had to use something to package the files together, and I was trying to make easyPRAY work, gave up after an hour and switched to Jagent. I've never written a PRAY file, and there are a lot of numbers that I'm not sure where to find in files, some images I can't find, and I don't understand what an image gallery is. I feel like I got so close to making the tutorial agent work, but my game throws error after error.

Here's what I've cobbled together, it's extreme beginner level, and yes, I couldn't find a cheese image so I used the robot toy.

inst
new: simp 2 11 4645 "charles_cheese" 1 22 500
attr 195
elas 10
bhvr 48
accg 2
perm 100
*#Pray-File "charlscheese.agents"
*#DS-Name "Charles Cheese"
*#attach chwp.wav robot_toy.c16
seta va00 targ
enum 1 2 11
spas targ va00
doif ov00 = 0 and clac = 0
mesg writ targ 0
endi
next
scrp 2 11 4645 12
snde "chwp"
stim writ from 79 1
kill ownr
endm
rscr
enum 2 11 4645
kill targ
next
scrx 2 11 4645 12

I'm pretty sure I'm missing a lot of information in this code, any pointers would be greatly appreciated.

 
Malkin

Malkin

Manager


 visit Malkin's website: Malkin's page at CWiki
  4/10/2020

There are a few tutorials on the Creatures Wiki, like the basic doll script that use CAOS2PRAY (a feature of Jagent) to avoid writing a PRAY file altogether. It needs to be at the top of your .cos file.

My TCR Norns
 
ylukyun
Patient Pirate

ylukyun

Manager



  4/10/2020

If you're using the robot toy image, shouldn't the install script call "robot_toy" instead of "charles_cheese"? I think that's what image gallery means here - a sprite file with a number of frames.

Edit: Got an apple for this. So close...

 
Papriko
Peppery One

Papriko



  4/10/2020

Quite frankly, despite my track record I have hardly ever written PRAY as well.
What I do is that I pick some random agent that I know works and use Jagent's decompile feature to pop it open. This creates, among other things, a functioning PRAY file.
I simply tweak what needs to be tweaked and then put it all back together.


Lets play plants! Photosynthesis... Photosynthesis... Photosynthesis...
 
Arnout

Arnout



  4/10/2020

Good to see some people get into CAOS! Speaking from experience (I did that same tutorial about 3 years ago), it's actually a fairly easy coding language to get into, even if you've never coded before. You just need to be patient and good at reading. :)

You shouldn't worry about PRAY files yet. They're only necessary once you're ready to make downloadable agents files. Any in-game testing of scripts can be done from the CAOS tool or the in-game CAOS command line (CTRL + Shift + C). Attempt to make a few working scripts first, then worry about that. You also hardly need to write any PRAY yourself, as our peppery friend mentioned above.. unless you make really complicated stuff like a metaroom or something.

May I presume that this is your first agent? If so: Let's just try to get this agent safely into your world first. Follow the steps below. I might repeat some stuff from the guide, but then again I'm not sure what causes the error.

So what's really important in CAOS (and any other code) is that you read and understand every bit of code that is written. You can find every single code (for Docking Station) here.. But I wouldn't use that page for Charles yet.

Step 1 of any CAOS code is finding and opening your image file (c16). You specified that you couldn't find a cheese image, but it's right there on the page. :P (Direct link) Download that and put it in your Images folder. Also put a copy somewhere else in a folder (documents or something).
You need to start the spritebuilder and open charles_cheese.c16 from wherever somewhere else is (not Images!). Then, you should see the collection of images that the image file contains. In this case: All kinds of animations for Charles. The sprite builder always begins counting at 0, and it ends at 26. So a total of 27 images. Remember that and hold on to the collection of images for now.

So a CAOS script (for an agent such as this) always consists of 3 parts. Part A is the install script, part B the event script(s) and part C the remove script. That's crucial to remember.
Part A ensures that your agent enters the world.
Part B usually consists of more parts and enables your agent to interact with the world.
Part C allows an agent to be safely removed from the world.

Step 2 of the CAOS code is determining your classifier. But you don't need to do that yourself in this guide, since the writer of the guide already did it for you.

new: simp 2 11 4645 "charles_cheese" 1 22 500


So we're telling the game to make a new simple (new: simp) agent. I think this means that the agent usually consists of a single part, but I could be wrong. It's not really important for now anyway.

The classifier consists of a family (2), genus (11) and species (4645). Each agent type has their own classifier. (Check the genus numbers for "food" for C3/DS on this page)... But the only thing unique about every single agent is the species number. For the family and genus, just look at that page. All "food" agents are 2 11 XXXXX and all "critter" agents are 2 15 XXXXX. It's important to note that the family, genus and species must remain exclusive for a single script. If you make another script with classifier 2 11 4645, the game engine will go bonkers. Those three numbers will be used all throughout your script, so hold on to them!

The game engine needs to know where to draw the appearance of your agent from. That's why the next part is "charles_cheese", it's the same name as your image file, but without the extension. If charles_cheese.c16 is not in your Images folder, the game will throw you an error (and it will not make the agent).

The next 3 numbers are different for each install script, and they all have a different task. The first two are related to your image collection in the spritebuilder. The last one determines whether the agent appears in front of or behind other agents. The guide seems to be pretty clear about those. :)

Part 3:
attr 195
bhvr 48
elas 10
accg 2
perm 100


These are all features of your agent. This is an explantion of ATTR. You can play around with the rest once your agent is in the world, to see what they do. Except for BHVR: BHVR is a command that commonly causes errors, when you're just starting out. It needs to be at a specific value, depending on the amount of event scripts (part B) that are in your code. I'd put an asterisk (*) directly in front of BHVR, until you understand how event scripts (part B) work. The text should turn green.

Creatures 3:
mvto 760 770


Docking Station:
mvto 450 9250


MVTO moves your agent to a direct position in your world, using coordinates. You can track down the coordinates of a place by pressing CTRL + shift + X in your game and hovering the pointer somewhere. This seems to be missing in the Charles guide? I'm not sure. Pick the coordinates of C3 and it will appear in the Norn Terrarium. The DS coordinates move the agent to the Norn Meso. Creatures 3 stand-alone uses the same world map (and thus coordinates) as Creatures 3 in a docked DS world.

Leave the rest of the code out for now.
inst
new: simp 2 11 4645 "charles_cheese" 1 22 500
attr 195
*bhvr 48
elas 10
accg 2
perm 100
mvto X Y


So in short:
- Install the image (c16) file and always check it out using the spritebuilder.
- Choose a classifier.
- Determine the attributes of your agent.
- Move the agent somewhere.

If you did this all right, you can try to install the script from the CAOS tool (F9), or by putting the script (.cos) file in your Bootstrap/001 World folder (C3) or Bootstrap/010 Docking Station folder (DS) and starting a new world. The latter causes a script to be automatically run when you make a new world.

Long post! If you made it here, well done. Sorry about any bluntness. That's how people from my country tend to be.

Once you manage to make the agent appear in your world, let me know, and we'll get to the event scripts (part B of a script) and maybe the remove script (C). You could wait for me to respond or try to understand it from the guide. :P

 
Delcron

Delcron



  4/10/2020

Thanks you guys, I followed you, Arnout, and I got it into my world. Another slight problem is that my C3 is screwy, so I can't test script directly from the CAOS tool (unless I can direct it to docking station?). I didn't know about the bootstrap shortcut, so I think that's my quickest way to test new scripts. Thank you again, and I'm ready for the next part :)

Edit: I took a stab at finishing the tutorial and I managed to cobble together the PRAY file part of the agent, and it actually worked!! Thank you, everyone. I'm going to follow some more tutorials, the animation for the cheese is probably next :D

 
Arnout

Arnout



  4/11/2020

You can also just put the script file in your bootstrap (001 World or 010 Docking Station) folder and directly load and edit the file from there with the CAOS tool.

If you need any testing, open up the CAOS command line in-game (CTRL + shift + C) and type: ject "charlescheese.cos" 7 (or whatever your script file is called, don't forget the extension either way)

If you have a proper remove script, this will entirely reinstall the script in your world.. Which is useful for testing, if somehow the CAOS tool doesn't connect to your game.

Good to see you managed to get the hang of the rest of it. If you have any more questions, don't hesitate to ask. :)

 


downloads
cobs
adoptions
creaturelink
metarooms
breeds
 
gallery
art
wallpaper
screenshots
graphics
promos
sprites
dev
hack shack
script reservations
dev resources
active projects
dev forum
 
community
links
advice
chat
polls
resources
creatchi
 
forum
bookmarks
general
news
help
development
strangeo
survivor
mycaves
log in
register
lost pw
0 online
creatures caves is your #1 resource for the creatures artificial life game series: creatures, creatures 2, creatures 3, docking station, and the upcoming creatures family.

contact    help    privacy policy    terms & conditions    rules    donate    wiki