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
4 registered members (degenerate_762, AbrahamR, AndrewAMD, ozgur), 667 guests, and 8 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
How do I show 4 login entities? #108284
01/20/07 17:12
01/20/07 17:12
Joined: Oct 2003
Posts: 206
N
nkl Offline OP
Member
nkl  Offline OP
Member
N

Joined: Oct 2003
Posts: 206
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);
}

}










Last edited by nkl; 01/20/07 17:14.
Re: How do I show 4 login entities? [Re: nkl] #108285
01/23/07 21:59
01/23/07 21:59
Joined: Jan 2003
Posts: 517
Illinois
G
giorgi3 Offline
User
giorgi3  Offline
User
G

Joined: Jan 2003
Posts: 517
Illinois
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.





Giorgi3

10,000 parts flying in a close formation does not constitute an airplane. Some assembly is required.
Re: How do I show 4 login entities? [Re: giorgi3] #108286
01/24/07 03:39
01/24/07 03:39
Joined: Oct 2003
Posts: 206
N
nkl Offline OP
Member
nkl  Offline OP
Member
N

Joined: Oct 2003
Posts: 206
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.

Re: How do I show 4 login entities? [Re: nkl] #108287
01/25/07 19:19
01/25/07 19:19
Joined: Oct 2003
Posts: 206
N
nkl Offline OP
Member
nkl  Offline OP
Member
N

Joined: Oct 2003
Posts: 206
can anyone help with this?


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