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
2 registered members (AndrewAMD, dr_panther), 1,282 guests, and 4 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
physX_open() calling again -> physic is not running #435547
01/09/14 00:24
01/09/14 00:24
Joined: Aug 2008
Posts: 394
Germany
Benni003 Offline OP
Senior Member
Benni003  Offline OP
Senior Member

Joined: Aug 2008
Posts: 394
Germany
Hi, I have the problem that the physic system isn't working after second call of physX_open(). I made an example:

//---------------
1: (Working)

physX_close();

wait(5);

ph_fps_max_lock = 60;
pX_setgravity(vector(0,0,-5));
physX_open();

//-----------------
2: (Not Working)

ph_fps_max_lock = 60;
pX_setgravity(vector(0,0,-5));
physX_open();

wait(5);

physX_close();

wait(5);

ph_fps_max_lock = 60;
pX_setgravity(vector(0,0,-5));
physX_open();
//-------------------

hm does anyone know why it's not working? I really need it. After returning from level my code closes the physicsystem... after loading a new Level again starting with physX_open().
Where is the problem?

Re: physX_open() calling again -> physic is not running [Re: Benni003] #435549
01/09/14 04:48
01/09/14 04:48
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
You could check ackphysX.h/c from the include folder and the code of physX_open.
Why do you need to close physX anyway?


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: physX_open() calling again -> physic is not running [Re: Superku] #435559
01/09/14 08:59
01/09/14 08:59
Joined: Aug 2008
Posts: 394
Germany
Benni003 Offline OP
Senior Member
Benni003  Offline OP
Senior Member

Joined: Aug 2008
Posts: 394
Germany
Hi, I've checked already achphysX.h, but I couldn't find the problem smirk I need to close physX, because after this I call proc_kill(16); Its to kill all functions when returning from Level to main menu

Re: physX_open() calling again -> physic is not running [Re: Benni003] #435563
01/09/14 09:09
01/09/14 09:09
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
This may not help you a lot but I think that's a pretty inelegant solution. All non-global functions will stop on level load either way, so you only have to stop global functions manually (which you barely need to). I do this with a do_exit variable (thus while(!do_exit)...) which I set to 1 prior to level_load and reset it one frame later.


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: physX_open() calling again -> physic is not running [Re: Superku] #435570
01/09/14 09:42
01/09/14 09:42
Joined: Aug 2008
Posts: 394
Germany
Benni003 Offline OP
Senior Member
Benni003  Offline OP
Senior Member

Joined: Aug 2008
Posts: 394
Germany
yes, thank you. I could do this, but I worked my problem. I dont use physX_close. I just call a function with following after proc_kill(16):
while(1)
{
physX_run(time_step/16);
wait(1);
}
Everything is working now laugh


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