Object that interacts with player! commercial*

Posted By: Toon

Object that interacts with player! commercial* - 09/10/06 02:17

I need a physics object that interacts with a nonephysic player...i have commercial editon so i can only have 1 physics object registered at once..can someone help me? tnx for reading
Posted By: demiGod

Re: Object that interacts with player! commercial* - 09/10/06 13:32

Be more especific, what kind of object do you want to interact with the player? A ball, a car? What?
Posted By: Toon

Re: Object that interacts with player! commercial* - 09/10/06 19:57

well...a box like in halflife2 just when the player collides with it..it moves in a realistic way. no things like pick it up with key_e and throwing it (gravitygun) but just a nice physicaction to make the box look like a real box when it collides with the player and maybe other entitys..i can only use 1 registered physicsobject at the time..i have commercial.
Posted By: Toon

Re: Object that interacts with player! commercial* - 09/14/06 07:09

Anyone?
Posted By: TheStonerunner

Re: Object that interacts with player! commercial* - 09/14/06 07:44

Physics questions seem to be the most difficult to answer here. I have a problem just about as simple (and probably, the code that would solve one of our problems would solve both), and I've been researching for a while to no avail. I've downgraded my A6 Commercial to 6.11 (I think), since that's what Newton works with. I would check out Newton Game Dynamics, see if it can do what you want.
Posted By: Helghast

Re: Object that interacts with player! commercial* - 09/14/06 07:47

untested, give it a try:

Code:
 
var earth_gravity[3] = 0,0, -986;
entity* pe_box;

function physics_ent
{
pe_box = me;
phent_settype(my, PH_RIGID, PH_BOX);
ph_setgravity ( earth_gravity );
phent_setmass(my, 5, PH_BOX);
phent_setfriction(my, 100);
phent_setelasticity(my, 50, 10);
phent_setdamping( my, 10, 10 );
}

function remove_objects
{
phent_settype(pe_box, 0,0);
}

function impact_pe
{
if(event_type == event_impact)
{
remove_objects();
physics_ent();
}
}

action init_box
{
my.enable_impact = on;
my.event = impact_pe;
}



as i said, didnt test it yet, gotta run to school, i'll try later if it doesnt work somehow.

regards,
© 2023 lite-C Forums