|
7 registered members (3run, miwok, AndrewAMD, Quad, TipmyPip, fairtrader, 1 invisible),
637
guests, and 2
spiders. |
|
Key:
Admin,
Global Mod,
Mod
|
|
|
First tutorial by William
#77367
06/12/06 09:48
06/12/06 09:48
|
Joined: Mar 2006
Posts: 724 the Netherlands
Frits
OP
User
|
OP
User
Joined: Mar 2006
Posts: 724
the Netherlands
|
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);} 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
I like to keep scripting simple, life is hard enough as it is. Regards, Frits
|
|
|
Re: First tutorial by William
[Re: Frits]
#77370
06/12/06 12:55
06/12/06 12:55
|
Joined: Mar 2006
Posts: 724 the Netherlands
Frits
OP
User
|
OP
User
Joined: Mar 2006
Posts: 724
the Netherlands
|
It works fine now, but how do prevent that the boulder is slowly sinking in the floor and disappears?
Regards, Frits
I like to keep scripting simple, life is hard enough as it is. Regards, Frits
|
|
|
Re: First tutorial by William
[Re: vlau]
#77372
06/12/06 14:16
06/12/06 14:16
|
Joined: Mar 2006
Posts: 724 the Netherlands
Frits
OP
User
|
OP
User
Joined: Mar 2006
Posts: 724
the Netherlands
|
No gravity will ofcourse not help, the object is floting.
When the object comes to an halt on the floor it is supposed to stay there, not sinking through the floor. How can make that happen?
I can unregister the object with phent_settype(me.0,0), but when do I do that? How do you know when the object is halted?
Regards, Frits
I like to keep scripting simple, life is hard enough as it is. Regards, Frits
|
|
|
Re: First tutorial by William
[Re: Frits]
#77373
06/12/06 14:34
06/12/06 14:34
|
Joined: Jun 2004
Posts: 2,234 Wisconsin USA
FoxHound
Expert
|
Expert
Joined: Jun 2004
Posts: 2,234
Wisconsin USA
|
Ugghhh, ugly code! my eyes!
temp.x=camera.x; temp.y=camera.y; temp.z=camera.z; //becomes vec_set(temp.x,camera.x);
edit, i may have your problem and i'm wondering How is your code even working?
phent_setmass(me,PH_BOX); //should be phent_setmass(my, 100, PH_BOX);
Last edited by FoxHound; 06/12/06 14:54.
--------------------- There is no signature here.
QUIT LOOKING FOR ONE!
|
|
|
Re: First tutorial by William
[Re: vlau]
#77375
06/12/06 15:38
06/12/06 15:38
|
Joined: Jun 2004
Posts: 2,234 Wisconsin USA
FoxHound
Expert
|
Expert
Joined: Jun 2004
Posts: 2,234
Wisconsin USA
|
I thought PH_poly was unstable and best not to use, or did that change with 6.4?
--------------------- There is no signature here.
QUIT LOOKING FOR ONE!
|
|
|
|