Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
5 registered members (Dico, AndrewAMD, TipmyPip, NewbieZorro, Grant), 15,791 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 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 | 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