creatures caves welcome, guest
downloads   gallery   dev   community   creatchi   forum   mycaves
ccsf | links | advice | chat | polls | resources | post

A Hearing Vendor   Development   Malkin | 5/26/2013  log in to like post  1

updated5/26/2013
Looking at how the DS Mini Empathic Vendor hears your norns' hunger and vends food in response.

The Mini Empathic Vendor has a script which, when the main empathic vendor has its hearing turned on, causes it to vend food in response to educated norns complaining about hunger, and causes the three food vendors in the norn meso (justanut, lemon and carrot pods) to vend food if the mini empathic vendor is not close enough.

The advantage of using the catalogue files in this way is that it will work for norns speaking English or any other language - as long as they are educated, the vendor will be able to hear them.

From "empathic vendor.cos", in the DS bootstrap:

** The Vendor's Ear
scrp 2 23 3 126
**this whole script will not fire unless ov00 is 1. The ear is set as 'on' by default, but it can be set as 'off' by clicking the relevant button on the main empathic vendor.
doif ov00 = 1
lock
sets va00 _p1_
seta va01 _p2_
inst
doif va01 <> null
targ ownr
rnge 1000
** Check to see if you can actually see the speaker, if not.. get one of the pods to make some food!
doif seee ownr va01 = 1
setv va99 1
endi
** Get the hunger sentences from the catalogues.
** Protein
**this sets va10 as being the first entry in the 'creature drives' catalogue that can be 'read' by the ear. This is 'hungry for protein'.
sets va10 read "Creature Drives" 1
** Starch
**this sets va11 as being the second entry in the 'creature drives' catalogue that can be 'read' by the ear. This is 'hungry for starch'.
sets va11 read "Creature Drives" 2
** Fat
**this sets va12 as being the first entry in the 'creature drives' catalogue that can be 'read' by the ear. This is 'hungry for fat'.
sets va12 read "Creature Drives" 3

** Check Sentence to see if it wants Fat (Food)
**do if the string-in-string search, in lower case, is nearby (va00) and has expressed a need for fat
doif sins lowa va00 1 lowa va12 <> -1
part 1
frat 2
anim [4 5 6 5 255]
snde "empv"
**if you're too far away
doif va99 = 0
** Tell the Carrot Pod to make a Carrot
inst
enum 2 23 4
doif targ <> null
mesg writ targ 0
endi
next
wait 15
targ ownr
part 1
frat 5
anim [1 2 3 2 255]
stop
**or if you're close
elif va99 = 1
** Tell yourself to vend Peaking Pie
mesg writ ownr 1003
stop
endi
endi
** Check Sentence to see if it wants Protein (Fruit)
doif sins lowa va00 1 lowa va10 <> -1
part 1
frat 2
anim [4 5 6 5 255]
doif va99 = 0
** Tell the Lemon Pod to make a Lemon
inst
enum 2 23 6
doif targ <> null
mesg writ targ 0
endi
next
wait 15
targ ownr
part 1
frat 5
anim [1 2 3 2 255]
stop
elif va99 = 1
** Tell yourself to vend Yarn Fruit

mesg writ ownr 1002
stop
endi
endi
** Check Sentence to see if it wants Starch (Seeds)
doif sins lowa va00 1 lowa va11 <> -1
part 1
frat 2
anim [4 5 6 5 255]
doif va99 = 0
** Tell the Nut Pod to make a Nut
inst
enum 2 23 5
doif targ <> null
mesg writ targ 0
endi
next
wait 15
targ ownr
part 1
frat 5
anim [1 2 3 2 255]
stop
elif va99 = 1
** Tell yourself to vend Star Seeds
mesg writ ownr 1001
stop
endi
endi

endi
endi
endm


 
 
clohse | 10/27/2013  log in to like post  1

I was just working on a variation on this to vend the 3 foods or bring a toy closer for the room I'm working on. I see something I need to fix now. Thanks!
 
Malkin | 10/27/2013  log in to like post

You could adapt this to make a 'nest' agent that booted out some critters when creatures complain of boredom... (or, more gruesomely, 'hunger for protein'?)
 
ylukyun | 5/26/2013  log in to like post

These types of vendors are particularly useful when you consider a creature's inability to understand a sequence of actions.


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
Pimmix
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