my 10 player onlinegame don`t work!!!

Posted By: MDMDFSS

my 10 player onlinegame don`t work!!! - 06/10/09 19:30

Wenn I start my server.bat, it serches for clients but then there stands:

original text:
level.exe hat ein Problem festgestellt und muss beendet werden!

text on english:
level.exe has found a problem and musst be shutdown!

hir is my script, mabby there is the problem:

__________________________________________________________________
Code:
#include <acknex.h> 
#include <default.c>

var earth_gravity[3] = 0,0, -887;

var client_ent = 0; 
var server_fired = 0; 
var client_fired = 0; 
var bullet_pan; 


string bullet_mdl = <bullet.mdl>; 
string muzzle_pcx = <muzzle.pcx>;
string redsoldier = <redsoldier.mdl>;
string bluesoldier = <bluesoldier.mdl>;
string gun1 = <gun1.mdl>;


function fire_bullets(); 
function move_bullets(); 
function remove_bullets(); 
function display_muzzle(); 
function gunfunction();


entity* player;
entity* weapon1; 


function damage_players()
{

	if (you.skill99 != 1234) {return;} 

	my.skill10 = 0; 
}

function move_players() 
{ 
		var movement_speed = 7;
	phent_settype(my,PH_BOX);
	ph_setgravity( earth_gravity ); 
	phent_setmass(my,30,PH_BOX);
	{
	player = my; 
	ent_create("gun1.mdl",my.x, gunfunction);
	my.enable_scan = on;
	my.event = damage_players;
	my.skill40 = 100; 
	while (my.skill40 > 0)
	{
		player.pan -= 7 * mouse_force.x * time;
		camera.x = player.x;
		camera.y = player.y;
		camera.z = player.z + 50 + 1.1 * sin(my.skill44); 
		camera.pan = player.pan;
		camera.tilt += 5 * mouse_force.y * time;
		vec_set (temp.x, my.x); 
		temp.z -= 10000;
		temp.z = -c_trace (my.x, temp.x, ignore_me | ignore_passable | use_box);
		temp.x = movement_speed * (key_w - key_s) * time;
		temp.y = movement_speed * (key_a - key_d) * 0.6 * time;
		c_move (my, temp.x, nullvector, ignore_passable | glide);
		if (key_w + key_s > 0) 
		{
			my.skill44 += 25 * time;
			ent_cycle("run", my.skill46);
			my.skill46 += 5 * time;
			my.skill46 %= 100; 
		}
		else 
		{
			ent_cycle("stand", my.skill48); 
			my.skill48 += 2 * time; 
			my.skill48 %= 100; 
		}
		wait (1);
	}
	
	my.skill40 = 0; 
	while (my.skill40 < 90)
	{ 
		ent_cycle("death", my.skill40);
		my.skill40 += 2 * time; 
		camera.x = player.x;
      camera.y = player.y;
      camera.z = player.z + 300; 
      camera.pan = player.pan;
      camera.tilt = -90;
      camera.roll = 0;
		ent_sendnow(my);
		wait (1); 
	} 
}		

function main() 
{
	fps_max = 60; 
	level_load ("level.wmb");
	if (connection == 2)  
	{
		my = ent_create ("bluesoldier.mdl", vector (100, 50, 40), move_players); 
		wait (-0.5); 
		client_ent = handle(my); 
		send_var (client_ent); 
		while (1) 
		{
			my.skill1 = 5 * (key_w - key_s) * time_step;
			my.skill2 = 4 * (key_a - key_d) * time_step;
			
			send_skill (my.skill1, SEND_VEC); 
			send_var (client_fired); 
			wait (1);
		}
	}
	if (connection == 3)  
	{
		my = ent_create ("bluesoldier.mdl", vector (-100, -50, 40), move_players); 
		wait (-0.5); 
		client_ent = handle(my); 
		send_var (client_ent); 
		while (1) 
		{
			my.skill1 = 5 * (key_w - key_s) * time_step;
			my.skill2 = 4 * (key_a - key_d) * time_step;
			
			send_skill (my.skill1, SEND_VEC); 
			send_var (client_fired); 
			wait (1);
		}
	}
	if (connection == 4)  
	{
		my = ent_create ("bluesoldier.mdl", vector (50, 100, 40), move_players); 
		wait (-0.5); 
		client_ent = handle(my); 
		send_var (client_ent); 
		while (1) 
		{
			my.skill1 = 5 * (key_w - key_s) * time_step;
			my.skill2 = 4 * (key_a - key_d) * time_step;
			
			send_skill (my.skill1, SEND_VEC); 
			send_var (client_fired);
			wait (1);
		}
	}
	if (connection == 5)  
	{
		my = ent_create ("bluesoldier.mdl", vector (-50, -100, 40), move_players); 
		wait (-0.5); 
		client_ent = handle(my); 
		send_var (client_ent); 
		while (1) 
		{
			
			my.skill1 = 5 * (key_w - key_s) * time_step;
			my.skill2 = 4 * (key_a - key_d) * time_step;
			
			send_skill (my.skill1, SEND_VEC); 
			send_var (client_fired); 
			wait (1);
		}
   }
   	if (connection == 6)  
	{
		my = ent_create ("bluesoldier.mdl", vector (25, 50, 40), move_players); 
		wait (-0.5); 
		client_ent = handle(my); 
		send_var (client_ent); 
		while (1) 
		{
			my.skill1 = 5 * (key_w - key_s) * time_step;
			my.skill2 = 4 * (key_a - key_d) * time_step;
			
			send_skill (my.skill1, SEND_VEC); 
			send_var (client_fired);
			wait (1);
		}
	}
	if (connection == 7)  
	{
		my = ent_create ("bluesoldier.mdl", vector (-25, -50, 40), move_players); 
		wait (-0.5); 
		client_ent = handle(my); 
		send_var (client_ent); 
		while (1) 
		{
			
			my.skill1 = 5 * (key_w - key_s) * time_step;
			my.skill2 = 4 * (key_a - key_d) * time_step;
			
			send_skill (my.skill1, SEND_VEC); 
			send_var (client_fired); 
			wait (1);
		}
   }	
   	if (connection == 8)  
	{
		my = ent_create ("bluesoldier.mdl", vector (50, 25, 40), move_players); 
		wait (-0.5); 
		client_ent = handle(my); 
		send_var (client_ent); 
		while (1) 
		{
			my.skill1 = 5 * (key_w - key_s) * time_step;
			my.skill2 = 4 * (key_a - key_d) * time_step;
			
			send_skill (my.skill1, SEND_VEC); 
			send_var (client_fired);
			wait (1);
		}
	}
	if (connection == 9)  
	{
		my = ent_create ("bluesoldier.mdl", vector (-50, -25, 40), move_players); 
		wait (-0.5); 
		client_ent = handle(my); 
		send_var (client_ent); 
		while (1) 
		{
			
			my.skill1 = 5 * (key_w - key_s) * time_step;
			my.skill2 = 4 * (key_a - key_d) * time_step;
			
			send_skill (my.skill1, SEND_VEC); 
			send_var (client_fired); 
			wait (1);
		}
   }	
   if (connection == 10)  
	{
		my = ent_create ("bluesoldier.mdl", vector (-50, -50, 40), move_players); 
		wait (-0.5); 
		client_ent = handle(my); 
		send_var (client_ent); 
		while (1) 
		{
			
			my.skill1 = 5 * (key_w - key_s) * time_step;
			my.skill2 = 4 * (key_a - key_d) * time_step;
			
			send_skill (my.skill1, SEND_VEC); 
			send_var (client_fired); 
			wait (1);
		}
   }	
   if (connection == 11)  
	{
		my = ent_create ("bluesoldier.mdl", vector (50, 50, 40), move_players); 
		wait (-0.5); 
		client_ent = handle(my); 
		send_var (client_ent); 
		while (1) 
		{
			
			my.skill1 = 5 * (key_w - key_s) * time_step;
			my.skill2 = 4 * (key_a - key_d) * time_step;
			
			send_skill (my.skill1, SEND_VEC); 
			send_var (client_fired); 
			wait (1);
		}
   }
      }
      
   action gun
   {
   	my.enable_impact = on; 
      my.enable_sonar = on;
      my.event = gunfunction;
}
    
   function gunfunction()
{
	weapon1 = my; 
	var player1_pos; 
	var player2_pos; 
	var weapon_height;
	var weapon_offset;
	while (player == null) {wait (1);} 
	while (1)
	{ 
	vec_for_vertex (my.skill1, you, 28);
   
   vec_for_vertex (my.skill4, you, 9); 
   
		if (vec_dist (player1_pos.x, player2_pos.x) != 0) 
		{
			weapon_height += 30 * time; 
			weapon_offset.z += 0.3 * sin(weapon_height); 
		}
		vec_rotate (weapon_offset.x, vector (camera.pan, camera.tilt, 0)); 
		vec_add (weapon_offset.x, camera.x); 
		vec_set (my.x, weapon_offset.x); 
		my.pan = camera.pan; 
		my.tilt = camera.tilt;
		vec_set (player2_pos.x, player.x); 
		wait (1);
	}
}

on_mouse_left = fire_bullets; 

function fire_bullets()
{
	while (mouse_left == on) 
	{
		vec_for_vertex (temp.x, weapon1, 29); 
	   
		ent_create (bullet_mdl, temp.x, move_bullets);
		ent_create (muzzle_pcx, temp.x, display_muzzle);  
		sleep (1); 
	}
	
   if (connection == 2) 
	{
		client_fired = 1; 
		wait (1);
		client_fired = 0;
	}
	if (connection == 3) 
	{
		client_fired = 1; 
		wait (1);
		client_fired = 0;
	}
	if (connection == 4) 
	{
		client_fired = 1; 
		wait (1);
		client_fired = 0;
	}
	if (connection == 5) 
	{
		client_fired = 1; 
		wait (1);
		client_fired = 0;
	}
	if (connection == 6) 
	{
		client_fired = 1; 
		wait (1);
		client_fired = 0;
	}
	if (connection == 7) 
	{
		client_fired = 1; 
		wait (1);
		client_fired = 0;
	}
	if (connection == 8) 
	{
		client_fired = 1; 
		wait (1);
		client_fired = 0;
	}
	if (connection == 9) 
	{
		client_fired = 1; 
		wait (1);
		client_fired = 0;
	}
	if (connection == 10) 
	{
		client_fired = 1; 
		wait (1);
		client_fired = 0;
	}
	if (connection == 11) 
	{
		server_fired = 1; 
		wait (1);
		server_fired = 0;
	}
}

function move_bullets()
{
	var bullet_speed; 
	my.enable_impact = on; 
	my.enable_entity = on; 
	my.enable_block = on; 
	my.event = remove_bullets; 
	my.pan = camera.pan; 
	my.tilt = camera.tilt; 
	bullet_speed.x = 200 * time; 
	bullet_speed.y = 0; 
	bullet_speed.z = 0; 
	while (my != null) 
	{
		
		c_move (my, bullet_speed, nullvector, ignore_passable);
		wait (1);
	}
}

function remove_bullets() 
{
	wait (1);
	
	phent_settype(my,PH_RIGID,PH_BOX);
	ph_setgravity( earth_gravity ); 
	phent_setmass(my,2,PH_BOX);
	phent_setfriction(my,46);
	phent_setelasticity(my,45,35);
	phent_setdamping(my,25,25);
	sleep (15); 
	ent_remove (my); 
}

function display_muzzle()
{
	my.passable = on; 
	my.flare = on; 
	my.bright = on; 
	my.ambient = 100; 
	my.oriented = on; 
	my.pan = weapon1.pan; 
	my.tilt = weapon1.tilt; 
	my.roll = random(360); 
	my.scale_x = 0.5; 
	my.scale_y = my.scale_x; 
	my.scale_z = my.scale_z; 
	weapon1.ambient = 100; 
	wait (2); 
	weapon1.ambient = 0; 
	ent_remove (my); 
}

action sandbag
{
	
	phent_settype(my,PH_RIGID,PH_BOX);
	ph_setgravity( earth_gravity ); 
	phent_setmass(my,40,PH_BOX);
	phent_setfriction(my,5);
	phent_setelasticity(my,13,7);
	phent_setdamping(my,47,44);
}


_____________________________________________________________

Hop somebody could help.
thanks..._______________________
Posted By: slacer

Re: my 10 player onlinegame don`t work!!! - 06/10/09 20:08

Hi,

you should tell us which engine version you use.
From your profile it must be A6 and if you want to use physics and networking for 10 players, you would need A6 Pro.

Can you confirm that you use A6 Pro with .wdl files.
There are a lot of syntax changes for other versions, thats why I ask.
Posted By: KiwiBoy

Re: my 10 player onlinegame don`t work!!! - 06/10/09 20:16

Dunno if it will help but you have ommitted a bracket at the end of your player action.
Then I see lots of loops and waits and I am wondering wouldnt this upset your entire code base as wait changes per frame doesnt it and you have them popping up all over the place so how many frames before they are called to work when you actually need them too ?

As I say, I dont know, Im only a noob.
Posted By: MDMDFSS

Re: my 10 player onlinegame don`t work!!! - 06/10/09 20:31

my energy is A7 pro
Posted By: Sajeth

Re: my 10 player onlinegame don`t work!!! - 06/10/09 20:34

Originally Posted By: MDMDFSS
my energy is A7 pro

QFT
Posted By: slacer

Re: my 10 player onlinegame don`t work!!! - 06/10/09 21:46

Could kiwiboy help you with his comment about the missing bracket?

I noticed, that you still use time instead of time_step and some other things let me think you are still using ancient wdl script.

So - why don't you switch over to lite-c?

Maybe if you start the game with -diag or if you run it from WED you get an error message about something in your code. SED seems to be a bit quiet with the current version - at least for me.
Posted By: Cowabanga

Re: my 10 player onlinegame don`t work!!! - 06/11/09 05:36

Quote:
Maybe if you start the game with -diag or if you run it from WED you get an error message about something in your code. SED seems to be a bit quiet with the current version

Or i have a better idea.

@MDMDFSS:
Can you send your acklog.txt?? So we can see the problem.

@slacer:
And we can see a proof of something. You know what i mean. wink
Posted By: Quad

Re: my 10 player onlinegame don`t work!!! - 06/11/09 07:45

connection variable can only be 0 1 2 or 3

and it's not used that way.
Posted By: MDMDFSS

Re: my 10 player onlinegame don`t work!!! - 06/11/09 09:54

I found the missing bracket

my.skill40 = 0;
while (my.skill40 < 90)
{
ent_cycle("death", my.skill40);
my.skill40 += 2 * time;
camera.x = player.x;
camera.y = player.y;
camera.z = player.z + 300;
camera.pan = player.pan;
camera.tilt = -90;
camera.roll = 0;
ent_sendnow(my);
wait (1);
}
}
}//this is the missing bracket!
Posted By: MDMDFSS

Re: my 10 player onlinegame don`t work!!! - 06/11/09 09:58

Here is my client.bat
client.bat

and server.bat

server.bat
Posted By: Cowabanga

Re: my 10 player onlinegame don`t work!!! - 06/11/09 10:02

...And your acklog.txt??
Posted By: MDMDFSS

Re: my 10 player onlinegame don`t work!!! - 06/11/09 10:10

don`t have one.
I made everything with bat and script.
Posted By: Dark_samurai

Re: my 10 player onlinegame don`t work!!! - 06/11/09 10:20

Insert -diag into the commandline. Then a acklog.txt is automatically created in the folder of your game. Post the content of the acklog.txt here.
© 2024 lite-C Forums