Gamestudio Links
Zorro Links
Newest Posts
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
3 registered members (AndrewAMD, alibaba, TipmyPip), 1,144 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
dplay_id BUG? #431491
10/17/13 06:08
10/17/13 06:08
Joined: Aug 2011
Posts: 42
F
fabiomartins Offline OP
Newbie
fabiomartins  Offline OP
Newbie
F

Joined: Aug 2011
Posts: 42
dplay_id
The unique identification number of a client. The number is sent to the client from the server after joining. On a server, it's always 0. A7.7


I tested the dplay_id variable on "Pong Multiplayer"
the value is always "9999" after joining ....

unique identification number of a client?

Re: dplay_id BUG? [Re: fabiomartins] #431492
10/17/13 07:24
10/17/13 07:24
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
And what happens if a second client joins?


Always learn from history, to be sure you make the same mistakes again...
Re: dplay_id BUG? [Re: Uhrwerk] #431506
10/17/13 11:37
10/17/13 11:37
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
dplay_id works fine without any error or bug, I've used it for 10+ multiplayer projects.
I assume you are just displaying it incorrectly, for instance with a %4.0f or integer format. How do you know it's 9999?


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: dplay_id BUG? [Re: Superku] #431518
10/17/13 16:36
10/17/13 16:36
Joined: Aug 2011
Posts: 42
F
fabiomartins Offline OP
Newbie
fabiomartins  Offline OP
Newbie
F

Joined: Aug 2011
Posts: 42
I,m using this:

var meuid ;

PANEL* mostra ={layer = 55; digits(20, 60, 4 ,Arial#24bi, 1, meuid); flags = SHOW;}

....................

function on_server_event(var* received,var id)
{ if (EVENT_JOIN == event_type){ meuid = id; }


So Panel displays 9999 smirk

Re: dplay_id BUG? [Re: fabiomartins] #431519
10/17/13 16:43
10/17/13 16:43
Joined: Oct 2011
Posts: 1,082
Germany
C
Ch40zzC0d3r Offline
Serious User
Ch40zzC0d3r  Offline
Serious User
C

Joined: Oct 2011
Posts: 1,082
Germany
what about
error(str_for_num(NULL, id));

Re: dplay_id BUG? [Re: fabiomartins] #431520
10/17/13 16:43
10/17/13 16:43
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
digits(20, 60, 4 ,Arial#24bi, 1, meuid);
-> 4 digits, and you complain that you cannot see more than 4 digits. wink


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: dplay_id BUG? [Re: Superku] #431521
10/17/13 17:07
10/17/13 17:07
Joined: Aug 2011
Posts: 42
F
fabiomartins Offline OP
Newbie
fabiomartins  Offline OP
Newbie
F

Joined: Aug 2011
Posts: 42
now using 12 digits:

digits(20, 60, 12 ,Arial#24bi, 1, meuid);

always displays 65536 now

Last edited by fabiomartins; 10/17/13 17:11.
Re: dplay_id BUG? [Re: fabiomartins] #431522
10/17/13 17:17
10/17/13 17:17
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
dplay_ids oftentimes only show a difference in the fraction. However, this is irrelevant, the feature works.


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: dplay_id BUG? [Re: fabiomartins] #431524
10/17/13 17:23
10/17/13 17:23
Joined: Aug 2011
Posts: 42
F
fabiomartins Offline OP
Newbie
fabiomartins  Offline OP
Newbie
F

Joined: Aug 2011
Posts: 42
using double shows correctly a random number in dplay_id:

double meuid ;
var mostrar;
PANEL* mostra ={layer = 55; digits(20, 60, 30 ,Arial#24bi, 1, meuid); flags = SHOW;}

Re: dplay_id BUG? [Re: fabiomartins] #431526
10/17/13 17:28
10/17/13 17:28
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Don't use doubles or the like for multiplayer code with lite-C, all functions and features (such as client_id) only expect or are vars and thus only guaranteed to work with those.

Writing for instance 10.3 in the digits field would give you 3 decimal places while using vars, too.


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Page 1 of 2 1 2

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