Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (Ayumi), 662 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Can't get physics to work! #22959
02/05/04 07:12
02/05/04 07:12
Joined: Dec 2003
Posts: 22
Sweden
A
anrkies Offline OP
Newbie
anrkies  Offline OP
Newbie
A

Joined: Dec 2003
Posts: 22
Sweden
I have tried almost every way of making the physics to work. But I don't get what’s wrong. I have made a ball and attached a action to it:

var earthgravity[3] = 0,0, -386;

action phys
{
phent_enable(my, 1);
ph_setgravity(earthgravity);
phent_settype(my, PH_RIGID, PH_ball);
}

When I run this script I get an error message that says that none of the ph: s in the action exists. So I wonder if I must include some file or perhaps start the physics engine to work. Please help!

\\Niklas

Re: Can't get physics to work! [Re: anrkies] #22960
02/05/04 07:23
02/05/04 07:23
Joined: Sep 2003
Posts: 50
ScriptMaster Offline
Junior Member
ScriptMaster  Offline
Junior Member

Joined: Sep 2003
Posts: 50
Just a guess but you wouldn't happen to be using A5 or an edition less than pro or com would you?

Re: Can't get physics to work! [Re: ScriptMaster] #22961
02/05/04 08:00
02/05/04 08:00
Joined: Oct 2003
Posts: 1,258
Virginia, USA
qwerty823 Offline
Senior Developer
qwerty823  Offline
Senior Developer

Joined: Oct 2003
Posts: 1,258
Virginia, USA
or using the demo version, which is Extra, I believe.


Never argue with an idiot. They drag you down to their level then beat you with experience
Re: Can't get physics to work! [Re: anrkies] #22962
02/05/04 11:47
02/05/04 11:47
Joined: Sep 2003
Posts: 3,236
San Diego, CA
M
Marco_Grubert Offline
Expert
Marco_Grubert  Offline
Expert
M

Joined: Sep 2003
Posts: 3,236
San Diego, CA
First call phent_settype(), then call phent_enable().

Re: Can't get physics to work! [Re: anrkies] #22963
02/05/04 15:31
02/05/04 15:31
Joined: Nov 2003
Posts: 19
iprogramgames Offline
Newbie
iprogramgames  Offline
Newbie

Joined: Nov 2003
Posts: 19
Here is your altered code which I have verified works:

action phys
{
var earthGravity[3];// = 0,0, -386;

earthGravity[0] = 0;
earthGravity[1]=0;
earthGravity[2]=-386;

phent_settype(my, PH_RIGID, PH_ball);
ph_setgravity(earthgravity);
}

Here is some code to make the entity act more like a ball.

action physicsBall
{
var earthGravity[3];// = 0,0, -386;

earthGravity[0] = 0;
earthGravity[1]=0;
earthGravity[2]=-386;

phent_settype(me, PH_RIGID, PH_SPHERE);
phent_setfriction (me,100);
phent_setelasticity ( me, 50, 0 );
ph_setgravity( earthgravity );
}

Notice I have made the variable earthGravity a local variable. You may wish to make it global but this allows you to simply cut and paste the code.


Newbie... yeah, right.
Re: Can't get physics to work! [Re: iprogramgames] #22964
02/05/04 21:49
02/05/04 21:49
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
If you own A6 Com/Pro, then your only mistake was that you forgot to set its mass (if its mass is zero, it won't fall down).

phent_setmass ( me, 30, PH_BALL); // 30 kg

Darth Felix


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: Can't get physics to work! [Re: iprogramgames] #22965
02/06/04 04:51
02/06/04 04:51
Joined: Dec 2003
Posts: 22
Sweden
A
anrkies Offline OP
Newbie
anrkies  Offline OP
Newbie
A

Joined: Dec 2003
Posts: 22
Sweden
I'm using A5 pro edition right now. And I will try this script as soon as I come to my other home. Where I have A5 installed.

Re: Can't get physics to work! [Re: anrkies] #22966
02/06/04 05:09
02/06/04 05:09
Joined: Sep 2003
Posts: 50
ScriptMaster Offline
Junior Member
ScriptMaster  Offline
Junior Member

Joined: Sep 2003
Posts: 50
Here's you problem then A5 Pro doesn't support Physics, Only A6 Pro or Com does.

Re: Can't get physics to work! [Re: ScriptMaster] #22967
02/06/04 21:46
02/06/04 21:46
Joined: Dec 2003
Posts: 22
Sweden
A
anrkies Offline OP
Newbie
anrkies  Offline OP
Newbie
A

Joined: Dec 2003
Posts: 22
Sweden
Ok I will have to upgrade then. Thanks for your help!


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