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
1 registered members (TipmyPip), 18,449 guests, and 6 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
Can you pass an entity pointer to a function? #9869
07/25/02 12:06
07/25/02 12:06
Joined: Jul 2000
Posts: 1,570
Windsor, CT 06095
W
WildCat Offline OP
Expert
WildCat  Offline OP
Expert
W

Joined: Jul 2000
Posts: 1,570
Windsor, CT 06095
I know functions can take in parameters... can one of those parameters be an entity pointer like YOU, or must you convert it to a handle, pass the handle and then convert it back to the pointer in the function?

(If that makes any sense)

- WildCat


Visit us at [url=http://www.vertexgames.com]Vertex Games[/url]!
Re: Can you pass an entity pointer to a function? #9870
07/25/02 13:22
07/25/02 13:22
Joined: Jun 2002
Posts: 248
NZ
mudhole Offline
Member
mudhole  Offline
Member

Joined: Jun 2002
Posts: 248
NZ
This isn't more about ptr_for_handle(...) == NULL is it?

JCL told you that code wouldnt work!!

I posted a possible solution in the previous thread.
http://www.conitecserver.com/ubb/ultimatebb.php?ubb=get_topic;f=15;t=002050

In answer to your question, yes you can. But you must assign the parameter to a script defined pointer of known type before you can use it directly for assignments.

eg.

code:
entity* myEnt;
....
// call the function
SomeFunction(me);
....
function SomeFunction(entPtr)
{
// can't use entPtr directly, so assign it to an already defined pointer
myEnt = entPtr;

// now use myEnt to assign values to entPtr
myEnt.passable = on;
}
....



Re: Can you pass an entity pointer to a function? #9871
07/25/02 20:18
07/25/02 20:18
Joined: Jul 2000
Posts: 1,570
Windsor, CT 06095
W
WildCat Offline OP
Expert
WildCat  Offline OP
Expert
W

Joined: Jul 2000
Posts: 1,570
Windsor, CT 06095
Hi Mudhole,
I should yell at you for making an assumption about what I need this for, but I won't.

This has nothing to do with the NULL issue. I've long since delt with that.

This is for an advanced collision detection system using WDL.

Thanks for the input. Your answer was exactly what I was looking for.

- WildCat


Visit us at [url=http://www.vertexgames.com]Vertex Games[/url]!

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