Author Topic: reposition.to()  (Read 1760 times)

0 Members and 1 Guest are viewing this topic.

Offline Andrew_Baker

reposition.to()
« on: April 13, 2002, 03:59:40 PM »
Does anyone know how to get an object moving again after using reposition.to()?


I hope you realize that one day I will devour the Earth.

Offline Chris Cromer

Re:reposition.to()
« Reply #1 on: April 13, 2002, 06:33:08 PM »
Is this that same problem you had in the chat room? You remember, how it would be using the same command over and over because the var was set to a number:

if(vN == 19) {
 reposition.to();
}

The problem was that vN was set to 19 and it kept repositioning it to the same spot over and over causing it not to move.

Check to make sure that the reposition command is not being repeated by the logic.
Chris Cromer

It's all fun and games until someone get's hurt then it's just fun. ;)

Offline Andrew_Baker

Re:reposition.to()
« Reply #2 on: April 14, 2002, 02:39:11 PM »
No, I'm making sure to recognize the new state with a flag.  I got it to work properly by calling the same room with new.room() and reinitializing.  I'm not sure this is the only way, though, and it requires some trickier coding to accomplish.  Also, there are sometimes problems with reinitializing the room to support reposition -ing that I am in the process of debugging right now.

I forgot to mention, also, that in this case, it's not a regular object, it's the ego.

What happens when an object is reposition.to() -ed is that the old view is erased and redrawn at the proper location.  It no longer cycles, though, so you have to call start.cycling().  Then, it will animate.  With a regular object, the move.obj() seems to work normally after repositioning, but move.obj() and ego_dir=? doesn't yield any movement after repositioning an ego.

Like I said, though, reinitializing the room (with a conditional like if(Voodoo_Girl_on_the_boat){ego_dir=?;}) works.  I'm just trying to see if there is another way to do it.  In any case, I'm going to update my demo tonight, so anyone who is interested in seeing how I did it will be able to check out my code.  It's the ferry boat scenes.

Thanks.
I hope you realize that one day I will devour the Earth.


SMF 2.0.19 | SMF © 2021, Simple Machines
Simple Audio Video Embedder

Page created in 0.071 seconds with 20 queries.