Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (Akow, AndrewAMD, degenerate_762), 1,429 guests, and 11 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19055 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Gravity by using the physics #163603
10/26/07 19:34
10/26/07 19:34
Joined: Aug 2006
Posts: 96
Netherlands
P
Polypfreak1987 Offline OP
Junior Member
Polypfreak1987  Offline OP
Junior Member
P

Joined: Aug 2006
Posts: 96
Netherlands
I am trying to have an entity with a gravity by using the Physics engine. But it don't work.

The entity is like a pendelum. It rotates around a certain point, but normaly it uses the gravity to swing. I have this code now, but I don't know if I am doing this right.

Code:

phent_settype(my,PH_RIGID,PH_BOX);
phent_setmass(my,50,PH_SPHERE);
phent_setdamping(my,100,100);
phent_setgroup(my,1);
ph_setgravity(earthGravity);
ph_selectgroup(1);



The var earthGravity is defined in the script. And this script is into the action of the entity.

I hope you can help me, because I still don't understand how to script gravity...

Re: Gravity by using the physics [Re: Polypfreak1987] #163604
10/26/07 21:06
10/26/07 21:06
Joined: Jan 2007
Posts: 1,619
Germany
Scorpion Offline
Serious User
Scorpion  Offline
Serious User

Joined: Jan 2007
Posts: 1,619
Germany
you shouldn't put ph_setgravity into an action, better in your main function etc...
then it would be good, if phent_settype and phent_setmass have the same hulltype.
I donno for what you are using it, but if you phent_Setdamping is 100 it don't move is not a force applied.

Make sure earthgravity is something as var earthgravity[3] = 0,0, -386;

Re: Gravity by using the physics [Re: Scorpion] #163605
10/27/07 05:59
10/27/07 05:59
Joined: Aug 2006
Posts: 96
Netherlands
P
Polypfreak1987 Offline OP
Junior Member
Polypfreak1987  Offline OP
Junior Member
P

Joined: Aug 2006
Posts: 96
Netherlands
Quote:

you shouldn't put ph_setgravity into an action, better in your main function etc...
then it would be good, if phent_settype and phent_setmass have the same hulltype.
I donno for what you are using it, but if you phent_Setdamping is 100 it don't move is not a force applied.

Make sure earthgravity is something as var earthgravity[3] = 0,0, -386;




Sorry this didn't work. This is the code that I want to use for the gravity.
Code:

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

function main()
{
level_load(level_str);
ph_setgravity(earthGravity);
}

action gondel1 {
my.passable = on;
my.scale_x = 0.35;
my.scale_y = 0.35;
my.scale_z = 0.335;

phent_settype(my,PH_RIGID,PH_SPHERE);
phent_setmass(my,50,PH_SPHERE);
//phent_setdamping(my,0,0);
phent_setgroup(my,1);
ph_selectgroup(1);

while(my) {
vec_for_vertex(temp,molen,1374);
my.x = temp.x;
my.y = temp.y;
my.z = temp.z;
my.pan = molen.pan+45;

/*my.skill15 = max(my.skill15,-60);
my.skill15 = min(my.skill15,0);

if(key_w == 1)
{
my.skill15 -= 0.2*time_step;
}
if(key_s == 1)
{
my.skill15 += 0.35*time_step;
}

ent_animate(my,NULL,0,0);
ent_bonerotate(my,"gondel_rood_axis",vector(0,0,my.skill15));*/

wait(1);
}
}



Now I use a bone animation to simulate the gravity, but it is not a natural movement. So I want to do a natural movement of the entity.

In fact, I am making a wave swinger and this action is for one of the gondela's. So it needs to swing out by the G-forces.


Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

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