Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by EternallyCurious. 04/18/24 10:45
StartWeek not working as it should
by Zheka. 04/18/24 10:11
folder management functions
by VoroneTZ. 04/17/24 06:52
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
zorro 64bit command line support
by 7th_zorro. 04/15/24 09:36
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:48
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:46
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
7 registered members (EternallyCurious, 7th_zorro, Ayumi, Quad, AndrewAMD, ricky_k, 1 invisible), 497 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, 11honza11, ccorrea, sakolin, rajesh7827
19046 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,823
Netherlands
Reconnoiter Offline OP
Serious User
Reconnoiter  Offline OP
Serious User

Joined: Dec 2011
Posts: 1,823
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,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
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,823
Netherlands
Reconnoiter Offline OP
Serious User
Reconnoiter  Offline OP
Serious User

Joined: Dec 2011
Posts: 1,823
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