Gamestudio Links
Zorro Links
Newest Posts
New FXCM FIX Plugin
by flink. 06/04/24 07:30
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
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (AndrewAMD, LorraineJones, VoroneTZ, Akow), 1,446 guests, and 10 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19058 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
prolem with pXent_settriggerflag #399892
04/22/12 17:59
04/22/12 17:59
Joined: Jan 2010
Posts: 150
iran - tehran
F
flatron Offline OP
Member
flatron  Offline OP
Member
F

Joined: Jan 2010
Posts: 150
iran - tehran
hi
this function has a strange problem.


action l1_func()
{
pXent_settype(my,PH_STATIC,PH_POLY);
pXent_settriggerflag(my, NX_TRIGGER_ENABLE, 1);
my.event = l1_funcTrigger;
wait(-1);
ent_remove(me);
}

ent_remove make an error.
if i comment line "pXent_settriggerflag" there is no error.
what is the problem?

Re: prolem with pXent_settriggerflag [Re: flatron] #399896
04/22/12 20:51
04/22/12 20:51
Joined: Mar 2012
Posts: 927
cyberspace
W
Wjbender Offline
User
Wjbender  Offline
User
W

Joined: Mar 2012
Posts: 927
cyberspace
Unregister the physics entity before removing the entity


Compulsive compiler
Re: prolem with pXent_settriggerflag [Re: Wjbender] #399903
04/23/12 05:33
04/23/12 05:33
Joined: Jan 2010
Posts: 150
iran - tehran
F
flatron Offline OP
Member
flatron  Offline OP
Member
F

Joined: Jan 2010
Posts: 150
iran - tehran
i test
pXent_settriggerflag(my, NX_TRIGGER_ENABLE, 0);

and
pXent_settype( my, 0, 0 );

but still i have error

Re: prolem with pXent_settriggerflag [Re: flatron] #399906
04/23/12 06:48
04/23/12 06:48
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
Why do you remove entity immediately after one second?


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: prolem with pXent_settriggerflag [Re: 3run] #399914
04/23/12 09:33
04/23/12 09:33
Joined: Mar 2012
Posts: 927
cyberspace
W
Wjbender Offline
User
Wjbender  Offline
User
W

Joined: Mar 2012
Posts: 927
cyberspace
Could you show your event code .i think you use entity in there
perhaps when you remove it or something


Compulsive compiler
Re: prolem with pXent_settriggerflag [Re: Wjbender] #399932
04/23/12 17:00
04/23/12 17:00
Joined: Jan 2010
Posts: 150
iran - tehran
F
flatron Offline OP
Member
flatron  Offline OP
Member
F

Joined: Jan 2010
Posts: 150
iran - tehran
it is an example. in my game i make an object and use it to trigger something and every thing is ok.
the problem occure when i want to use level_load.
when i want to change level, an error say that "Script crash in physX_ent_remove".

i think there is a problem to delete a physic object that use in pXent_settriggerflag.


(you can delete line "my.event...." the problem is still remain)



Last edited by flatron; 04/23/12 17:05.
Re: prolem with pXent_settriggerflag [Re: flatron] #399954
04/24/12 07:50
04/24/12 07:50
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
Explain what exactly you are trying to archive, I'll try to make a small example to test.


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: prolem with pXent_settriggerflag [Re: 3run] #399980
04/24/12 16:58
04/24/12 16:58
Joined: Jan 2010
Posts: 150
iran - tehran
F
flatron Offline OP
Member
flatron  Offline OP
Member
F

Joined: Jan 2010
Posts: 150
iran - tehran
i am trying to make a racing game.
i this game i need a trigger object to show me that a car passed this way.
for this trigger object , i use a mdl and by setting it's trigger commmand and an event try to know a car is passed or not.
in the game , every thing is ok,trigger object works good and event is called in right situtaion.
problem occur when i need to change level .when i call level_load with my new level name, and when physics engine try to unregister all objects in previous level ,an error say that "Script crash in physX_ent_remove".

Re: prolem with pXent_settriggerflag [Re: flatron] #399981
04/24/12 17:03
04/24/12 17:03
Joined: Jan 2010
Posts: 150
iran - tehran
F
flatron Offline OP
Member
flatron  Offline OP
Member
F

Joined: Jan 2010
Posts: 150
iran - tehran
this is a sample code that show the problem.
copy and paste this code to see the problem.
this code dosen't need any external file.

///////////////////////////////
#include <acknex.h>
#include <default.c>
#include <mtlFX.c>
#include <ackphysx.h>

action l1_func()
{
pXent_settype(my,PH_STATIC,PH_POLY);
pXent_settriggerflag(my, NX_TRIGGER_ENABLE, 1);
wait(-1);
ent_remove(me);
}

function main()
{
physX_open();
level_load("");
wait(2);
ent_create(CUBE_MDL,NULL,l1_func);
}

Re: prolem with pXent_settriggerflag [Re: flatron] #399987
04/24/12 17:39
04/24/12 17:39
Joined: Mar 2012
Posts: 927
cyberspace
W
Wjbender Offline
User
Wjbender  Offline
User
W

Joined: Mar 2012
Posts: 927
cyberspace
im not sure but isnt this automaticly released by the engine
when you change level and use physx_open() ,if you need to disable it
use pXent_settriggerflag(my, NX_TRIGGER_ENABLE, 0); ....

i havent tried removing one thats registered as a trigger,
entity pointer cant get removed ,still in use i guess,could this be a bug?


Compulsive compiler
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