Ent_create with no_send=on doesn’t creates an a global entity on all connected clients.
Hello.
I am registered A6 pro user.
I use A6 Pro Edition V6.50.6.
I want to reduce the network bandwidth and lag.
I use Ent_create with no_send=on that beats bandwidth.
I write my own movement script for the clients that beats lag.
I have 4 computers.
In computer 1, I start the program in –sv mode.
And then on other 3 computer I start the program in -cl mode.
I find it doesn’t create a global entity on all 3 connected clients.
I want to figure out what cause the problem.
I delete my own movement script.
And test again.
The problem is still happen.
When I delete the no_send=on statement, and test again.
This time I find it can create a global entity on all 3 connected clients.
How do I use Ent_create with no_send=on to creates a global entity on all 3 connected clients.

Thanks for any advice on this problem.
Thanks already.

Following is whole script.
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(1)
{
wait(1);
}
}
//
function move_player()
{
//---
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;
//----
wait(1);
proc_local(my,ghost_player);
//
while (1)
{
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;

wait(-0.5);
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);
}

}










Last edited by nkl; 01/23/07 06:39.