creatures caves welcome, guest
downloads   gallery   dev   community   creatchi   forum   mycaves
bookmarks | search | post new topic
Development Forum
old
Charles the Cheese - problem?   
Octopouf

Octopouf



  6/29/2015

Hi there,

I tried making charles the cheese, but when I introduce the bhvr 48 code, I get this message:

Install script caused an error or exception:
Tried to set BHVR 48 when the agent doesn't have one of the appropriate scripts... " 1 22 500 attr 195 {@}bhvr 48 elas 10 accg 2 perm 10 ...

I double-checked all codes, but found no mistake. Any clues?


*Octopouf greets you*
 
GimmeCat

GimmeCat



  6/29/2015

You'd probably need to post your code here so we can spot the mistake you missed. :)
 
Laura
Tea Queen

Laura


 visit Laura's website: CC Chat
  6/29/2015

Well, a BHVR value of 48 corresponds to the following actions:

Eat: Creature can eat this agent
Pick Up: Creature can pick up this agent

Have you made sure that your code contains both an eat script and a pick up script, because it sounds like something is missing. Like GimmeCat said, if you paste your entire code here, we can help check that for you. :)

 
Octopouf

Octopouf



  6/29/2015

inst
new: simp 2 11 4645 "charles_cheese" 1 22 500
attr 195
elas 10
bhvr 48
accg 2
perm 100
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




It's exactly the code on the Charles cheese tutorial. I hope you can find what I'm missing :p


*Octopouf greets you*
 
Laura
Tea Queen

Laura


 visit Laura's website: CC Chat
  6/29/2015

Yep... You have an eat script (scrp 2 11 4645 12), you're just missing a pick up script. Try adding this new chunk of code underneath your eat script and see if it works:

*pick up script:
scrp 2 11 4645 4
** "I have gotten"
stim writ from 18 1
endm

And don't forget that with a new script, you need to add another scrx line to your remove script, like so:

*remove script:
rscr
enum 2 11 4645
kill targ
next
scrx 2 11 4645 12
scrx 2 11 4645 4

I hope this helps! :) Also, did you notice how I added comments to those snippets of code, by starting the line with an asterisk? Commenting your code is a good habit to get into; it helps you understand what you've written and makes things easier to refer back to.

 
Octopouf

Octopouf



  6/29/2015

- So, you remove every script you introduce?
- Wouldn't it mean that if a norn picked up the cheese, it would be forced to eat it? As I don't have a drop script installed? So, I could add a drop-script if I want my norns to be able to drop the cheese?
- I am guessing the **"I have gotten" isn't part of the code. Is it?

this is the code so far, but I get the same bhvr message.


inst
new: simp 2 11 4645 "charles_cheese" 1 22 500
attr 195
elas 10
bhvr 48
accg 2
perm 100
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

scrp 2 11 4645 4
stim writ from 18 1
endm

rscr
enum 2 11 4645
kill targ
next
scrx 2 11 4645 12
scrx 2 11 4645 4



*Octopouf greets you*
 
Octopouf

Octopouf



  6/29/2015

Oh and I tried
bhvr 16

on the first (unedited) code I had, figuring it would work as I had the eat-script. But I got the same bhvr message. Am I missing something important?


*Octopouf greets you*
 
Laura
Tea Queen

Laura


 visit Laura's website: CC Chat
  6/29/2015

O er. Um... Maybe someone else will know! Sorry, I can't think straight at the moment. :)
 
Octopouf

Octopouf



  6/29/2015

Thanks for thinking with me though Laura!

*Octopouf greets you*
 
GimmeCat

GimmeCat



  6/29/2015

Octopouf: The attr and bhvr variables tell the game what a creature is allowed to do with the object. If the bhvr allows the creature to perform an action (like 'drop'), but there is no script associated with that action, then the object is simply dropped and nothing special happens. If the creature tries to eat it, nothing happens. Etc.

You only need to include scripts for actions that you want to have specific control over their effects.

Btw, in the older games, bhvr requires two right-side arguments, not just one. Is that different for C3/DS?

 
Octopouf

Octopouf



  6/29/2015

Gimmecat: Thanks for the explanation!
I have a follow-up question: For example, if a norn is stimulated by eating the cheese, but not stimulated by picking up the cheese, would it still be able to understand/learn that eating cheese gives pleasure? Or wouldn't the norn bother, as there are other things that give immediate pleasure by picking it up.

Is there a way, like a metaroom for testing, to check what objects do without the interference of other objects, or am I completely missing the point?

As for your question, obviously I have no clue. But what would the code look like if it has two right-side arguments? Maybe I can try it, and see what happens.


*Octopouf greets you*
 
Octopouf

Octopouf



  6/29/2015

I found the Random metaroom, for testing. I'll try that now.

*Octopouf greets you*
 
GimmeCat

GimmeCat



  6/29/2015

Well in C2, you would write "bhvr 0 64" if you wanted the object to be eatable by creatures. The first number, 0, corresponds to what mouse actions it responds to, and the second number corresponds to what creature action it responds to. 64 means it can be eaten.

Bear in mind that the script commands I'm talking about are for the C2CAOS language, not C3/DS. I know they're similar, but there are differences and different commands and I don't know about any of that, sorry. :)

But to answer your questions as best I can, in the context of what I know (C2)...

A creature that eats food will only learn something through the "stim writ" command, which is how the food 'injects' its nutrients into the creature. An object can be eatable, but without an eat script and a stim writ, it's not going to have any effect on the creature that ate it... and it probably won't disappear, either (because we must "kill ownr" inside the eat script to do that).

By right-side and left-side, I'm referring to the 'command' (such as bhvr, attr, addv, et cetera) on the left side, and the 'variable' on the right side (usually a number). "bhvr 0 64" is one left-side command, and two right-side variables/numbers.

I don't know if there's a way to do the sort of testing you're referring to. I think I've heard about some applications or scripts you can inject into the game that monitor an object's variables and such. This is probably more available for C3/DS but I don't have experience scripting for those games.

 
Octopouf

Octopouf



  6/29/2015

Ok, amazing things happened:
When I used bhvr 0 64, it didn't work.
When I used bhvr 64, I was able to inject it into the world. I don't think it's edible, but it just stands there. I checked the beginner document, and even when I add all behaviours, it adds to 63. So maybe I have an older CAOS program? Is that possible? Or is 64 not a number, leading to the cancellation of bhvr?

Thanks for clearing up the "stim writ" command. If you wanted to check if an object has been tried to be eaten, (and you didn't have a script for it, causing it to not disappear as you don't have a kill ownr command), how would you check that? Or is everything eaten by definition, until a script comes up that guides that action to a result?

A more personal question: why are you more experienced with scripting for C2? Is there a big difference between scripting for C2/C3/DS? Was it a conscious decision?




*Octopouf greets you*
 
GimmeCat

GimmeCat



  6/29/2015

Like I said, all of my examples are for C2 and it's extremely likely that the commands and numbers I referenced are different in C3/DS. Please don't try to apply them verbatim to C3 agents. :)

If you wanted to check if a creature has attempted to eat the object, you would set a global variable inside the eat script. After a creature triggers the eat script, that global variable can be used by all scripts of the object.

I would provide examples to help explain this concept but I fear I'd just be confusing you further! [ngrimace]

 
Octopouf

Octopouf



  6/29/2015

Ok, from 0 to 30, bhvr 8 and bhvr 0 works.
What could this mean...

I would indeed get confused, GimmeCat. :p I'm confused already. I'm out of ideas on how to fix poor Charles.


*Octopouf greets you*
 
evolnemesis
Code Monkey

evolnemesis



  6/29/2015

yeah for C3, "bhvr 48" is what you want... 16=edible, 32=can be picked up.. bhvr has only one argument in C3 and the total of all behaviors does add up to only 63... I would think that a value of 64 would be the same as 0 (no behaviors allowed).

The script numbers you have seem right too... 12 = 'was eaten', 4 = 'was picked up'. I'm not sure why you are having problems there, the code looks okay, and I have even gone through that tutorial myself without problems... It's how I made my first agent, the norn plushies... I still use it really... whenever I make new sprites, I use the Charlie Cheese sprite exported and then resized and/or drawn over, because for some reason if I try to make a new image and convert it to a sprite instead of using that one, I always have a pesky line of non-black on the bottom for some reason).


"For small creatures such as we, the vastness is bearable only through love."
"We are a way for the cosmos to know itself." - Carl Sagan

 
Octopouf

Octopouf



  6/29/2015

Would it be an idea to deinstall and reinstall docking station? I'm out of ideas from this point on...

*Octopouf greets you*
 
GimmeCat

GimmeCat



  6/29/2015

Reinstalling your game has no bearing on whether or not the object is scripted correctly.

I'm a bit confused. What exactly is the problem with it at the moment? You mentioned you were able to inject it into the world, but then "it just stands there." Is it supposed to be doing something else? Did your creature try to eat it, but couldn't? What did you set bhvr to currently?

 
Malkin

Malkin

Manager


 visit Malkin's website: Malkin's page at CWiki
  6/29/2015

It's worthwhile pressing on with the rest of the CAOS chaos tutorials - the solution to your problem may be in a later tutorial. I think the tutorials are set up initially so that the object 'just stands there'.

My TCR Norns
 


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
1 online
Kodathekobold
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