Please or Register to create posts and topics.

Gravity change

I've scoured the forums for so long trying to find a solution for this but how would you get a map that completely switches the gravity when you step on a certain platform. I've played a map before called "flip flop" on the workshop with this concept but it's the only map that I can find.

I would assume you would need 2 of the same map but facing the two directions I need and have teleports between them, but how would I make that a smooth transition? And the map I played also was able to switch the cubes gravity without it leaving my sight when I was in normal gravity. How do I perform this magic??!! Thank you!

For the cubes to switch their gravity, you can use a trigger_gravity, and set it to -1. This of course won't work well with the player because it does not make the players view flip. There are a few methods to getting the players view to flip. I have always worked with strategically placed world portals with many triggers to induce this illusion. If your a beginner, that may your best option. (I've seen you around a while, so I doubt that's the case.)

As a more complicated solution, if you want to avoid scripting, I would build a 3-dimensional grid with func_movelinears, and parent func_tanks to these. Make them each invisible and make it so the player cannot touch them. Have the func_tanks parented to one movelinear, which is parented to another movelinear, which is parented to the final movelinear. Set up an input from the func_tanks to move the movelinear in whichever direction will bring it closer to the player. (2 func_tanks per movelinear is suggested, one to close and one to open. The last movelinear in the parent chain should be able to acuratly track the player's position via it's own position. If you use these inputs to make a similar grid in an inverted version of the map, you should have an object at the exact position you would need to telleport the player to. If your creative with logic, you should be able to switch the rolls between the tracking and following movelinear grids.

Another option that involves a flipped version of the room would be to use scripting. If you have an object somewhere in the room, you can call it's location with the .GetOrigin() function. Then find the direction to the player's position by subtracting the origin of the player by the origin of the center object. This should already be multiplied by the distance between the objects. Multiply each part(x,y,z) of the vector by -1, and add the new vector to the origin of the center piece of the other version of the room. Then use the player.SetOrigin(newcalculatedvector) function to put the player in this calculated position. You can do the same with the cubes and other physics objects.

If you would like to try editing the players view to simulate flipping without actually telleporting the player, you may be able to get a viewproxy to make it look like the player is upside down. Parenting this to the player, even with a maintained offset, shouldn't work, but if you use the logic_measuremovement(or parent something to the players eyes), you should be able to get another entity that can have a yaw/pitch/roll. You can use that as a reference with a simple script to set the rotation(I think you would have to just change the roll by 180 degrees, possibly) to give the illusion that the player is upside down. Use a maintained offset to keep the object parented to the player's eye at the player's feet. The dissadvantage to this is that the camera will probably lag begind the player's input a bit. The advantage is that you can activate this anywhere without doubling your brushes, models, and entities.

If one of these methods interests you, but you think could use more detail, let me know and I can elaborate. There was just a lot to wright.

This video I made a long time ago should help you :) https://www.youtube.com/watch?v=HClbHaNtA8c

Making a puzzle is a puzzle in itself
My Workshop : >-Click Me-<
--> Reflection Gel Testing 4 <--
FireFusorf wrote:
This video I made a long time ago should help you :) https://www.youtube.com/watch?v=HClbHaNtA8c

If there is one thing I could change about you, it would be your last name.

Will you marry me? :lol:

Yes, two rooms is a general idea. But world portals can be buggy if you see portals thruogh them. To avoid this problem you can just teleport player from one room to another.

God bless the quick save's inventor...(Portal: Prelude)

Teleporting the player might be more reliable, however, the "transition" is a lot smoother using world portals, as the camera rotates.

l1zardr0ckets wrote:
If there is one thing I could change about you, it would be your last name.

Will you marry me? :lol:

I'm afraid this is not possible, I live on the moon :(

Making a puzzle is a puzzle in itself
My Workshop : >-Click Me-<
--> Reflection Gel Testing 4 <--