TTLG|Thief|Bioshock|System Shock|Deus Ex|Mobile
Results 1 to 8 of 8

Thread: Room that pushes the player out.

  1. #1
    Member
    Registered: Apr 2011

    Room that pushes the player out.

    I'm trying to set up a room that, when the player enters, it will push them smoothly back out again. I also need to turn this behaviour off later so the player can pass through the room.

    I've got a rough version of this working where the room is actually water and using a flow brush for the currentóbut it's an awful hack to make the water transparent and the player not have to breathe and to replace the underwater loop with silence. Also I'm not sure if with flow brushes that I could turn it off later.

    More importantly, I also want to have ordinary underwater areas in this mission, so messing with the normal player-in-water behaviours will cause other problems.

    Any ideas?

  2. #2
    Master Builder 2018
    Registered: Jul 2008
    Could you not just use gravity and change the axis to X or Y?

  3. #3
    Member
    Registered: Dec 2003
    Location: ...nothing but flames...
    I did that in Ladytaker. Use an Emit trap to push the player out of the room. It's OK to push more gently than I did.

  4. #4
    Member
    Registered: May 2017
    Location: USA
    You could also use trapmoverelative and an nvrelaytrap with nvrelayrepeat to make it nudge the player over and over. It should be easy to make the it feel like being smoothly pushed in one direction.

  5. #5
    Member
    Registered: Apr 2011
    Quote Originally Posted by Tannar View Post
    Could you not just use gravity and change the axis to X or Y?
    I could change the gravity %, but there isn't a gravity axis property that I'm aware of.

    Quote Originally Posted by Balboa View Post
    I did that in Ladytaker. Use an Emit trap to push the player out of the room. It's OK to push more gently than I did.
    So just continually emitting physics objects at the player to push them? Hmm, interesting.

    Quote Originally Posted by trefoilknot View Post
    You could also use trapmoverelative and an nvrelaytrap with nvrelayrepeat to make it nudge the player over and over. It should be easy to make the it feel like being smoothly pushed in one direction.
    TrapMoveRelative is setting the target's PhyState velocity. I tried doing that too, but got horribly jerky results. But I see that TrapMoveRelative is also teleporting the target (even if its position is not moving) immediately before, which I guess causes the physics engine to discard the target's entire physics state? I'll try doing that too. Thanks!

  6. #6
    ZylonBane
    Registered: Sep 2000
    Location: ZylonBane
    This is trivial with a script. Just set the player's velocity to fling them out the door.
    Code:
    class flingPlayer extends SqRootScript {
    	function OnTurnOn() {
    		Physics.SetVelocity("Player", vector(1, 0, 0));
    	}
    }
    Also should probably bracket the door with invisible physics walls so sufficiently determined players can't catch themselves on the edge of the door frame.

  7. #7
    Member
    Registered: Dec 2003
    Location: ...nothing but flames...
    Quote Originally Posted by vfig View Post
    So just continually emitting physics objects at the player to push them? Hmm, interesting.
    No, you emit the player out of the emitter trap. in the direction opposite to the way they were going. Choose any velocity that feels seamless.

  8. #8
    Member
    Registered: Apr 2011
    Doing a teleport before setting the PhyState (as TrapMoveRelative does) worked nicely, and got rid of the horrible jerks.

    Quote Originally Posted by ZylonBane View Post
    This is trivial with a script. Just set the player's velocity to fling them out the door.
    Code:
    class flingPlayer extends SqRootScript {
    	function OnTurnOn() {
    		Physics.SetVelocity("Player", vector(1, 0, 0));
    	}
    }
    And this is even better! Teleporting has side effects, and this way I don't have to suffer them. I'd forgotten about the Physics script service. Thank you, ZylonBane!

    Quote Originally Posted by Balboa View Post
    No, you emit the player out of the emitter trap. in the direction opposite to the way they were going. Choose any velocity that feels seamless.

    I don't think I'd ever have thought of emitting the player! Useful to know. But the physics-based method works better for me here, as I can start the pushback gently and increase it over time so that it feels more like a constant force than a sudden change of velocity.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •