creatures caves welcome, guest
downloads   gallery   dev   community   creatchi   forum   mycaves
bookmarks | search | post new topic
Development Forum
old
tmvf & mvft commands   
Annex

Annex
United Kingdom  


  3/25/2012

Hi,
I have a teleportation script I am working on, and I just can't seem to get it to run error free, no matter what safeguards I put in place.

First off I just used a standard MVSF command, but on a regular basis it throws an "Unable to find safe location" error.

My next attempt went like this:

doif tmvf va00 va01 eq 1
mvft va00 va01
endi

The idea of this being to check that the location was safe before moving the norn, but I am still getting regular invalid map position errors.

I just don't get how it can be attempting to move the creature AFTER the script should have identified the location as unsuitable.

Any help may save me from pulling out my hair.

 
Papriko
Peppery One

Papriko



  3/25/2012

Do you run it all INST? When I remember correctly does each line run in an own tick when it is not INST. It might be that the creature changes it's pose just in the moment of teleport. Let's say it is sitting during the check, but standing during the actual moving, you get an error.

With one tick being roughly 1/20 of a second it is of course not that likely that it happens, but it still can appear every now and then.


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

Moe


 visit Moe's website: Creatures 2 to Docking Station
  3/25/2012

How is your script determining what va00 and va01 are?

It might be a valid position, as determined by TMVT, but NOT a valid position for a creature, which are quite tall and bulky. The command is not testing for a safe location for the object being moved. And that's the key. Neither is the MVFT commander you're using to move the creature. So although it might be a valid position on the map, it is not a valid position for a creature. Suppose the ceiling is too low at that position, for example, or it's right next to a wall. It's a valid position, but a creature can't squeeze in there.

Try using MVSF to move the creature just for testing purposes, to see if it finds a safe location.

 
Papriko
Peppery One

Papriko



  3/25/2012

Argh, so obvious and I did not see! I didn't script for too long...

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

Annex



  3/25/2012

I thought of that...I added an object that was 140x140 pixels and use a TMVT to see make sure the object is safe moving there. I still get errors with pretty much the same regularity. (And just to be clear, all my teleport scripts happend while in INST)

To be clear, the regularity is about 1 error for every 30 norn hours, but I have been running worlds with up to 70 norn running this script all the time, so it occurs about every 20 minutes. Not good enough.

I feel I am running out of options!

 
Moe

Moe


 visit Moe's website: Creatures 2 to Docking Station
  3/25/2012

Can we see the script, or a good portion of it?
 
Annex

Annex



  3/25/2012

setv va03 posx
setv va04 posy
subv va04 2
targ ownr
doif tmvf va03 va04 eq 1
gsub inject
doif tmvf va03 va04 eq 1 and movs eq 0
setv va99 1
mvft va03 va04
else
addv va98 1
endi
else
addv va98 1
endi


Here is the tele sub-routine:


*inject teleporter sub-routine*
subr inject
*destination portal coordinates
setv va05 va03
setv va06 va04
subv va05 65
subv va06 110
*departure location coordinates
setv va07 dftx
setv va08 dfty
subv va07 75
subv va08 115
new: simp 3 2 222 "tele" 15 0 5000
tick 1
mvto va07 va08
wait 7
new: simp 3 2 222 "tele" 15 0 5000
tick 1
mvto va05 va06
wait 3
targ ownr
retn

I need the double check on tmvf due to the wait in the tele sub, and I need the wait in the tele sub to ensure that animations get to the appropriate stages.

 
Annex

Annex



  3/26/2012

Now I may have found a solution. I think the problem may have been caused by the script targeting the location of objects inside a carrying cabin (lifts etc.).

I had been running a check on the MOVS of the creature being moved, but not on the destination object. The script works by RTAR a simple object like a toy, and moving the norn to that location if it was safe. The script seemed to be failing when the object was in a cabin, so I have to assume the object's world coordinates were calculated from inside the cabin.

I have to run longer tests, but it seems to be working thus far.

 


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