creatures caves welcome, guest
downloads   gallery   dev   community   creatchi   forum   mycaves
bookmarks | search | post new topic
Development Forum
old
How to make objects face each other   
clohse
Mad Scientist

clohse
United States  

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

I am making a pair of dolls that interact with each other. I need to figure out how to tell if they are looking at each other and if so change their animations accordingly.

How do I let object A know when object B is facing him?


CLohse's Norns at the Creatures Repository
 
Ghosthande
Prodigal Sock

Ghosthande


 visit Ghosthande's website: Breeders Beware
  10/27/2013  1

Hmm... you could check to see what their POSE is if they aren't animated, or set a variable and check that. Like, if I make a critter or something that moves I might use ov00 to store which direction it's going, with 0 for left and 1 for right. Then I could just do something like this:


*grab direction and position of the other agent
esee X X XXXX
doif targ ne null and targ ne ownr
setv mv01 ov00
setv mv02 posx
endi
next

doif ov00 eq 1 and ov01 eq 0 and posx lt ov02
*I am facing right, it is facing left, and it is to my right
elif ov00 eq 0 and ov01 eq 1 and posx gt ov02
*I am facing left, it is facing right, and it is to my left
endi


That's the simplest way I can think of, at least. :)



 


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