Gravity Fields

Avatar
protoborg
288 Posts
Posted Mar 21, 2013
What is the best way to implement a gravity field? I know there are gravity triggers, but they don't appear to have a vector setting to them. I don't simply want to reduce or eliminate gravity. I want to change the direction of gravity. I know there is a variable in the code that has such settings, but I really don't want to have to go into the code simply to make a gravity field. So if someone could clue me in, I would appreciate it.
Advertisement
Registered users don’t see ads! Register now!
Avatar
CamBen
973 Posts
Posted Mar 21, 2013
Replied 1 hour later
A trigger_vphysics_motion should work, there is a keyvalue for setting the gravity scale.
Avatar
Naulziator
104 Posts
Posted Mar 21, 2013
Replied 4 hours later
If you want to have an effect similar to my GTest from last year, use linked_portal_door and set them up in alternate angles. First, you'll need to make an area with the altered gravity part being 'upright' with the main area. Copy the 'flux' area with a linked_portal_door and rotate it accordingly. Your textures should all rotate with the area indicated.

Unfortunately, linked_portal_door entities can only take up a maximum grid of 2048x2048. You should really only one linked pair at a time if you want to use portals between the 2 areas (due to portal limits).

Avatar
protoborg
288 Posts
Posted Mar 25, 2013
Replied 3 days later
The problem with using the "linked_portal_door" method is that I am already using world portals in the level in question. I really shouldn't use any more of them as I wouldn't want the damn game to crash as I am using 3 WP in the level. Adding two more wouldn't crash the game but why risk it.
Avatar
Naulziator
104 Posts
Posted Mar 29, 2013
Replied 4 days later
I've four WP active in the same spot on an old map once. The only thing it did was deactivate one or two of those portals when you create a pair of portals between these areas with your gun.

If your game is crashing, then one or more of those WP's aren't linked. You should be able to manage 2 WP's in the same room without too big an issue.

Advertisement
Registered users don’t see ads! Register now!
Avatar
protoborg
288 Posts
Posted Mar 30, 2013
Replied 14 hours later
I tried using a trigger_vphysics. I don't think it likes me as it doesn't work. The real issue with using WP's is that they are not of any use when I want to alter the gravity without rotating the room. WP's are best for when you want it to appear that the room is inverted. I am not trying to walk on the ceiling. I only want to make gravity point "up".

Normal Gravity............Altered Gravity
|-------ceiling---------| |-------ceiling---------|
|.......................| |.......................|
|.......................| |.......................|
|.......................| |.......................|
|.......gravity v.......| |.......gravity ^.......|
|.......................| |.......................|
|.......................| |.......................|
|.......................| |.......................|
|____floor______| |____floor______| (ignore the dots)

This will be a triggerable thing. I just don't know how to accomplish this.