Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/20/24 20:05
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
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
1 registered members (henrybane), 530 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Baklazhan, Hanky27, firatv, wandaluciaia, Mega_Rod
19052 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 | 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