Gamestudio Links
Zorro Links
Newest Posts
Newbie Questions
by fairtrader. 12/06/23 11:29
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
Combine USD & BTC Pairs In Asset Loop
by TipmyPip. 11/26/23 08:30
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
7 registered members (3run, miwok, AndrewAMD, Quad, TipmyPip, fairtrader, 1 invisible), 637 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 3 1 2 3
First tutorial by William #77367
06/12/06 09:48
06/12/06 09:48
Joined: Mar 2006
Posts: 724
the Netherlands
Frits Offline OP
User
Frits  Offline 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] #77368
06/12/06 09:58
06/12/06 09:58
Joined: Aug 2005
Posts: 1,558
HK
V
vlau Offline
Serious User
vlau  Offline
Serious User
V

Joined: Aug 2005
Posts: 1,558
HK
"remove" has been removed in A6.40.5
use ent_remove instead.

Re: First tutorial by William [Re: vlau] #77369
06/12/06 11:59
06/12/06 11:59
Joined: Mar 2006
Posts: 724
the Netherlands
Frits Offline OP
User
Frits  Offline OP
User

Joined: Mar 2006
Posts: 724
the Netherlands
Thanks.

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 Offline OP
User
Frits  Offline 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: Frits] #77371
06/12/06 13:02
06/12/06 13:02
Joined: Aug 2005
Posts: 1,558
HK
V
vlau Offline
Serious User
vlau  Offline
Serious User
V

Joined: Aug 2005
Posts: 1,558
HK
I have't test the code you posted, but
try to adjust the earthgravity may be
set it to vector(0,0,0) will help.

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 Offline OP
User
Frits  Offline 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 Offline
Expert
FoxHound  Offline
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: FoxHound] #77374
06/12/06 15:11
06/12/06 15:11
Joined: Aug 2005
Posts: 1,558
HK
V
vlau Offline
Serious User
vlau  Offline
Serious User
V

Joined: Aug 2005
Posts: 1,558
HK
By adjust the gravity value should
help, try positive value or set it
to 0,0,0.

You may also change :

phent_settype(me,PH_RIGID,PH_poly);

to

phent_settype(me,PH_RIGID,PH_BOX);

I have experience that PH_BOX is better
than PH_POLY in physic collision detection.

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 Offline
Expert
FoxHound  Offline
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!
Re: First tutorial by William [Re: FoxHound] #77376
06/12/06 15:47
06/12/06 15:47
Joined: Aug 2005
Posts: 1,558
HK
V
vlau Offline
Serious User
vlau  Offline
Serious User
V

Joined: Aug 2005
Posts: 1,558
HK
Haven't test PH_POLY with A6.40.5 yet but
PH_BOX is better than PH_POLY in A6.31.4
for sure.

Page 1 of 3 1 2 3

Moderated by  HeelX, Spirit 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1