creatures caves welcome, guest
downloads   gallery   dev   community   creatchi   forum   mycaves
bookmarks | search | post new topic
Development Forum
old
Gnarler Water-shyness   
Malkin

Malkin
Australia  
Manager


 visit Malkin's website: Malkin's page at CWiki
  7/12/2011

Vampess pointed out this code to me some time ago in the gnarler cos, which essentially makes the gnarler water-shy.


**keep away from bodies of water
doif room targ ne -1
doif prop room targ 5 ge 0.00001
setv va00 lorp room targ 5 0
setv va01 torx va00
doif va01 lt 0 and ov10 gt 0
negv ov10
elif va01 gt 0 and ov10 lt 0
negv ov10
endi
endi
endi


As far as I can tell, it translates to:

Do this if you're in a room.
Do this if you smell any water at all.
Look for the room next to this one that smells less like water.
Go towards the centre of the room that smells less like water.
If the less-smelly room is on your left and you were going right, turn around.
If the less-smelly room is on your right and you were going left, turn around.

Could anyone please tell me if I'm interpreting the code correctly?


My TCR Norns
 
Ghosthande
Prodigal Sock

Ghosthande


 visit Ghosthande's website: Breeders Beware
  7/12/2011

If the room the targ is in is not equal to -1... and the level of CA 5 [bodies of water] there is greater than 0.00001... then set va00 to be the Id of the adjoining room in which the smell is weaker... and set va01 as the relative X position of that room...

Yeah, so far as I can tell that's exactly what it does.



 
Papriko
Peppery One

Papriko



  7/13/2011

I had to look up some commands, but then the code became clear. I agree with Ghostie.

Lets play plants! Photosynthesis... Photosynthesis... Photosynthesis...
 
ylukyun
Patient Pirate

ylukyun

Manager



  7/14/2011

So, Gnarlers can avoid water, but not creatures? (As far as I can tell there is nothing on a genetic level that would let them)
 
Papriko
Peppery One

Papriko



  7/14/2011

You could try to do it indirectly. For example that smell of water makes them feel intensely up.
The stupid thing is: on a beach they would be afraid too and try to go upwards...

Wait, actually... You could combine some different things. For example you are able to detect suffocation! You copy the Breathing-In-Emitter, use the invert checkbox and change it from Air to Chem X.
Now you say Chem X + Smell of Water = need to go up. So it triggers when the head is under water, but not when it's camping on a beach.


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

Malkin

Manager


 visit Malkin's website: Malkin's page at CWiki
  7/14/2011

Thanks! I wasn't sure I was interpreting it right - it's been a while since I've touched code.

The Enhanced Norns, a CFE-like breed, avoid water. The documentation says it's instinctive.


My TCR Norns
 
Moe

Moe


 visit Moe's website: Creatures 2 to Docking Station
  7/17/2011

It's probably so the gnarlers don't walk into the pond in the ettin terrarium. That'd be bad. :p
 
AquaShee

AquaShee



  7/21/2011

My C2 Crabs for DS use the same code, except the other way around! :D They'll always manage to find their way to the nearest pond, even if its quite a few rooms away. A lot of the critters in C3/DS have very interesting scripts behind them.

The Community Scribble: make (y)our own metaroom!
 


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