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
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
4 registered members (AemStones, AndrewAMD, gamers, Kingware), 1,679 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
LucasJoshua, Baklazhan, Hanky27, firatv, wandaluciaia
19054 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
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 Offline OP
Member
Olzii  Offline 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: Olzii] #59064
11/16/05 07:54
11/16/05 07:54
Joined: Jan 2004
Posts: 3,023
The Netherlands
Helghast Offline
Expert
Helghast  Offline
Expert

Joined: Jan 2004
Posts: 3,023
The Netherlands
just turn it off for as long as it's nit used
phent_enable(me, 0); // 0/1 to turn it on/off
have fun ^_^


Formerly known as dennis_fantasy
Portfolio - http://www.designorhea.com/
Project - http://randomchance.cherrygames.org/
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 Offline OP
Member
Olzii  Offline 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 Offline
Expert
Helghast  Offline
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,


Formerly known as dennis_fantasy
Portfolio - http://www.designorhea.com/
Project - http://randomchance.cherrygames.org/
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 Offline OP
Member
Olzii  Offline 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: Olzii] #59068
11/16/05 08:11
11/16/05 08:11
Joined: Jan 2004
Posts: 3,023
The Netherlands
Helghast Offline
Expert
Helghast  Offline
Expert

Joined: Jan 2004
Posts: 3,023
The Netherlands
dunno if it matters, but i think the second if was wrong...

should be: if((you) && (my.ObjectID==3) && (you.ObjectID==3))
you forgot the brackety thingys:P

i am gonna take a closer look to this...
regards,


Formerly known as dennis_fantasy
Portfolio - http://www.designorhea.com/
Project - http://randomchance.cherrygames.org/
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 Offline
Expert
Helghast  Offline
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;
}
}
}




Formerly known as dennis_fantasy
Portfolio - http://www.designorhea.com/
Project - http://randomchance.cherrygames.org/
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 Offline OP
Member
Olzii  Offline 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 Offline OP
Member
Olzii  Offline 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 Offline
Expert
Helghast  Offline
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,


Formerly known as dennis_fantasy
Portfolio - http://www.designorhea.com/
Project - http://randomchance.cherrygames.org/
Page 1 of 2 1 2

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