Gamestudio Links
Zorro Links
Newest Posts
A8 and Draw_Line3D (SOLVED)
by Dooley. 06/19/19 21:27
Bring the old grin back!
by alibaba. 06/19/19 20:35
FXCM: "Can't connect to price server"
by jcl. 06/19/19 15:47
Data Execution Prevention Strikes Again
by Dooley. 06/19/19 15:38
assert
by jcl. 06/19/19 14:59
AUM Magazine
Latest Screens
The Space Between
Pogostuck: Rage With Your Friends
Worst Case Z
AckCon'18 - Lotter vs the World 2 - Preview Release
Who's Online Now
6 registered members (Dooley, AndrewAMD, alibaba, Quad, 2 invisible), 645 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Qw3rty, Dal, Carson, giantj, dh85
18236 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
sending pointer through send_skill #442082
06/10/14 14:41
06/10/14 14:41
Joined: Dec 2011
Posts: 1,811
Netherlands
Reconnoiter Offline OP
Serious User
Reconnoiter  Offline OP
Serious User

Joined: Dec 2011
Posts: 1,811
Netherlands
Hey,

Is sending a pointer of an entity through send_skill a reliable way to get the pointer on the entity on e.g. clients? Like this?;

Code:
//server
f ((connection & CONNECT_SERVER) || connection == 0) {
my.ENEMY = pointer_player[i];
send_skill(my.ENEMY,SEND_ALL);
}

...

//on both
if (my.ENEMY != 0) pointer_enemy_player = my.ENEMY;



I need to be sure, am doing the bug cleaning.

Re: sending pointer through send_skill [Re: Reconnoiter] #442085
06/10/14 15:24
06/10/14 15:24
Joined: Jan 2002
Posts: 4,221
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,221
Germany / Essen
No. Think about what a pointer actually is and then think about how useful this information is on a different machine...


Always learn from history, to be sure you make the same mistakes again...
Re: sending pointer through send_skill [Re: Uhrwerk] #442089
06/10/14 17:50
06/10/14 17:50
Joined: Dec 2011
Posts: 1,811
Netherlands
Reconnoiter Offline OP
Serious User
Reconnoiter  Offline OP
Serious User

Joined: Dec 2011
Posts: 1,811
Netherlands
Good to hear that actually, makes my debugging time shorter now I know that is a problem.

-edit, forgot the handle thingy, it works good know. Ty Uhrwerk

Last edited by Reconnoiter; 06/10/14 18:45.
Re: sending pointer through send_skill [Re: Reconnoiter] #450226
04/09/15 22:58
04/09/15 22:58
Joined: Jan 2006
Posts: 968
EpsiloN Offline
User
EpsiloN  Offline
User

Joined: Jan 2006
Posts: 968
I'm not sure if I understood you, but I think you misunderstood him laugh
A pointer is only valid on your machine. It points to a place in your memory. On another machine it has a different value (points to a different entity, or if you're !lucky! to the same entity).
Instead, identify your entities by client_id and other custom ID methods...


Extensive Multiplayer tutorial:
http://mesetts.com/index.php?page=201

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