Rotating Room?

Avatar
cornontheCoD
150 Posts
Posted Mar 05, 2008
would it be possible to have a room that rotates when the player presses the arrow key (on the keyboard) in that direction? how hard would this be to create? is it even possible?
Advertisement
Registered users don't see ads! Register now!
Avatar
msleeper
4,095 Posts
Member
Posted Mar 05, 2008
Replied 9 minutes later
Look into the game_ui entity, it allows keyboard commands to provide outputs to other entities.

Check out the Source Chariots source and/or Vehicle Base at my site, it has a good "starter package".

EDIT
It should be noted that game_ui only tracks the Forward, Backward, Strafe Left, Strafe Right, Primary Fire, and Secondary Fire inputs, irregardless of what key the player has them bound to. The Developer wiki should have a ton of information on it I think, and if someone wants to link to the Vehicle Base on there I'd be appreciative.

Avatar
cornontheCoD
150 Posts
Posted Mar 05, 2008
Replied 11 minutes later
ok, i looked at game_ui, but that only has outputs related to pressing the move keys (WASD). I want it to rotate when they press the arrow keys(keys that by default do nothing). also, from what i can see, it only works if you are looking at the entity.

also, how would i even get the room to rotate?

Avatar
msleeper
4,095 Posts
Member
Posted Mar 05, 2008
Replied 11 minutes later
No it doesn't matter if you are looking at the entity, you have to Enable it via a trigger and/or another I/O.

As I said in my edit, you can only use the keys currently bound to the movement and firing keys.

Look at Vehicle Base, you need to use some logic_compares to figure out if 1.) the player is pressing a key you want, and 2.) if you want to do anything. You could use a momentary_rot button to make the room rotate only partially based on what the player does.

Avatar
cornontheCoD
150 Posts
Posted Mar 05, 2008
Replied 27 minutes later
ok, thx ill look at those entities
Avatar
cornontheCoD
150 Posts
Posted Mar 05, 2008
Replied 21 minutes later

I am trying to rotate the room by having one wall be a momentary_rot_button, and it should rotate from a trigger_once (just to test it for now). all the other walls have the rotating wall as a parent. i am having two problems:

  1. it crashes the game when i try to run it, and it gives me some weird error about a brush not being precached. it might be because of problem 2

  2. I dont know what to put in the "via this input" in the output from the trigger. i put setPosition with a parameter override of 1, that may be why it crashed

Avatar
msleeper
4,095 Posts
Member
Posted Mar 05, 2008
Replied 16 minutes later
What? Why don't you make the entire room just one entity? You don't need to make a parent chain.

Also, you have the room enclosed by another, hollow box made of world brushes right? As in, your map doesn't leak, correct?

Try using func_rot_button instead, it will probably do what you want better now that I think about it.

Avatar
cornontheCoD
150 Posts
Posted Mar 05, 2008
Replied 6 minutes later
"What? Why don't you make the entire room just one entity?"

as in, name them all the same name and have the same entity type? wouldnt that be too complicated? (with the x and y axis rotating)

ill try this, though.

and no, i was dumb and did not have it enclosed. ill do that

Avatar
msleeper
4,095 Posts
Member
Posted Mar 05, 2008
Replied 2 minutes later
No, I mean make the entire room - all of the brushes - one entity.
Avatar
cornontheCoD
150 Posts
Posted Mar 05, 2008
Replied 13 minutes later
what? how do you do that?

edit: also, if i do it this way, will it work for complicated rooms, too (with platforms sticking out of the wall, for example)?

edit: also, game_ui is not working to rotate the walls at all. activate on touch is working, though

Avatar
msleeper
4,095 Posts
Member
Posted Mar 05, 2008
Replied 22 minutes later
You realize that you can tie multiple brushes to the same entity, right?

I don't think you are familiar enough with the Source I/O system to do this. Read some tutorials and learn how I/O works first.

Avatar
cornontheCoD
150 Posts
Posted Mar 05, 2008
Replied 27 minutes later
I turned the room into one entity now and it is rotating. the only problem is that it only rotates when i jump(i think it is getting stuck on me). i activate the rotation using a trigger i run into
Avatar
Interitus
145 Posts
Posted Mar 06, 2008
Replied 1 hour later
I dont know why it does that, but I was unable to find a fix for that. There is a workaround to keep it from doing that, but it gives another problem that may or may not be worse than this one. There's a thread in here somewhere that details the problems I ran into, but Its late, I'm tired, and I'm going to bed.

My solution to this, was to keep the player from actually being on the rotating object while it rotates. There's another map that uses a rotating room, and I think it rotates while you're on it, Ren_test2 I believe. Not sure how he pulled that off.

Avatar
Aldéz
221 Posts
Posted Mar 06, 2008
Replied 2 hours later
Make a room of one or more func_brush entities and set their parent to a func_rotating. Put the tool/toolsinvisible texture on the func_rotating and tick the Not Solid flag. With a momentary_rot_button, you can rotate the room as long as the player presses the use key. The speed of the rotation is set in the func_rotating. Not sure how to use the momentary_rot_button entity though, because I've never used it.
Avatar
cornontheCoD
150 Posts
Posted Mar 06, 2008
Replied 15 hours later
^whats the point of the invisible brush? is this just an alternate way of making a rotating room? also, the use key to rotate room is a good start, maybe i will use that for some rooms

also, can i Private message people? I want to PM the guy who made ren_test 2 so i can ask him how he did it.

I honestly dont know how i will do this, though, because it requires the room to rotate in different directions, and a func_rot_button can only rotate on the x axis or y axis, not both.

just a note: I want to figure out how to do this because i have an idea for a level that uses rotating room puzzles, but it will be different because of one thing. im keeping that one thing a secret, though.

Avatar
Aldéz
221 Posts
Posted Mar 06, 2008
Replied 25 minutes later

cornontheCoD wrote:
^whats the point of the invisible brush?

A func_rotating doesn't work as well as a func_brush in many ways, collision detection for example. If you make the room with func_brush entities, you only need the func_rotating for its rotating function. That's why you should make it invisible and disable the collision for it.

cornontheCoD wrote:
also, can i Private message people? I want to PM the guy who made ren_test 2 so i can ask him how he did it.

Click the "You have X new messages" in the top of the page or use this link:

privmsg.php?folder=inbox

cornontheCoD wrote:
I honestly dont know how i will do this, though, because it requires the room to rotate in different directions, and a func_rot_button can only rotate on the x axis or y axis, not both.

You can have a button and a func_rotating for each axis.

Avatar
cornontheCoD
150 Posts
Posted Mar 06, 2008
Replied 42 minutes later
oh, i see what youre saying. I can just have one invisible small square brush in the middle of the room, for example, and have the walls be parented to do that. I was actually thinking about that.

I still dont understand how i would make it so the same wall can rotate on the x axis, and then rotate on the y axis. isnt it just a flag?

Avatar
cornontheCoD
150 Posts
Posted Mar 06, 2008
Replied 19 minutes later
I tried what you said, and it still gets stuck when i land/am touching the ground

edit: i PM'ed Renstrike and he says that he ran into the same problem, so he made it rotate when hes not in the room. wasnt there a guy from bethesda that made a rotating room level?

Avatar
Aldéz
221 Posts
Posted Mar 07, 2008
Replied 7 hours later
The room get stuck when you touch it? Is the room rotating when you touch it? I don't understand.

As I said in my previous post, make a button and a func_rotating for each axis. When you use one of the buttons, you can change the parent of the func_brush entities to the corresponding func_rotating.

Advertisement
Registered users don't see ads! Register now!
Avatar
cornontheCoD
150 Posts
Posted Mar 07, 2008
Replied 14 hours later
ok, i get the x axis/y axis thing, but yes, the room stops rotating when i am touching it. as in, when i jump, it rotates, when i hit the ground, (most) of the time, it will get stuck. at certain angles it will keep rotating