Gamestudio Links
Zorro Links
Newest Posts
What are you working on?
by txesmi. 09/14/19 15:44
file_write var array ?
by jcl. 09/14/19 08:31
Shift on MA
by Fred7. 09/14/19 07:37
Smaller Zorro GUI for Windows XP
by Petra. 09/13/19 17:31
Options t8 format question
by jcl. 09/13/19 12:15
import pandas from python for deep learning
by anonymous69. 09/12/19 14:40
script mt5
by anonymous69. 09/12/19 12:11
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
5 registered members (3run, Dalla, bondo1, 2 invisible), 616 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
web20tpo, tarekhazem, Juanjo, Fred7, saulius
18288 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