|
7 registered members (3run, miwok, AndrewAMD, Quad, TipmyPip, fairtrader, 1 invisible),
637
guests, and 2
spiders. |
|
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: First tutorial by William
[Re: vlau]
#77378
06/15/06 09:36
06/15/06 09:36
|
Joined: Mar 2006
Posts: 724 the Netherlands
Frits
OP
User
|
OP
User
Joined: Mar 2006
Posts: 724
the Netherlands
|
@FoxHound, @William; Yes, there was a 3 in the original code 'phent_setmass(my, 3, PH_BOX);' I forgot to write in in the post. @vlau; like I mentioned before; gravity value of 0, the stone keeps floating. Positive gravity, the stone goes up. I have changed PH_POLY in PH_BOX, now the rock does not sink in the floor anymore but it will not roll nicely.
Regards, Frits
I like to keep scripting simple, life is hard enough as it is. Regards, Frits
|
|
|
Re: First tutorial by William
[Re: Frits]
#77379
06/15/06 09:45
06/15/06 09:45
|
Joined: Apr 2005
Posts: 2,332 Germany, BaWü
aztec

Expert
|

Expert
Joined: Apr 2005
Posts: 2,332
Germany, BaWü
|
Quote:
When I try this; Code:
var earthgravity[3]=0,0,-300; entity* boulderm;
string boulder=<fels1_0.mdl>;
function emit_sphere();
action boulder_move { boulderm=me; my.shadow=on; phent_settype(me,PH_RIGID,PH_poly); ph_setgravity(earthgravity); phent_setmass(me,PH_BOX); phent_setfriction(me,70); phent_setelasticity(me,30,10); }
function emit_sphere() { if(boulderm!=null) {remove(boulderm);}// remove this bracket { temp.x=camera.x; temp.y=camera.y; temp.z=camera.z; ent_create(boulder,temp,boulder_move); } }
on_mouse_middle=emit_sphere;
I get an error; Syntax error - non existent/empty function remove
When I change place; fist function then action, I get also an error; Parameter unknown boulder_move.
I don't understand this, what goes wrong here?
Regards, Frits
try tzhis and tell me if it works 
Visit: schwenkschuster-design.de
|
|
|
Re: First tutorial by William
[Re: William]
#77382
06/15/06 12:46
06/15/06 12:46
|
Joined: Mar 2006
Posts: 724 the Netherlands
Frits
OP
User
|
OP
User
Joined: Mar 2006
Posts: 724
the Netherlands
|
@Star Fox The code woks, follow the posts. @vlau, William I have tried that, the rock keeps rolling a veeeeerry long time.
The only question that remain; why sinks the rock slowly into the floor when I use PH_POLY?
Regards, Frits
I like to keep scripting simple, life is hard enough as it is. Regards, Frits
|
|
|
Re: First tutorial by William
[Re: Frits]
#77383
07/04/06 10:31
07/04/06 10:31
|
Joined: Sep 2002
Posts: 8,177 Netherlands
PHeMoX
Senior Expert
|
Senior Expert
Joined: Sep 2002
Posts: 8,177
Netherlands
|
I'm having similar difficulties with the physics, but I can show you my code. I think it's really a matter of finding the right values.. Code:
action crate { //phent_enable( my, 1 ); phent_settype( me, PH_RIGID, PH_BOX); phent_setmass(my, 10, PH_SPHERE); phent_setdamping(me,40,50); phent_setfriction(my, 25); phent_setmaxspeed( my, 300, 300); ph_setcontacts(vector(80000, 0,0), 0,0,0); ph_setautodisable(0.01, 0.008, 10, 0.1); wait(1); }
I haven't really find out though, why my AI enemies can move the crates like it should, but the player can't move them that easily, mostly the player bumps into the crate and get's stuck. Sort off.. Cheers
|
|
|
Re: First tutorial by William
[Re: PHeMoX]
#77384
07/05/06 02:50
07/05/06 02:50
|
Joined: Aug 2001
Posts: 2,320 Alberta, Canada
William
Expert
|
Expert
Joined: Aug 2001
Posts: 2,320
Alberta, Canada
|
If your moving your player using c_move(), it wont interact with the physics entities, and will become stuck. In this case you'll have to use a scan or trigger, and when the physics entity gets within range, put a force on it(according to the angle of it and the player). It's also unfortunate that you cannot have physics entities passable unto certain normal entities. So you'll still "catch" onto the physics entities at times. For this reason, among others, I wouldn't reccomend having the physics engine play a big part in your game. Though mabye you'll be allright if your main character moves a bit slower, for very fast moving entities(in a racing game) you can catch things easier. 
|
|
|
|