Urban Wars
April 19, 2024, 05:28:37 pm
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Welcome, here you will find all the information on Urban Wars
 
  Home Help Search Staff List Login Register  

is there a ragdoll effect for quake?

Pages: [1]
  Print  
Author Topic: is there a ragdoll effect for quake?  (Read 604 times)
DukeInstinct
Administrator
Lieutenant
*****
Posts: 120


The ArchDuke


View Profile WWW
« on: April 25, 2010, 12:19:32 am »

I'd use the touch function to set the brush's velocity to the velocity of the player that touched it and set the brush's think function to dampen it's velocity gradually so it slides to a halt due to friction or air resistance once there is no longer a player pushing the brush.

Code:
void() ragdoll_think =
{
if (self.velocity_x==0.0||self.velocity_y==0.0||self.velocity_z==0.0) return;

self.velocity*=0.9;
if (vsize(self.velocity)<=10) self.velocity='0 0 0';

self.nextthink=time+0.04;
}

void() ragdoll_touch =
{
self.velocity=other.velocity;

self.think=ragdoll_think;
self.nextthink=time+0.04;
};



Code:
self.velocity*=0.9;
if (vsize(self.velocity)<=10)

You should try a couple different values for those two lines to get the exact effect you want.
Report Spam   Logged



Urban Wars Coder/3d Modeler/Animator



Pages: [1]
  Print  
 
Jump to:  


Get your own Chat Box! Go Large!
Bookmark this site! | Upgrade This Forum
SMF For Free - Create your own Forum

Powered by SMF | SMF © 2016, Simple Machines
Privacy Policy