How do I show 4 login entities?

Posted By: nkl

How do I show 4 login entities? - 01/20/07 17:12

Hello!
I am A6 Pro Edition V6.50.6 registered user.
In order to reduce the network bandwidth.
I use the my.nosend=on in ent_create function.
I can compile the script into exe file without any error.
I run the program in following order to simulate the client login.
1) I run the program in –sv mode to simulate pure server mode.
2) I run the program in –cl mode 4 time to simulate 4 client login.
I find that FIRST client, SECOND client and THIRD client program only show two login entities. FOURTH client program only show one login entity.

This time I set the my.nosend=off in ent_create function.
I can compile the script into exe file without any error.
I run the program in following order to simulate the client login.
1) I run the program in –sv mode to simulate pure server mode.
2) and then I run the program in –cl mode 4 time to simulate 4 client login.
I find that each client program can show four login entities.

How do I set my.nosend=on in ent_create function it can show four login entities?

thanks already.

Following is the whole code

Code:
  
path ".\\Models";
path ".\\Entities";
path ".\\Bitmaps";
//
var video_mode = 6;
var video_screen = 2;
string world_str = <multiplayer.wmb>;
string str_warlock = <blue_warlock.mdl>;
string str_cbabe = <cbabe.mdl>; // CBabe Model
string str_guard = <red_guard.mdl>; // Red Guard Model
function ghost_player()
{
my.nosend=on;
while(on)
{
wait(1);
}
}
//
function move_player()
{
wait(1);
proc_local(my,ghost_player);
wait(1);
ent_sendnow(my); // force model and position to be sent in the next cycle
wait(1); // make sure it's sent now
my.nosend = on; // don't send anything further
my.nosend_sound=on;
my.nosend_origin=on;
my.nosend_angles=on;
my.nosend_scale=on;
my.nosend_frame=on;
my.nosend_skin=on;
my.nosend_flags=on;
my.nosend_ambient=on;
my.nosend_light=on;
my.nosend_color=on;
my.nosend_uv=on;
//
while(my)
{
wait(1);
}
//
}

function main()
{

dplay_smooth = 0;
randomize(); // set random seed

level_load(world_str); // load level
wait(1); // make sure level is loaded
var temp_loc[3];
temp_loc.x =-400 + random(800);
temp_loc.y =-400 + random(800);
temp_loc.z = 0;
ifdef SERVER;
if (connection != 1) // only create a guard on the client/server
{
player = ent_create(str_guard,temp_loc,move_player);
}
ifelse;
player = ent_create(str_cbabe,temp_loc,move_player);
endif;

while (!player)
{wait(1);} // sleep until the player is initialized

wait(1); // give everything a chance to get started before we allow the player to move

move_camera (); // attach a camera to the player
//
}

function move_camera()
{
while (player == NULL)
{
wait (1);
}


while (player != NULL) // player exist?
{
player.x += key_force.y*5; // get force x
player.y += -key_force.x*5; // get force y
player.z = 0; // force z always 0 for now
player.pan+=mouse_force.x*10;
camera.x = player.x - cos (player.pan) * 200;
camera.y = player.y - sin (player.pan) * 200;
camera.z = player.z + 75;
camera.pan = player.pan;
wait (1);
}

}









Posted By: giorgi3

Re: How do I show 4 login entities? - 01/23/07 21:59

I think you need to wait for at least .5 to 1.0 seconds after you create an entity before setting the nosend options.

Quote:

When setting this flag immediately after entity creation, the entity can remain invisible on the client because it's file name and position is not sent. For preventing this, set a nosend flag only after the time between two entity updates, given by dplay_entrate, is passed.



Posted By: nkl

Re: How do I show 4 login entities? - 01/24/07 03:39

Hello.
Thanks for your idea.

I try set the wait statement before nosend=on from wait(1) to wait(-1).
But the problem is still happen.
And then I try set the wait statement before nosend=on from wait(1) to wait(-5).
But the problem is still happen.

Thanks for any advice on this problem.
Thanks already.
Posted By: nkl

Re: How do I show 4 login entities? - 01/25/07 19:19

can anyone help with this?
© 2024 lite-C Forums