Gamestudio Links
Zorro Links
Newest Posts
Zorro Beta 2.61: PyTorch
by jcl. 06/10/24 14:42
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
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 1,577 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19058 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Determine if pointer is an active physics object #183281
02/11/08 13:21
02/11/08 13:21
Joined: Nov 2004
Posts: 862
Australia
DavidLancaster Offline OP
User
DavidLancaster  Offline OP
User

Joined: Nov 2004
Posts: 862
Australia
I hope this isn't a newbie question.

I have a pointer to an entity, you, it dynamically changes between being a registered physics object and not. How can I determine in say an event function that the entity is active or not? What function can I use which can return a true or false of it's state? I want to do this because I don't wish to run physics instructions on the entity while it isn't activated otherwise gstudio just gives errors.

Thank you!

David

Last edited by DavidLancaster; 02/11/08 13:22.
Re: Determine if pointer is an active physics obje [Re: DavidLancaster] #183282
02/19/08 17:17
02/19/08 17:17
Joined: Feb 2008
Posts: 5
T
totti10 Offline
Newbie
totti10  Offline
Newbie
T

Joined: Feb 2008
Posts: 5
hey, i having the same problem as you.
Did you managed to solve it already ?

Re: Determine if pointer is an active physics obje [Re: DavidLancaster] #183283
02/19/08 17:41
02/19/08 17:41
Joined: Jan 2004
Posts: 2,013
The Netherlands
E
Excessus Offline
Expert
Excessus  Offline
Expert
E

Joined: Jan 2004
Posts: 2,013
The Netherlands
I'm not sure about this, but it seems that some getters can return 0 if they fail. I would suspect that they fail if the entity is not a registered physics entity.

if(phent_getangvelocity(my, temp) == 0)

Re: Determine if pointer is an active physics obje [Re: totti10] #183284
02/19/08 17:44
02/19/08 17:44
Joined: Feb 2008
Posts: 337
V
Vadim647 Offline
Senior Member
Vadim647  Offline
Senior Member
V

Joined: Feb 2008
Posts: 337
Hello there!
It's easy to make it, if just using a flag or a skill.
(replace all phent_setmass(...); by
phent_settype(...);my.FLAG7 = on;// or off when setting off.
Alternative is adding yours:
Code:

ph_settype(ENTITY* ent,var type,var hulltype)
{
if (type!=0) {ent.flag7=on;} else {ent.flag7=off;}
phent_settype(ent,mass,hulltype);
}


That's all.
(You can repeat same by making same for all phent_*)


I switched to other account since marth 2010. Guess which.
Re: Determine if pointer is an active physics obje [Re: Vadim647] #183285
02/20/08 03:12
02/20/08 03:12
Joined: Nov 2004
Posts: 862
Australia
DavidLancaster Offline OP
User
DavidLancaster  Offline OP
User

Joined: Nov 2004
Posts: 862
Australia
I was really hoping to avoid doing that but I think it's the best and only way. And the way you coded that function, very intuitive! Thank you


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