Author Topic: Stupid doors!  (Read 2775 times)

0 Members and 1 Guest are viewing this topic.

Offline Xqzzy Rcxmcq

Stupid doors!
« on: December 05, 2002, 08:07:06 PM »
Code: [Select]
if (isset(f3)) {
 end.of.loop(door, f3);
}

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)


Pathfinder. After I finish CIMS 2004.

Offline Andrew_Baker

Re:Stupid doors!
« Reply #1 on: December 05, 2002, 08:25:04 PM »
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
I hope you realize that one day I will devour the Earth.

Offline bokkers

Re:Stupid doors!
« Reply #2 on: December 06, 2002, 02:36:31 AM »
Quote
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

  • Guest
Re:Stupid doors!
« Reply #3 on: December 06, 2002, 07:00:10 AM »
You forgot to start the cycling. Use this instead:
Code: [Select]
if(isset(f3)) {
  start.cycling(door);  ----> could also be cycle(door);
  end.of.loop(door, fx);  ----> x = any number not used yet.
}
if(isset(f4)) {
  stop.cycling(door);
//rest of the opened-door code
}

-Kon-Tiki-

Offline Xqzzy Rcxmcq

Re:Stupid doors!
« Reply #4 on: December 06, 2002, 09:09:10 PM »
Something's wrong here...I've been setting the

Code: [Select]
start.cycling(door);
end.of.loop(door,fx);

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.

Code: [Select]
if(isset(f3)) {
start.cycling(engine);
end.of.loop(engine,f9);
}

(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?
Pathfinder. After I finish CIMS 2004.

Offline Xqzzy Rcxmcq

Re:Stupid doors!
« Reply #5 on: December 06, 2002, 09:25:52 PM »
Neither end.of.loop OR start.cycling work  >:( >:( >:(
Pathfinder. After I finish CIMS 2004.

MagickPoultry

  • Guest
Re:Stupid doors!
« Reply #6 on: December 07, 2002, 02:33:33 AM »
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.


Offline Rich

Re:Stupid doors!
« Reply #7 on: December 10, 2002, 11:06:49 PM »
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.


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

Page created in 0.068 seconds with 21 queries.