Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by EternallyCurious. 04/25/24 10:20
Trading Journey
by howardR. 04/24/24 20:04
M1 Oversampling
by Petra. 04/24/24 10:34
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Scripts not found
by juergen_wue. 04/20/24 18:51
zorro 64bit command line support
by 7th_zorro. 04/20/24 10:06
StartWeek not working as it should
by jcl. 04/20/24 08:38
folder management functions
by VoroneTZ. 04/17/24 06:52
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (EternallyCurious, Quad, vicknick), 700 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Mega_Rod, EternallyCurious, howardR, 11honza11, ccorrea
19048 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 3 of 9 1 2 3 4 5 6 7 8 9
Re: some a6 physics questions #15421
04/27/03 02:04
04/27/03 02:04
Joined: Jun 2002
Posts: 473
Juff Offline
Senior Member
Juff  Offline
Senior Member

Joined: Jun 2002
Posts: 473
thanks for the fast reply! But now I can only shoot one ball, I want to be able to shoot one every 5 seconds
thanks again

Re: some a6 physics questions #15422
04/27/03 02:09
04/27/03 02:09
Joined: May 2002
Posts: 7,441
ventilator Offline OP
Senior Expert
ventilator  Offline OP
Senior Expert

Joined: May 2002
Posts: 7,441
on_mouse_left=null;
sleep(5);
on_mouse_left=emit_sphere;
ent_remove(my);

do you have it that way? i accidentally had the on_mouse_left=emit_sphere; after the ent_remove(my); in the first version...

Re: some a6 physics questions #15423
04/27/03 02:17
04/27/03 02:17
Joined: Jun 2002
Posts: 473
Juff Offline
Senior Member
Juff  Offline
Senior Member

Joined: Jun 2002
Posts: 473
Now I have another problem. I get an error sying that it can't find emit_sphere. I heard that when you call an action or function, it looks above for it, so I moved the emit_sphere function above the sphere action. When I did that I got an error saying it can't find the action sphere. Now what do I do?

Re: some a6 physics questions #15424
04/27/03 02:27
04/27/03 02:27
Joined: May 2002
Posts: 7,441
ventilator Offline OP
Senior Expert
ventilator  Offline OP
Senior Expert

Joined: May 2002
Posts: 7,441
you have to define a prototype of the function.

function emit_sphere(); //prototype of the function

... // other functions...

function emit_sphere() // implementation of the function
{

}

Re: some a6 physics questions #15425
04/27/03 02:30
04/27/03 02:30
Joined: Jun 2002
Posts: 473
Juff Offline
Senior Member
Juff  Offline
Senior Member

Joined: Jun 2002
Posts: 473
sorry, I don't understand what to do [Embarrassed] I can't script ver well, I only know a few basic things

Re: some a6 physics questions #15426
04/27/03 02:33
04/27/03 02:33
Joined: May 2002
Posts: 7,441
ventilator Offline OP
Senior Expert
ventilator  Offline OP
Senior Expert

Joined: May 2002
Posts: 7,441
code:
function emit_sphere();

action sphere
{
my.shadow=on;

phent_settype(my, PH_RIGID, PH_SPHERE);
phent_setmass(my, 5, PH_SPHERE);
phent_setfriction(my, 70);
phent_setelasticity(my, 50, 10);
phent_setdamping(my, 20, 20 );

temp.x=cos(camera.pan)*cos(camera.tilt)*300000;
temp.y=sin(camera.pan)*cos(camera.tilt)*300000;
temp.z=sin(camera.tilt)*300000;
phent_addforcelocal(my,temp,nullvector);

on_mouse_left=null;
sleep(5);
on_mouse_left=emit_sphere;
ent_remove(my);
}

string mdl_sphere=<sphere_0.mdl>;
function emit_sphere()
{
temp.x=camera.x+cos(camera.pan)*cos(camera.tilt)*100;
temp.y=camera.y+sin(camera.pan)*cos(camera.tilt)*100;
temp.z=camera.z+sin(camera.tilt)*100;
ent_create(mdl_sphere,temp,sphere);
}

on_mouse_left=emit_sphere;

i am also not really good in programming. i just do trial and error all the time! [Smile]

Re: some a6 physics questions #15427
04/27/03 02:39
04/27/03 02:39
Joined: Jun 2002
Posts: 473
Juff Offline
Senior Member
Juff  Offline
Senior Member

Joined: Jun 2002
Posts: 473
Oh I get it now, how stupid could I be. Thanks for all of the help, its very appreciated!!

Re: some a6 physics questions #15428
04/27/03 03:08
04/27/03 03:08
Joined: Mar 2003
Posts: 5,377
USofA
fastlane69 Offline
Senior Expert
fastlane69  Offline
Senior Expert

Joined: Mar 2003
Posts: 5,377
USofA
<<Smack!!>>

Thanks Vent!

It's mostly all there in the setmass routine, duh! A little bit of testing should answer any remaining questions I suppose.
[Embarrassed]

Amazing, simply amazing. Full translational AND rotational physics engine.

G**damn sweet!

Re: some a6 physics questions #15429
04/27/03 03:15
04/27/03 03:15
Joined: Mar 2002
Posts: 1,774
Magdeburg
F
FlorianP Offline
Serious User
FlorianP  Offline
Serious User
F

Joined: Mar 2002
Posts: 1,774
Magdeburg


I <3 LINQ
Re: some a6 physics questions #15430
04/27/03 04:24
04/27/03 04:24
Joined: May 2002
Posts: 7,441
ventilator Offline OP
Senior Expert
ventilator  Offline OP
Senior Expert

Joined: May 2002
Posts: 7,441
code:
var FR_wheel_ID;
var FL_wheel_ID;
var RL_wheel_ID;
var RR_wheel_ID;

action FR_tyre
{
my.shadow=on;

phent_settype(my, PH_RIGID, PH_SPHERE);
phent_setgroup(my,2);
phent_setmass(my, 5, PH_SPHERE);
phent_setfriction(my, 70);
phent_setelasticity(my, 50, 10);
phent_setdamping(my, 20, 20 );

FR_wheel_ID=phcon_add(PH_WHEEL,my,p_player);
phcon_setparams1(FR_wheel_ID, my.x, vector(0,0,1),vector(0,1,0));
phcon_setparams2(FR_wheel_ID, vector(35,-35,0),vector(-360,360,0),vector(0.9,0.001,0));
}

action FL_tyre
{
my.shadow=on;
my.pan=180;

phent_settype(my, PH_RIGID, PH_SPHERE);
phent_setgroup(my,2);
phent_setmass(my, 5, PH_SPHERE);
phent_setfriction(my, 70);
phent_setelasticity(my, 50, 10);
phent_setdamping(my, 20, 20 );

FL_wheel_ID=phcon_add(PH_WHEEL,my,p_player);
phcon_setparams1(FL_wheel_ID, my.x, vector(0,0,1),vector(0,1,0));
phcon_setparams2(FL_wheel_ID, vector(35,-35,0),vector(-360,360,0),vector(0.9,0.001,0));
}

action RL_tyre
{
my.shadow=on;
my.pan=180;

phent_settype(my, PH_RIGID, PH_SPHERE);
phent_setgroup(my,2);
phent_setmass(my, 5, PH_SPHERE);
phent_setfriction(my, 70);
phent_setelasticity(my, 50, 10);
phent_setdamping(my, 20, 20 );

RL_wheel_ID=phcon_add(PH_WHEEL,my,p_player);
phcon_setparams1(RL_wheel_ID, my.x, vector(0,0,1),vector(0,1,0));
phcon_setparams2(RL_wheel_ID, vector(0,0,0),vector(-360,360,0),vector(0.9,0.001,0));
}

action RR_tyre
{
my.shadow=on;

phent_settype(my, PH_RIGID, PH_SPHERE);
phent_setgroup(my,2);
phent_setmass(my, 5, PH_SPHERE);
phent_setfriction(my, 70);
phent_setelasticity(my, 50, 10);
phent_setdamping(my, 20, 20 );

RR_wheel_ID=phcon_add(PH_WHEEL,my,p_player);
phcon_setparams1(RR_wheel_ID, my.x, vector(0,0,1),vector(0,1,0));
phcon_setparams2(RR_wheel_ID, vector(0,0,0),vector(-360,360,0),vector(0.9,0.001,0));
}

action car
{
p_player=my;
wait(1);
my.shadow=on;
my.material=mat_metal;

phent_settype(my,PH_RIGID,PH_BOX);
phent_setgroup(my,2);
phent_setmass(my,40,PH_BOX);
phent_setfriction(my,50);
phent_setelasticity(my,50,10);
phent_setdamping(my,20,20);

vec_for_vertex(temp,my,306);
ent_create(mdl_tyre,temp,FR_tyre);

vec_for_vertex(temp,my,36);
ent_create(mdl_tyre,temp,FL_tyre);

vec_for_vertex(temp,my,5);
ent_create(mdl_tyre,temp,RL_tyre);

vec_for_vertex(temp,my,304);
ent_create(mdl_tyre,temp,RR_tyre);
}

why does my car explode when this code runs? first i create the car and the car creates it's tyres then. after reading the manual i came to the conclusion that this would be the way to do it...

and what do the spring damper constants exactly do?

Page 3 of 9 1 2 3 4 5 6 7 8 9

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