|
Non-physics entity to physics entity ?
#59063
11/16/05 07:51
11/16/05 07:51
|
Joined: Sep 2004
Posts: 260 UB,Mongolia
Olzii
OP
Member
|
OP
Member
Joined: Sep 2004
Posts: 260
UB,Mongolia
|
Hi all,
I am making a simulation game. How to make ambient vehicle switches from using a partially simulated physics model (or non physics entity) to a fully simulated physics model ?
Did anyone try it before ? Please help me, if you have some tutorials or important links?
Olzii
The Empire of the Mongols comprised the largest continuous land empire ever, reaching from Korea to Poland
|
|
|
Re: Non-physics entity to physics entity ?
[Re: Helghast]
#59065
11/16/05 07:59
11/16/05 07:59
|
Joined: Sep 2004
Posts: 260 UB,Mongolia
Olzii
OP
Member
|
OP
Member
Joined: Sep 2004
Posts: 260
UB,Mongolia
|
Hi dennis,
You said me before you have did it. Please make some tutorials, a lot of people will appreciate it.
Olzii
The Empire of the Mongols comprised the largest continuous land empire ever, reaching from Korea to Poland
|
|
|
Re: Non-physics entity to physics entity ?
[Re: Olzii]
#59066
11/16/05 08:03
11/16/05 08:03
|
Joined: Jan 2004
Posts: 3,023 The Netherlands
Helghast
Expert
|
Expert
Joined: Jan 2004
Posts: 3,023
The Netherlands
|
dont really have the time right now *not now, and not soon either* schools very busy for me, and i got my own projects running.. i once made a tutorial and nobody as far as i heard really made use of it, so it seems i aint good on that part as well, i'll leave that to the pro's i'll just help people out when asked for regards,
|
|
|
Re: Non-physics entity to physics entity ?
[Re: Olzii]
#59067
11/16/05 08:03
11/16/05 08:03
|
Joined: Sep 2004
Posts: 260 UB,Mongolia
Olzii
OP
Member
|
OP
Member
Joined: Sep 2004
Posts: 260
UB,Mongolia
|
Here is my attempt :
function AI_Event() { if(event_type == event_impact) { if(you) && (my.ObjectID==3) && (you.ObjectID==3) { if(my.is_ph==0) { ent_playsound(my,ai_horn_wav,100); phent_settype( my, PH_RIGID, PH_BOX ); phent_setmass (my, 100, ph_box); phent_setgroup (my, 2); phent_setfriction (my, 20); phent_setdamping (my, 20, 30); phent_setelasticity (my, 30, 10); //phent_addforcelocal(my, vector(600, 0, 0), you.x); my.is_ph=1; } //sleep(5); //phent_settype( my, 0, 0 ); //my.is_ph=0; } } ..... ..... function AI_Car() { my.is_ph=0; my.ObjectID=3; my.enable_entity = on; my.enable_impact = on; my.event = AI_Event; .... }
The Empire of the Mongols comprised the largest continuous land empire ever, reaching from Korea to Poland
|
|
|
Re: Non-physics entity to physics entity ?
[Re: Helghast]
#59069
11/16/05 08:12
11/16/05 08:12
|
Joined: Jan 2004
Posts: 3,023 The Netherlands
Helghast
Expert
|
Expert
Joined: Jan 2004
Posts: 3,023
The Netherlands
|
try this else: Code:
function AI_Event() { phent_settype( my, PH_RIGID, PH_BOX ); phent_setmass (my, 100, ph_box); phent_setgroup (my, 2); phent_setfriction (my, 20); phent_setdamping (my, 20, 30); phent_setelasticity (my, 30, 10);
phent_enable(my, 0); if(event_type == event_impact) { if((you) && (my.ObjectID==3) && (you.ObjectID==3)) { if(my.is_ph==0) { ent_playsound(my,ai_horn_wav,100); phent_enable(my, 1); //phent_addforcelocal(my, vector(600, 0, 0), you.x); my.is_ph=1; } //sleep(5); //phent_settype( my, 0, 0 ); //my.is_ph=0; } } }
|
|
|
Re: Non-physics entity to physics entity ?
[Re: Helghast]
#59070
11/16/05 08:16
11/16/05 08:16
|
Joined: Sep 2004
Posts: 260 UB,Mongolia
Olzii
OP
Member
|
OP
Member
Joined: Sep 2004
Posts: 260
UB,Mongolia
|
My attempt is working, but not longer. After several collisions it is crashing.
In my city, now all cars are not physics car and there are moving using c_move.
At the collissions of two non-physics entities, i am converting one car to physics car (car who has received impact). And it is working, but not longer.
The Empire of the Mongols comprised the largest continuous land empire ever, reaching from Korea to Poland
|
|
|
Re: Non-physics entity to physics entity ?
[Re: Olzii]
#59071
11/16/05 08:21
11/16/05 08:21
|
Joined: Sep 2004
Posts: 260 UB,Mongolia
Olzii
OP
Member
|
OP
Member
Joined: Sep 2004
Posts: 260
UB,Mongolia
|
I think it is better : Code:
function AI_Event() { // Check collision and ENABLE it } function AI_Car() { // create physics entity // disable it .... }
But, how about FPS if level has too many DISABLED physics entities ?
The Empire of the Mongols comprised the largest continuous land empire ever, reaching from Korea to Poland
|
|
|
Re: Non-physics entity to physics entity ?
[Re: Olzii]
#59072
11/16/05 09:31
11/16/05 09:31
|
Joined: Jan 2004
Posts: 3,023 The Netherlands
Helghast
Expert
|
Expert
Joined: Jan 2004
Posts: 3,023
The Netherlands
|
Quote:
But, how about FPS if level has too many DISABLED physics entities ?
you should more worry about FPS if everything is ENABLED... but practise makes perfect, just toy around with that... maybe you could make a code that if your like 1000 quants away from the player it will get removed, or turned off again??
good luck on it.
regards,
|
|
|
|