Gamestudio Links
Zorro Links
Newest Posts
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
3 registered members (AndrewAMD, 7th_zorro, dr_panther), 1,297 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
[PhysX] whole physik is disabling, maybe a bug? #353881
01/13/11 19:21
01/13/11 19:21
Joined: Jun 2008
Posts: 402
Germany
S
sebbi91 Offline OP
Senior Member
sebbi91  Offline OP
Senior Member
S

Joined: Jun 2008
Posts: 402
Germany
Hi comunity

I've another problem with PhysiX.

I have several Models in my Level.
The most of them are Objects with a Physik like this in my player1 action:

Code:
if(my.health<=0)
		{
			pXent_settype(my,NULL,NULL);		
			wait(1);
			pXent_settype(my,PH_RIGID,PH_CAPSULE);		
		
		}




here is a code snippet :
Code:
action physxtest()
{
  pXent_settype (my,PH_RIGID,PH_BOX); // set the physics entity type   
  pXent_setfriction (my,20); // set the friction on the ground
  pXent_setdamping (my,50,50); // set the damping
  pXent_setelasticity (my,100); // set the elasticity
}




I've 2 player-models that uses the "PH_CHAR" function.
All works fine if the player is alive.
But if the Player get killed the physik is stop working.

I want to swith the phyics-mode from my player from"PH_CHAR" to "PH_RIGID"
I read in the manual about that and so I used something like this:
Code:
if(my.health<=0)
		{
			pXent_settype(my,NULL,NULL);		
			wait(1);
			pXent_settype(my,PH_RIGID,PH_CAPSULE);		
			
		}



Here is a short code snippet of my script.

Code:
void main()
{
ENTITY* temp;
ENTITY* map;


var terrain_chunk = 0; 
video_mode = 11;	 			
video_depth =32; 			
video_screen=2;
sound_vol = 100; 
time_smooth =0.8 ;
max_particles = 50000;								
max_entities = 2000; 
fps_max = 30;
fps_min = 20;
fps_lock = 0; 					// time_step is now always 16/60 = 0.266 ticks #endif
tex_share = 1;					// map entities share their textures
enable_polycollision = 2;
//d3d_autotransparency=1;	//1st pixel is the overlay pixel
//d3d_near_models = 0.4;
d3d_antialias = 4;

preload_mode=0;
shadow_stencil = 0; 		
shadow_lod = 2; 			
physX_open();
pX_setccd (1);
pX_setunit(0.10);        //0.7
pX_setgravity(vector(0,0,-9.81));

level_load("");
	

 reset(camera,SHOW|AUDIBLE);

 camera1.clip_near = 1; 
 camera1.clip_far = 1000;//if smaler it contains more 

 camera2.clip_near = 1; 
 camera2.clip_far = 1000;//if smaler it contains more 

 
//Manage Level-creating //

 map=ent_create("testarea_n.hmp",NULL,terrain_act);
 set(map,SHADOW||OVERLAY|POLYGON);

....


}







action player1_act()
{
	player1=me;
	my.material=steel_mat;	
	set(my,POLYGON|CAST);
	my.emask|=ENABLE_SHOOT|ENABLE_BLOCK|ENABLE_IMPACT|ENABLE_ENTITY|ENABLE_SCAN;
//	my.push=100;
	my.group = 3; //+1 by player2
	my.health=100;
	my.ammo_small=300;		
	my.ammo_rocket=50;	
	my.ammo_heavy=20;	
	my.team=p1;
	
	my.alpha=100;
	my.push=100;
 	
//	pX_setautodisable ( 8, 8 );
	pXent_settype(me,PH_CHAR,PH_BOX);	
	pXent_setmass (my, 3); // and its mass
	pXent_setfriction (my, 500); // set the friction
	pXent_setdamping (my, 40, 40); // set the damping
	pXent_setelasticity (my, 50); // set the elasticity
	wait(1);

while(1)
{
if(my.health>0)
{
VECTOR* mov = vector(0,0,0);		
if(key_cuu)mov.x=*time_step;				
if(key_cud) mov.x=-7*time_step;
						
						
						if(key_cuu==1&&key_cud==1){mov.x=0;}
						
if(key_home) mov.y= 7*time_step;
if(key_pgup) mov.y=-7*time_step;
						if(key_home==1&&key_pgup==1){mov.y=0;}
													ground_distanz=-100;
						c_trace(my.x,ground_distanz,IGNORE_YOU|IGNORE_MODELS|IGNORE_PASSABLE|IGNORE_PUSH|USE_POLYGON);
						if(ground_distanz>0)
{
							push_force_z =1* time_step; //calculate an fall down
						}
						else
						{
							push_force_z=-15 * time_step; 
mov.z=push_force_z*time_step;
							
						vec_rotate(mov,player1.pan);				pXent_movechar(me,mov,player1.pan,0);			  

//Thats the movement script

.....

}

//now the player get killed
else
{
pXent_settype(player1,NULL,NULL);
		
wait(1);	
		pXent_settype(player1,PH_RIGID,PH_CAPSULE);		
}
}





If the player is dead and if I write the "pxent_settype(player1,NULL,NULL);" part
The whole Physik in the leel is stopping working!
For exampel The other Models with "PH_CHAR" cant move anymore.

I hope someone know how to fix it.


best regards
sebbi


3D-Gamestudio A8 - Commercial
Re: [PhysX] whole physik is disabling, maybe a bug? [Re: sebbi91] #354531
01/19/11 19:18
01/19/11 19:18
Joined: Jun 2008
Posts: 402
Germany
S
sebbi91 Offline OP
Senior Member
sebbi91  Offline OP
Senior Member
S

Joined: Jun 2008
Posts: 402
Germany
hello ?


3D-Gamestudio A8 - Commercial
Re: [PhysX] whole physik is disabling, maybe a bug? [Re: sebbi91] #354609
01/20/11 16:09
01/20/11 16:09
Joined: Jan 2011
Posts: 797
Da wo du nicht bist! Muhahaha!
xxxxxxx Offline
User
xxxxxxx  Offline
User

Joined: Jan 2011
Posts: 797
Da wo du nicht bist! Muhahaha!
Hi,
maby you shoult use
pXent_settype(player1,0,0);

EDIT: you can use pXent_kinematic and pXent_moveglobal.
I get the not same problem when i use your code, not all physik
ents become disabled.

PS: Sorry for my English!

Last edited by xxxxxxx; 01/20/11 16:33.

Es ist immer wieder erstaunlich, dass Leute die riesen Scripte schreiben die einfachsten sachen nicht können zb. mich mit SIEBEN x zu schreiben! tongue
Re: [PhysX] whole physik is disabling, maybe a bug? [Re: xxxxxxx] #354633
01/20/11 18:15
01/20/11 18:15
Joined: Jun 2008
Posts: 402
Germany
S
sebbi91 Offline OP
Senior Member
sebbi91  Offline OP
Senior Member
S

Joined: Jun 2008
Posts: 402
Germany
no problem I am a german user ^^
I have a bad English too.

I cant get it working!
If i write it so my player is hovering in the air.
Please could you give me a scipt excample?

i tried it in that way:

Code:
action player1_act()
{
	player1=me;
	my.material=steel_mat;	
	set(my,POLYGON|CAST);
	my.emask|=ENABLE_SHOOT|ENABLE_BLOCK|ENABLE_IMPACT|ENABLE_ENTITY|ENABLE_SCAN;
....

while(1)
{
					
if(my.health>0)
{
pXent_kinematic(my, 0); // kinematic object (Disable kinematic)
....

//movement

					   player1.pan+=5*(key_cul-key_cur)*time_step;			  

						VECTOR* mov = vector(0,0,0);		
						if(key_cuu) mov.x= 7*time_step;					
						if(key_cud) mov.x=-7*time_step;
						
						if(key_cuu==1&&key_cud==1){mov.x=0;}
						
						if(key_home) mov.y= 7*time_step;
						if(key_pgup) mov.y=-7*time_step;
						if(key_home==1&&key_pgup==1){mov.y=0;}
								
						ground_distanz=-100;
						c_trace(my.x,ground_distanz,IGNORE_YOU|IGNORE_MODELS|IGNORE_PASSABLE|IGNORE_PUSH|USE_POLYGON);
						if(ground_distanz>0)
						{
							push_force_z =1* time_step; //calculate an fall down
						}
						else
						{
							push_force_z=-15 * time_step;   //calculate a ground force
						}	
						mov.z=push_force_z*time_step;
						
			
						vec_rotate(mov,player1.pan);				pXent_moveglobal (me,mov,player1.pan); 
					

.....

}

		if(my.health<=0)
		{
			pXent_kinematic(my, 1); // kinematic object (enable kinematic)
				
			wait(1);
			pXent_settype(my,PH_RIGID,PH_CAPSULE);		
			pXent_setmass (my, 3); // and its mass
			pXent_setfriction (my, 500); // set the friction
			pXent_setdamping (my, 40, 40); // set the damping
			pXent_setelasticity (my, 50); // set the elasticity
			wait(1);
			return;
			
					/*	ent_remove(me);		
				return;	*/		
		}
		
		wait(1);
		}
}



But anyway thanks for your help! ^^


regards Sebbi


3D-Gamestudio A8 - Commercial
Re: [PhysX] whole physik is disabling, maybe a bug? [Re: sebbi91] #354640
01/20/11 18:39
01/20/11 18:39
Joined: Jan 2011
Posts: 797
Da wo du nicht bist! Muhahaha!
xxxxxxx Offline
User
xxxxxxx  Offline
User

Joined: Jan 2011
Posts: 797
Da wo du nicht bist! Muhahaha!
so wie ich deinen Code sehe wird dein Player erst frei von den pX-kräften befeit wenn seine gesundheit <= 0 ist -> er kann nicht fallen. dein Player kann sich auch gar nicht bewegen wenn seine Gusundheit größer 0 ist. Er beweg sich tot oder lebendig kein stück.
Ach ja pXent_kinematic muss man nicht jeden frame aufrufen!!!

WICHTIG:
damit es mit pXent_kinematic und pXent_moveglobal functioniert muss man die entity auch zu nem phsik obj. machen.


Du solltest vieleicht mov so definieren
VECTOR mov;
Ich glaube es ist auch nicht gut wenn du den pan wert dierekt veränderst.
glaube ich!
übrigens
if(key_cuu)
mov.x= 7*time_step;

if(key_cud)
mov.x=-7*time_step;
reict völlig oder sollte völlig reichen,

if(key_cuu==1&&key_cud==1)
{mov.x=0;}
ist eigentlich überflüssig
(gilt auch für die unteren zeilen)

(übrings falls du mehrere gegner hast solltest du das Polygon flag abschalten, es nützt auch wenig wenn du pX engine benutzt)

aber sonst sollte es klappen!!!
Sorry ich editier diesen post sehr oft!

Last edited by xxxxxxx; 01/20/11 19:02.

Es ist immer wieder erstaunlich, dass Leute die riesen Scripte schreiben die einfachsten sachen nicht können zb. mich mit SIEBEN x zu schreiben! tongue
Re: [PhysX] whole physik is disabling, maybe a bug? [Re: xxxxxxx] #354977
01/23/11 19:05
01/23/11 19:05
Joined: Jun 2008
Posts: 402
Germany
S
sebbi91 Offline OP
Senior Member
sebbi91  Offline OP
Senior Member
S

Joined: Jun 2008
Posts: 402
Germany
Danke für deine Hilfe aber es klappt immer noch nicht -.-

Es ist eigenartig, sobald ich eine Entity versuche zu deaktivieren, spinnt die ganze Physik engine.

1. bewegt sich mein Spieler 1 nicht mehr, Spieler (2,3,4 können wenigsten gerade aus aber nicht mehr zur Seite laufen)

2. Fallen manche Objekte einfach durch das map-Modell (kein Terrain)

3. Wenn ich eine Entity lösche bleibt die Kollisionshülle irgendwie übrig (heißt ich habe ein unsichbares Hinderniss o.O)


ich habe zum physikalischen deaktivieren von meinem Geschützturm diese 2 Möglichkeiten gedacht:

Code:
if(my.health<=0)
		{
			my.emask &=~ENABLE_SCAN;
			my.emask &=~ENABLE_ENTITY;
			my.emask &=~ENABLE_IMPACT;
			set(my,TRANSLUCENT);
			
			my.alpha-=2*time_step;
			if(my.alpha<=0)
			{
			        pXent_setsleep ( me , 1);

		           pXent_enable(me,0);	

				ent_remove(me);		
				return;
			}
		}


oder
Code:
if(my.health<=0)
		{
			my.emask &=~ENABLE_SCAN;
			my.emask &=~ENABLE_ENTITY;
			my.emask &=~ENABLE_IMPACT;
			set(my,TRANSLUCENT);
			
			my.alpha-=2*time_step;
			if(my.alpha<=0)
			{
			        pXent_setsleep ( me , 1);

		               pXent_settype (my,0,0);	

				ent_remove(me);		
				return;
			}
		}




beides legt wie erwähnt die Physik lahm.

Nebenbei erwähnt funktioniert der Befehl "pXent_setgroup"
gar nicht !
ich schreibe ganz normal in die main:
Code:
pXent_setgroup ( player1, 4); 
pXent_setgroup ( player2, 4); 
pXent_setgroup ( player3, 4); 
pXent_setgroup ( player4, 4);



normalerweise müssten die sich jetzt gegenseitig ignorieren und man kann gegenseitig einfach durchlaufen.

Geht natürlich auch nicht!

PHYSX bringt mich langsam zum verzweifeln!!!!! cry
Klingt fast wie ein Fall fürn Support!



Hoffe mir kann irgendjemand helfen!



mfg Sebbi


3D-Gamestudio A8 - Commercial
Re: [PhysX] whole physik is disabling, maybe a bug? [Re: sebbi91] #354986
01/23/11 20:23
01/23/11 20:23
Joined: Jan 2011
Posts: 797
Da wo du nicht bist! Muhahaha!
xxxxxxx Offline
User
xxxxxxx  Offline
User

Joined: Jan 2011
Posts: 797
Da wo du nicht bist! Muhahaha!
Ja ich kenn das, die PHYSX regt mich auf(sie zwei untbeantwortete Fragen)! beim problem mit pXent_setgroup ist die Lösung klar und sie heißt (oder sollte so heißen):
pX_setgroupcollision
das spinnen bei der px-e. kenn ich und bin deshalb schnell auf c_move umgestigen und wenn mein feind tot war hab ich ihn zum nen pXent gemacht und am ende deaktiviert komischer weise hat es bei diesem deaktivieren keine probleme gegeben(die Probleme waren da aber hatten keine auswirkungen auf den Fall der gegner! warum auch immer?).

"Wenn ich eine Entity lösche bleibt die Kollisionshülle irgendwie übrig (heißt ich habe ein unsichbares Hinderniss o.O)"
geh doch etwas anders vor mach ein Array aus Feinden, Playern...
und lösch diese nie, sondern setze sie einfach an irgene Position wo man sie nich sieht und lass sie solande dort bis sie wieder gebraucht werden(für die zeit disabelst du sie)! wenn man das geschickt macht kann man mit ca. 15 entities was gutes ohne viele Resursen zu verbrauchen machen!

ich empfele dir so oder so das mal im Bug Hunt forum zu Posten!
scheint ja nichts zu sein wo mal nen experte was weiß!

EDIT: was klappt nich das bewegen mit kinenematic oder das bewegen mit movechar nach dem entfernen des objektes?

mfg
xxxxxxx

Last edited by xxxxxxx; 01/23/11 21:03.

Es ist immer wieder erstaunlich, dass Leute die riesen Scripte schreiben die einfachsten sachen nicht können zb. mich mit SIEBEN x zu schreiben! tongue
Re: [PhysX] whole physik is disabling, maybe a bug? [Re: xxxxxxx] #355836
01/29/11 13:32
01/29/11 13:32
Joined: Jun 2008
Posts: 402
Germany
S
sebbi91 Offline OP
Senior Member
sebbi91  Offline OP
Senior Member
S

Joined: Jun 2008
Posts: 402
Germany
DT:
---

Sooo für alle die sich mal selbst drann versuchen möchten habe ich hier nun ein sample projekt!
Die Beschreibung liegt bei ^^
Ich denke es ist einfacher mit einem Beispiel skript.

Ich hoffe jemand findet die Bugs!

Viel Erfolg und Danke für euer Bemühen!

mfg sebbi

______________________________________________________________
Here is the File:
Good luck and thanks anyway for a try!


http://www.fileuploadx.de/595419

or

http://www.megaupload.com/?d=2KN0UAT1

______________________________________________________________

ENG
---

So here is a sample file to try to find the bugs.
There are some informations in the script.
I think its easier to have an samle file!

I hope someone could find the bugs!

Thanks for your Try and your help anyway!

best regards Sebbi


3D-Gamestudio A8 - Commercial
Re: [PhysX] whole physik is disabling, maybe a bug? [Re: sebbi91] #356766
02/03/11 19:33
02/03/11 19:33
Joined: Jun 2008
Posts: 402
Germany
S
sebbi91 Offline OP
Senior Member
sebbi91  Offline OP
Senior Member
S

Joined: Jun 2008
Posts: 402
Germany
hi ,
did anyone solve one of my bugs ?


3D-Gamestudio A8 - Commercial
Re: [PhysX] whole physik is disabling, maybe a bug? [Re: sebbi91] #357727
02/08/11 15:12
02/08/11 15:12
Joined: Jun 2008
Posts: 402
Germany
S
sebbi91 Offline OP
Senior Member
sebbi91  Offline OP
Senior Member
S

Joined: Jun 2008
Posts: 402
Germany
hi there^^
Is there anyone who find out if this are Engine or Script bugs?

If this are Engine bugs I want to post them under "Bug hunt",to terminate them.

Please, Give it a try.

http://www.megaupload.com/?d=2KN0UAT1
or
http://www.fileuploadx.de/595419


regards sebbi


3D-Gamestudio A8 - Commercial
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