Gamestudio Links
Zorro Links
Newest Posts
hello all
by jcl. 09/24/19 09:04
Right AssetsFix for trading Forex on IG?
by Andy60. 09/23/19 21:11
Converting fbx file to mdl7
by Dark_Light. 09/23/19 15:50
New system for Zorro S subscriptions
by jcl. 09/23/19 08:34
IG plugin initial release
by Andy60. 09/23/19 07:40
Any chance of PBR materials with A8?
by Dooley. 09/22/19 21:43
Levels, textures, etc for A8
by Dooley. 09/22/19 03:57
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
8 registered members (svenbob, Tamas, MatPed, Superku, kvm, jenGs, 3run, 1 invisible), 642 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Zylo, Hjuutgckk, Dark_Light, oxygenjoe, web20tpo
18292 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