problem with animating object/go to diff room

Started by Anarcho, Fri 07/05/2004 19:33:25

Previous topic - Next topic

Anarcho

I'm trying to have my character walk to a doorway, animate the door opening, and then go to a different room.  The problem is, the character just walks to the door way, and then shoots right off to the next room without the animation.

This is what i did.  I made the door an object that is initially visible as closed.  In the object interaction editor, under interact object, I did:

Character-move character (Ego,81,108,false)
Object-Set object view number (0, 7)
Object-Start object animating (0,0,5,false)
Player-go to a different room at specific coordinates (9,300,176)

I was able to animate the door, but without the "player go to a different room command".  Maybe i'm way off here.  also, I don't understand the whole Boolean false/true thing.

thanks,

Logan


..

Do you want the player to walk to the door then it opens and he walks through? If so you want true for the move character thing.

True/Flase means in move that if its true the player walks to the polace and the script waits for the player to stop walking before running the next option. In object animating it says wether it plays it once or loops.

You could try using a wait command in your thing. Run Script and then use

WaitKey( *insert time it takes thing to open here* );

?? Hope this helps

Ashen

Since I don't think the interaction editor allows you to wait for an object to finish animating (i.e. the door to open before sending you to the next room), you could try using:
Object Interaction -> Interact Object -> Run Script:
  MoveCharacterBlocking (EGO, 81, 108, 0);
  SetObjectView (0, 7);
  AnimateObjectEx (0,0,5,0,0,1);
  NewRoomEx (9, 300, 176);

See the manual for more info on what all the parameters actually do - I'm not totally sure I've set it up exactly as you want it. The only real benefit this has over Scuthberts method is you don't have to worry about timing how long it takes and converting that into game cycles.
I know what you're thinking ... Don't think that.

Anarcho



Skio


If the character moves to the next room BEFORE the door swings open try a

  while (IsObjectAnimating(x)==1) {wait(1)}

command.

You can also put a MoveCharacterBlocking command AFTER this if you want the hero to walk through the door.
Î'νδρων Επιφανων Πασα Î"η ΤαφοÏ,

Anarcho

Now if i were to do that, wouldn't i have to do then entire thing in script form, in other words, not in the easy to use editor?  Just wondering...


Ashen

The odd little bit like this you'd have to do in script, yes, but by and large you'll still be able to use the interaction editor. The problem with it is that it's easy to use because it limits the things you can do, as opposed to using scripting - for example here where there's no easy way to do what you want without using at least a little script.
I know what you're thinking ... Don't think that.

Anarcho

I did it your way Ashen, worked perfectly.  Thanks a million.  One last thing, when i walk back into the initial room, the door is still open.  How do I close it again?  Change the view?  and if so, where do i do that?


Ashen

Needs a bit of script again, I think. But if you put:

if (GetObjectGraphic(0) == BLEC) {
  AnimateObjectEx (0, 0, 5, 0, 1, 1);
}


(where BLEC is the spriteslot of the last graphic in the door open view (i.e. view 7 loop 0, last frame)) in the Room -> Settings -> Interactions -> Player Enters Room (after fade in) -> Run Script it should do the trick.

I know what you're thinking ... Don't think that.

SMF spam blocked by CleanTalk