creatures caves welcome, guest
downloads   gallery   dev   community   creatchi   forum   mycaves
bookmarks | search | post new topic
Development Forum
old
Multi-bite Foods?   
Malkin

Malkin
Australia  
Manager


 visit Malkin's website: Malkin's page at CWiki
  10/11/2013

What's the difference between structuring an 'eat' script for a multiple-bites food this way:

scrp 2 11 4645 12
doif pose lt 3
snde "chwp"
stim writ from 79 1
setv va00 pose
addv va00 1
pose va00
else
snde "chwp"
stim writ from 79 1
kill ownr
endi
endm


and this way:

scrp 2 8 X 12
snde "chwp"
stim writ from 78 1
doif pose = 4
pose 5
elif pose = 5
kill targ
endi
endm


with the pose changes/killing after the stimulus?


My TCR Norns
 
Papriko
Peppery One

Papriko



  10/12/2013

The second script only proceeds to pose 5 when the current pose is EXACTLY 4. The lower poses do not proceed to pose 4 though, which creates an infinite food item if the pose is lower than 4 in the first place.
Without pose 4, it does not proceed to pose 5 and only in pose 5 it is kill targ'd when eaten.


Meh, I think that was a little unclear. When agents spawn, they are inititally at what, pose 0? Pose 1? The second script does not have any aging routines which handles that or the poses 2 and 3. it simply expects the agent to be directly at pose 4 already when eaten.
When it is not, it jumps into neither of the doifs. It does not "age" or "get bitten off", it just remains as it is.


Lets play plants! Photosynthesis... Photosynthesis... Photosynthesis...
 
Moe

Moe


 visit Moe's website: Creatures 2 to Docking Station
  10/14/2013

While the second script does present the possibility of creating an infinitely edible piece of food, it also ensures that the agent won't be flipping to images it shouldn't be using.

As an example, look at the first piece of script and let's assume that the food does not become edible until pose 2 (or it shouldn't be edible until pose 2 anyway), but let's say for some reason it has become edible at pose 0. Now you've got a piece of food that has more bites than intended, and is progressing through poses (0 and 1) with every bite. Imagine if 0 and 1 were "ripening" poses of a tomato. You've now got a tomato growing as it's eaten. :x

What it really comes down too, is ensuring that no matter which script you use, your agent is not becoming edible unless it is at the right pose, and stays there until A. Eaten, or B. Rotten.

 
clohse
Mad Scientist

clohse


 visit clohse's website: Clohse's page at the CWiki
  10/14/2013

Nice explanation, Moe. I hadn't considered the possible difference between stating exactly what the pose should be as opposed to just incrementing up from the current pose.

Although I should have because I have seen my fish swimming in reverse when their pose didn't change with their velocity... [nblank]


CLohse's Norns at the Creatures Repository
 
Malkin

Malkin

Manager


 visit Malkin's website: Malkin's page at CWiki
  11/28/2013

When a foodstuff has been randomised with a temporary variable, as in this spritesheet, how would one go about structuring a multi-bite eat script?

Is there something more elegant than the following:

scrp 2 11 X 12
snde "chwp"
stim writ from 79 1
*banana
doif pose = 0
pose 1
elif pose = 1
pose 2
elif pose = 2
kill targ
endi
*chocolate
doif pose = 3
pose 4
elif pose = 4
pose 5
elif pose = 5
kill targ
endi
*lavender
doif pose = 6
pose 7
elif pose = 7
pose 8
elif pose = 8
kill targ
endi
*strawberry
doif pose = 9
pose 10
elif pose = 10
pose 11
elif pose = 11
kill targ
endi
endm


My TCR Norns
 
Papriko
Peppery One

Papriko



  11/28/2013

When you follow my article you just need 1 doif chunk, as if animating a non-randomized agent.

Lets play plants! Photosynthesis... Photosynthesis... Photosynthesis...
 
Malkin

Malkin

Manager


 visit Malkin's website: Malkin's page at CWiki
  12/2/2013

So in this instance, because we've randomised the base, the code would be:

scrp 2 11 X 12
snde "chwp"
stim writ from 79 1
doif pose = 0
pose 1
elif pose = 1
pose 2
elif pose = 2
kill targ
endi
endm


because the pose is always relative to the base - so when we randomise it, the banana is at pose 0, so is the chocolate, etc. etc. etc.

Because we've earlier decided where the foodstuff is taking the images from, all we have to do is step through those 3 frames.


My TCR Norns
 
Papriko
Peppery One

Papriko



  12/3/2013

Exactly that is the idea.

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


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