Urban Wars
December 11, 2018, 02:46:26 am
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 89 times)
Mexicouger
Lieutenant
*
Posts: 111


View Profile
« on: April 24, 2010, 09:25:27 pm »

Can I tie a ragdoll effect to a brush? say i make an 8 side cylinder in worldcraft, can I code in a function an dti eit to the brush so th eplayer can move it and rockets can blow it away? can you shoow me a code? is it hard to add?
Report Spam   Logged

DukeInstinct
Administrator
Lieutenant
*****
Posts: 120


The ArchDuke


View Profile WWW
« Reply #1 on: April 24, 2010, 09:37:44 pm »

Through qc. No.

Through the engine. Possibly but I have no clue how you'd program that in.
Report Spam   Logged



Urban Wars Coder/3d Modeler/Animator

Mexicouger
Lieutenant
*
Posts: 111


View Profile
« Reply #2 on: April 24, 2010, 11:12:21 pm »

How about in the qc, just being able to walk up to  abrush and move it. I remember seeing a tutorial on inside 3d about movable gib. that is what i`d like to do. basically have something that can be moved by being walked into. is that possible?
Report Spam   Logged
DukeInstinct
Administrator
Lieutenant
*****
Posts: 120


The ArchDuke


View Profile WWW
« Reply #3 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

Mexicouger
Lieutenant
*
Posts: 111


View Profile
« Reply #4 on: April 26, 2010, 07:29:17 am »

2 things: where do I find the player speed and thins is for my fusion coil halo. can i make the coil rotate and fall over also?
Report Spam   Logged
Mexicouger
Lieutenant
*
Posts: 111


View Profile
« Reply #5 on: April 26, 2010, 07:48:16 am »

Also, the compiler doesnt know what vsize is and I have no clue what it is... so I can`t test....
Report Spam   Logged
Mexicouger
Lieutenant
*
Posts: 111


View Profile
« Reply #6 on: April 26, 2010, 08:44:41 am »

Can you declare vsize. And where do i add thi sthink function? Do i add this code to misc_fcoil        self.touch = ragdoll_touch;  ?
Report Spam   Logged
Mexicouger
Lieutenant
*
Posts: 111


View Profile
« Reply #7 on: April 26, 2010, 01:01:56 pm »

Please answer me on this 1. I would love to have a somewat ragdoll effect! we are so close too. I mean, half lif epsp had it. you could move the chairs.
Report Spam   Logged
DukeInstinct
Administrator
Lieutenant
*****
Posts: 120


The ArchDuke


View Profile WWW
« Reply #8 on: April 26, 2010, 06:25:27 pm »

Oh sorry, I meant vlen.

vsize is UnrealScript's equivalent function.


And yes do assign self.touch to ragdoll_touch. And change those || to && in the first if statement of ragdoll_think. I don't know why I made them || at first.

Making it rotate is easy, but making it rotate in the direction you're moving is tricky. I'll have to think about that one.
« Last Edit: April 26, 2010, 09:44:11 pm by DukeInstinct » Report Spam   Logged



Urban Wars Coder/3d Modeler/Animator

Mexicouger
Lieutenant
*
Posts: 111


View Profile
« Reply #9 on: April 26, 2010, 07:38:10 pm »

for one, I wasn`t able to move the fusion coil. Is there a certain movetype I need to attacth to this touch function?     Ok, so in void()misc_fcoil ( my func), I added a line called self.touch = ragdoll touch;   Am I supposed to do that? Is there a certain movetype I nee dto put in fcoil? My current movetype is MOVETYPE_BOUNCE. Should I change it to slidebox or bbox or does it matter. And when it compiled it said       in function ragdoll_think (line 198)     misc.qc:204: error: type mismatch for *= (pointer and float)  How do I make this work. And thanks for working with me Duke.
Report Spam   Logged
DukeInstinct
Administrator
Lieutenant
*****
Posts: 120


The ArchDuke


View Profile WWW
« Reply #10 on: April 26, 2010, 09:51:53 pm »

What are you currently using for its solid property? I'd try using Slidebox. Movetypes Toss or Bounce should work.

The error must be talking about "self.velocity*=0.9;". Try changing "self.velocity*=0.9" to "self.velocity_x*=0.9; self.velocity_y*=0.9; self.velocity_z*=0.9;"

The only confusing part about that error is it says pointer and float when it's really a vector and a float. I thought the only pointers in QC were entities.
Report Spam   Logged



Urban Wars Coder/3d Modeler/Animator

Mexicouger
Lieutenant
*
Posts: 111


View Profile
« Reply #11 on: April 26, 2010, 11:26:43 pm »

That code ran flawlessly. I stuck a .touch function on the fusion coil, I changed the movetype to movetype bounce, and i made the solid slidebox. Even with all that, The coils still wouldn`t move at all
Report Spam   Logged
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 | Buy traffic for your forum/website

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