How T2 Gravity Works?

How does T2 gravity work? I know you can edit it in server.cs with $Classic::gravsetting (or whatever you have if edited apart from classic) and about getGravity() and setGravity(), but what is the force that's used? Is there anyway to apply gravity(or a gravity-like force) in different directions or with a single specific group?

Comments

  • You can make gravity go up by setting it negative, but I don't think you can change it to a non-vertical direction out-right. You could probably simulate gravity at an angle using a bunch of %obj.applyImpulse() commands at specified intervals, but there might be a better way.
  • Thanks for your input! Although I've already considered making the gravity go "up" but that's a universal effect so to say, and isn't exactly what I want. If I go with the applyImpluse suggestion is there anyway to rotate the players' shape to correspond with the force pulling the player?
  • sadly, no.
    Players only rotate about their z-axis.
    You might be able to simulate other rotations by mounting them to an object, but I'm not sure if animations would continue playing properly (i.e. walking/jumping)
  • So, I could mount the player into a vehicle, say a gravcycle, and could manipulate it in multiple ways? What I was planning to do was have the object enter a trigger, then it would be rotated and a force applied to push the object down onto the pad or whatever was there. I was thinking of making a race map that had this with loops and twists. :)
  • Indeed, players only rotate about the Z axis. I guess Dynamix didn't want to induce the vertigo that comes with 6 degrees of freedom.

    If you want to manipulate gravity, your best bet is to use non-solid forcefield physical zones that change gravity, and keep them centered around the objects you want to have different gravity. You can orient the field in any direction.

    If you want 6 degrees of freedom for orientation, you could use vehicle objects as the standard client control objects (there's no technical reason why you have to use "Player" objects for players).

    It all depends on what you want to do.
  • Wow...never thought of that, but won't that make the vehicle go 'boom?' I've been looking for the reason, but the vehicles always explode when flipped. Is this associated to the gravity? If so then will that even be a concern?
  • Vehicles explode when flipped because the engine (funnily enough) goes through script to apply 10000 $DamageType::Crash damage (I believe). It does something similar when the MPB touches water; it applies 10000 $DamageType::Water damage. Setting your vehicle datablock properties to ignore these damage types will allow vehicles to fly upside down and MPBs to drive underwater.
  • Do you have any clue as to where that is specified? I've looked everywhere I can think of, but haven't found anything that will stop it from exploding.
  • It's in the game engine itself, only clue I had was when I looked through Torque Game Engine source.
  • Well dang, thanks though.
  • one big azz grav. field :P
Sign In or Register to comment.