Xqzzy Rcxmcq |
That's my "Star-Trek type automatic sliding door" or for those non-Trekkies "supermarket door" code. There's only one problem. When the ego hits the green control line, then the flag sets. But the door animation doesn't start? Any suggestions? (By the way, the animate.obj stuff is set correctly. I checked) |
Andrew_Baker |
Well, this isn't directly related to your problem, but you've used the same flag. So, in theory, if it worked at all, you'd get a door that kept opening and opening and opening.... So try if (ego_touching_signal_line || !done_flag) { // I prefer named flags end.of.loop(door, done_flag); // some other flag } if (!ego_touching_signal_line) { reset(done_flag); // This is a bit of a kludge as I } // haven't used this kind of door That's step one. end.of.loop() should reset the variable when cycling and then set it when done. Step two is easy: Download another game that has this door and steal their code. Right off the bat, I'd suggest V. you can get that at www.agigames.com |
bokkers |
Right off the bat, I'd suggest V. Well, thanks for trusting in our doors. ;D We plan to have even more reliable and visually stunning sliding doors in part 3 of the game. ;) |
Kon-Tiki |
You forgot to start the cycling. Use this instead:
-Kon-Tiki- |
Xqzzy Rcxmcq |
Something's wrong here...I've been setting the
Well, that didn't work. So I whipped up an animated little view. I set the animate.obj stuff. But here's what I did.
(YES, F9!) I knew it worked because when my ego walked on the green trigger line, the sound turned off...but...my view didn't animate? What's wrong? |
Xqzzy Rcxmcq | Neither end.of.loop OR start.cycling work >:( >:( >:( |
MagickPoultry |
There's a couple things I can think of that might be wrong. When the ego touches the signal line, it should make the door cycle through the loop. But the ego might still be touching the signal line, so f3 is still set. I think that would cause the door to continue restarting the loop every cycle. Could that be the reason, anyone? If so, I'm not immediately sure of a solution. The other possibility is where you've placed the animate.obj stuff. Is it inside or outside of the if (new_room) { section? If it's outside, is there a command that sets the view's cel? That would keep it from cycling. |
Rich |
Magickpoultry is correct. However, here is the solution. You need to use at least three flags. One is the f3 flag which tells you that you are touching the line. But, once you are touching this line, you need to set another flag so that the animation will not keep starting over and over. If that happens, you will never get through it all. The third flag is simply the end.of.loop flag. It has no real relevence to this discussion. Anyway, here is an example use. if (isset(f3) && !isset(started_door_open)) { set(started_door_open); end.of.loop(door,done_open_flag); } that should give you your wanted effect. If you want to add to that and make the door re-shut when you're not standing on it... add this below it. if(!isset(f3) && !isset(started_door_shut)) { set(started_door_shut); reverse.loop(door,done_shut_flag); } you'll probably need to reset those started_door flags at different points but this is a start. |