Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
1 registered members (TipmyPip), 18,633 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
question from ode ! #218741
07/30/08 09:28
07/30/08 09:28
Joined: Jan 2007
Posts: 3
A
arashdj71 Offline OP
Guest
arashdj71  Offline OP
Guest
A

Joined: Jan 2007
Posts: 3
hi i'm arash
i'm from turkey and can't speaking engilesh well.
i have a script:

var video_mode=7;
var video_depth=32;
var video_screen =1;
var video_gamma=10;
var earthgravity[3] = 0,0, -386;
var earthgravity1[3]=0,0,0;
ENTITY* mycrate;
///////////////////////////////////////////
action ball{
my.ENABLE_IMPACT = ON;
phent_settype(my,Ph_Rigid,PH_SPHERE);
phent_setmass(my,100,PH_SPHERE);
ph_setgravity(earthgravity);
sleep(1);
}
///////////////////////////////////////////
action plane{
my.ENABLE_IMPACT = ON;
my.invisible=on;
mycrate=me;
phent_settype( myCrate,PH_RIGID,PH_BOX);
phent_setmass(my,0,PH_box);
}
///////////////////////////////////////////
font arial_font = "Arial", 1, 18; // true type, Arial, bold, size = 18
PANEL aircraft_pan
{
pos_x =4;
pos_y =4;
digits=0,0,2,arial_font, 1,sys_hours);
digits=20,0,2,arial_font, 1,sys_minutes);
digits=40,0,2,arial_font, 1,sys_seconds);
digits=750,0,5,arial_font,1,time_physics;
flags =VISIBLE;
}
//////////////////////////////////////

function main()
{
level_load("ball_level.wmb");
wait(1);
/////CAMERA/////
fps_max=50;
while (1)
{
mouse_pos.x = pointer.x;
mouse_pos.y = pointer.y;
camera.pan -= mouse_force.x;
camera.tilt += mouse_force.y;
wait(1);
}
}
/////////////////////////////////////

but this is don't working!
my boxies in this picture can;t move and stoped in air!
thank you!

Re: question from ode ! [Re: arashdj71] #218778
07/30/08 15:05
07/30/08 15:05
Joined: Mar 2006
Posts: 2,503
SC, United States
xXxGuitar511 Offline
Expert
xXxGuitar511  Offline
Expert

Joined: Mar 2006
Posts: 2,503
SC, United States
ph_setgravity(earthgravity)
- is a global instruction. It only needs to be called once

action plane{}
- 3DGS ODE physics respond to non-physics entities as well, so this is not necessary.

ph_setautodisable()
- Another global function. Your entities are automatically disabled when the game begins, because ODE assumes their in a "safe place". This helps the game load without needing to do collision checks for every entity.

phent_addvelcentral(my, vector(0,0,1));
- Put this at the end of your Ball() function. It will add a very small velocity to your object, so that physics are enabled at start.


xXxGuitar511
- Programmer

Moderated by  HeelX, Spirit 

Gamestudio download | 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