Skip to content

Instantly share code, notes, and snippets.

@dumptruckDS
Created January 19, 2019 17:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dumptruckDS/58b5563f7a738364c9e1f98406799faf to your computer and use it in GitHub Desktop.
Save dumptruckDS/58b5563f7a738364c9e1f98406799faf to your computer and use it in GitHub Desktop.
trigger_setgravity troubleshooting
/*
==============================================================================
trigger_setgravity
==============================================================================
*/
float DT_GRAVTOFF = 8; // trigger will start off
void() grav_toggle = //dumptruck_ds based on hipnotic blocker_use
{
if ( !self.state )
{
self.state = 1;
setorigin( self, self.origin - '8000 8000 8000');
}
else
{
self.state = 0;
setorigin( self, self.origin + '8000 8000 8000');
}
};
void() trigger_gravity_touch =
{
// This is commented out so that the changing gravity will
// affect everything, if you don't want to use all affecting
// gravity changes, then uncomment these two lines.
// if (other.classname != "player")
// return;
if (self.gravity == -1)
other.gravity = 1.0;
else
other.gravity = self.gravity;
};
/*QUAKED trigger_setgravity (.5 .5 .5) ?
set the gravity of a player
"gravity" what to set the players gravity to
- 0 (default) normal gravity
- 1 no gravity
- 2 almost no gravity
- 10 is a good setting
- ...
- 101 normal gravity
- 102 slightly higher gravity
- ...
- 1000 very high gravity
*/
void() trigger_setgravity =
{
InitTrigger ();
self.use = grav_toggle; // dumptruck_ds
self.touch = trigger_gravity_touch;
if ( self.spawnflags & DT_GRAVTOFF ) //dumptruck_ds
{
self.state = 0;
setorigin( self, self.origin + '8000 8000 8000' );
}
else
{
self.state = 1;
} //end dumptruck_ds
if (!self.gravity)
self.gravity = -1;
else
self.gravity = ((self.gravity - 1) / 100);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment