creatures caves
welcome, guest 

downloads   gallery   dev   community   creatchi   forum   mycaves
bookmarks | search | post new topic
 
Development Forum
old
Checking for Safe Location?   
savannahs11

savannahs11
United States  

 visit savannahs11's website: Dragon Station
  10/3/2017

I'm working on an agent that injects in the form of a tiny seed that fits in the inventory and turns into a giant machine that does not fit in the inventory when clicked. I need it to be able to check to see if it's in a safe location to transform when it's clicked so that it doesn't autokill if the space is too small. Any help?

Somewhere, inhuman screeching can be heard.
 
Malkin

Malkin
Australia  
Manager


 visit Malkin's website: Malkin's page at CWiki
  10/3/2017

TMVT is your friend.

My TCR Norns
 
savannahs11

savannahs11
United States  

 visit savannahs11's website: Dragon Station
  10/3/2017

That's exactly what I'm looking for! I can't seem to find a way to get the agent to reference its own coordinates, though. I was thinking (current X/Y position) + (how much you're moving), but I don't know how to do that.

Somewhere, inhuman screeching can be heard.
 
Zzzzoot

Zzzzoot
United States  


  10/3/2017

I believe POSX and POSY will work for you. They return the X and Y positions of the center of TARG.

So something like:

setv va00 posx
setv va01 posy

should work. (assuming TARG has been set to your agent)

Position (0, 0) is the top left corner of the entire world, so adding to X and Y moves the position right and down. Subtracting moves left and up.

Be careful, MVTO (and I assume TMVT) use the *top left corner* of the agent's sprite, while POSX and POSY use the *center* of the agent's sprite.

 


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