Gamestudio Links
Zorro Links
Newest Posts
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
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
2 registered members (Ayumi, 1 invisible), 584 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Name of the entities in the head - HELP! #94372
10/13/06 20:14
10/13/06 20:14
Joined: Jul 2005
Posts: 72
Pr0gr4mm3r Offline OP
Junior Member
Pr0gr4mm3r  Offline OP
Junior Member

Joined: Jul 2005
Posts: 72
Please I am making a game multiplayer, and do I want that it shows the names in the heads of the entities, but just in the servER of the for seeing the names, in the way customer I don't get to see, what should make? see the image;

the CLIENT doesn't get to see the names



//////////////////////////////////////////////////////////
//////CODE OF THE NAME IN THE ENTITY//////////////////////
//////////////////////////////////////////////////////////

font system_font = <system.pcx>, 10, 12;

/////////////////////////////////////////////////////////////////////////

text name1_txt
{
font = system_font;
string = player_name;
}

text name2_txt
{
font = system_font;
string = player_name;
}

/////////////////////////////////////////////////////////////////////////

function name_ent1()
{
while (1)
{
vec_set (temp, my.x);
temp.z += 40; // play with this value for every entity
trace_mode = ignore_me + ignore_models + ignore_passents;
if (trace (my.x, camera.x) == 0) // if the entity is visible on the screen
{
vec_to_screen (temp, camera);
name1_txt.pos_x = temp.x; // set the position of the text
name1_txt.pos_y = temp.y; // on x and y
name1_txt.visible = on; // and make it visible
}
else // the entity isn't visible on the screen?
{
name1_txt.visible = off; // hide the text
}
wait (1);
}
}

function name_ent2()
{
while (1)
{
vec_set (temp, my.x);
temp.z += 60; // play with this value for every entity
trace_mode = ignore_me + ignore_models + ignore_passents;
if (trace (my.x, camera.x) == 0) // if the entity is visible on the screen
{
vec_to_screen (temp, camera);
name2_txt.pos_x = temp.x; // set the position of the text
name2_txt.pos_y = temp.y; // on x and y
name2_txt.visible = on; // and make it visible
}
else // the entity isn't visible on the screen?
{
name2_txt.visible = off; // hide the text
}
wait (1);
}
}



see the code of the player;

function player_client()
{
my.skin = num_client;//O skin aqui é apenas para usar o contador cliente
if (my.skin ==1){player1 = my;
name_ent1();while (player1 == null){wait(1);}}//Aqui que eu verifico quem é o player 1 ou 2
if (my.skin ==2){ player2 = my;
name_ent2();while (player2 == null){wait(1);}}
num_client += 1;
if (num_client > 3){wait(1);remove (me);return;}
MY.ENABLE_DISCONNECT = ON;
MY.EVENT = _actor_connect;//Esta função é préfabricada e se encontra no arquivo actor.wdl
my.health = 100;
my.ammo = 9999;
player_walk();
//player_drive();
send_variable();
if (MY.shadow == OFF) { drop_shadow(); }
}


how do for what do all I see the names of the entities in the head of the payers? at once I thank.

Last edited by Pr0gr4mm3r; 10/13/06 20:18.

my site of 3d gamestudio: http://byteseartes.sitesled.com
Re: Name of the entities in the head - HELP! [Re: Pr0gr4mm3r] #94373
10/13/06 20:27
10/13/06 20:27
Joined: Jan 2004
Posts: 2,062
Hamburg, Germany
slacer Offline
Expert
slacer  Offline
Expert

Joined: Jan 2004
Posts: 2,062
Hamburg, Germany
The functions run at the server side, but if you want to show the names at client side, too - you have change some things.

Lookup proc_local in the manual, to understand how to call name_ent1 and name_ent2.
This is important, because you also whish to use the clients camera position to find the right coordinates for the text names.

But there still is some extra work to do: You need to send the name to each client, otherwise there is no text to copy into the TEXT string.
Maybe you didn't notice this till now, but both players use the same name, because there can only be one player_name per system.

-- slacer

Re: Name of the entities in the head - HELP! [Re: slacer] #94374
10/13/06 21:19
10/13/06 21:19
Joined: Jul 2005
Posts: 72
Pr0gr4mm3r Offline OP
Junior Member
Pr0gr4mm3r  Offline OP
Junior Member

Joined: Jul 2005
Posts: 72
Please, without asking a lot, but have some idea of as I do? I need to put a name in the head of all of the entities, a code please.

Thank you very much!

Last edited by Pr0gr4mm3r; 10/13/06 21:19.

my site of 3d gamestudio: http://byteseartes.sitesled.com

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