I want to have 2 polyobject doors that, when activated, swing open (left and right door), wait and close.
So I tried this script:
// poly swing doors
script 994 (int poly1, int poly2, int pause) { // left door wing, right door wing, time before closing
int speed = 16;
int angle = 0.5;
// open
Polyobj_RotateLeft(poly1, speed, angle);
Polyobj_RotateRight(poly2, speed, angle);
Delay(30);
Polyobj_Stop(poly1);
Polyobj_Stop(poly2);
// wait
Delay(pause);
// close
Polyobj_RotateLeft(poly2, speed, angle);
Polyobj_RotateRight(poly1, speed, angle);
Delay(30);
Polyobj_Stop(poly1);
Polyobj_Stop(poly2);
}
...which works fine so far BUT when the player collides with one of the doors, it gets blocked and "out of sync" (it's not fully opened or closed when the script is finished).
I tried to counter this effect with the poly override functions and the door swing functions, too - but the polyobject still gets blocked.
Is there a way to have the doors NOT to get blocked by the player and move as they are supposed to?
Any help is greatly appreciated!
PS: I already tried different poly anchor start spots (crush & hurt), made no difference too (except I died when it was set to "hurt"^^).
PSS: I might have figured out a dirty workaround: Remove the "Impassable" flag of the poly objects while they are swinging. Still got to try that, though. Anybody knows how?
Hi,
I want to have 2 polyobject doors that, when activated, swing open (left and right door), wait and close.
So I tried this script:
// poly swing doors script 994 (int poly1, int poly2, int pause) { // left door wing, right door wing, time before closing int speed = 16; int angle = 0.5; // open Polyobj_RotateLeft(poly1, speed, angle); Polyobj_RotateRight(poly2, speed, angle); Delay(30); Polyobj_Stop(poly1); Polyobj_Stop(poly2); // wait Delay(pause); // close Polyobj_RotateLeft(poly2, speed, angle); Polyobj_RotateRight(poly1, speed, angle); Delay(30); Polyobj_Stop(poly1); Polyobj_Stop(poly2); }
...which works fine so far BUT when the player collides with one of the doors, it gets blocked and "out of sync" (it's not fully opened or closed when the script is finished).
I tried to counter this effect with the poly override functions and the door swing functions, too - but the polyobject still gets blocked.
Is there a way to have the doors NOT to get blocked by the player and move as they are supposed to?
Any help is greatly appreciated!
PS: I already tried different poly anchor start spots (crush & hurt), made no difference too (except I died when it was set to "hurt"^^).
PSS: I might have figured out a dirty workaround: Remove the "Impassable" flag of the poly objects while they are swinging. Still got to try that, though. Anybody knows how?
Share this post
Link to post