Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
0 registered members (), 18,767 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
fog in multiplayer game #315454
03/15/10 17:06
03/15/10 17:06
Joined: Sep 2009
Posts: 496
P
Progger Offline OP
Senior Member
Progger  Offline OP
Senior Member
P

Joined: Sep 2009
Posts: 496
Hi i need to know how i can make fog on the client because this action only works on the server
to make it run i created an object with behaviour Nebel but it do not work on the client ):
pls help


function Nebel()
{

while (1)
{

if (player.z<0)
{
camera.fog_start=100;
fog_color=2;
camera.fog_end=1000;
}
else
{
fog_color=0;
}
wait(1);
}
}
MFG Progger laugh


asking is the best Way to get help laugh laugh laugh
Re: fog in multiplayer game [Re: Progger] #315530
03/16/10 13:16
03/16/10 13:16
Joined: Sep 2009
Posts: 496
P
Progger Offline OP
Senior Member
Progger  Offline OP
Senior Member
P

Joined: Sep 2009
Posts: 496
can noone help me?


asking is the best Way to get help laugh laugh laugh
Re: fog in multiplayer game [Re: Progger] #315533
03/16/10 13:58
03/16/10 13:58
Joined: Jul 2005
Posts: 1,930
Austria
Dark_samurai Offline
Serious User
Dark_samurai  Offline
Serious User

Joined: Jul 2005
Posts: 1,930
Austria
I'm not familar with the built in multiplayer of gamestudio but I guess that actions are only executed on the server. So why don't you start Nebel() from main()?


ANet - A stable and secure network plugin with multi-zone, unlimited players, voip, server-list features,... (for A7/A8)!
get free version
Re: fog in multiplayer game [Re: Dark_samurai] #315535
03/16/10 14:11
03/16/10 14:11
Joined: Sep 2009
Posts: 496
P
Progger Offline OP
Senior Member
Progger  Offline OP
Senior Member
P

Joined: Sep 2009
Posts: 496
thank you for the answer but it crashs frown frown frown
Another ideas pls i need this
WFG Progger


asking is the best Way to get help laugh laugh laugh
Re: fog in multiplayer game [Re: Progger] #315538
03/16/10 14:53
03/16/10 14:53
Joined: Jul 2005
Posts: 1,930
Austria
Dark_samurai Offline
Serious User
Dark_samurai  Offline
Serious User

Joined: Jul 2005
Posts: 1,930
Austria
With my clairvoyant skills I see that you put Nebel(); before the level_load() function ^^ Why do I know this? Because I guess that the engine crashes because the player pointer is invalid (this means that the player is not created yet).

So improve your function a bit:
Code:
function Nebel()
{

   while (1) 
   {

     if(player != NULL)
     {
         if (player.z<0)
         {
            camera.fog_start=100;
            fog_color=2;
            camera.fog_end=1000;
         }
         else
         {
            fog_color=0; 
         }
      }
      wait(1);
   }
}




ANet - A stable and secure network plugin with multi-zone, unlimited players, voip, server-list features,... (for A7/A8)!
get free version
Re: fog in multiplayer game [Re: Progger] #315539
03/16/10 14:54
03/16/10 14:54
Joined: May 2009
Posts: 445
Peine, Germany
Razoron Offline
Senior Member
Razoron  Offline
Senior Member

Joined: May 2009
Posts: 445
Peine, Germany
Maybe you have to call Nebel() after you loaded your level.

Re: fog in multiplayer game [Re: Razoron] #315543
03/16/10 15:09
03/16/10 15:09
Joined: Sep 2009
Posts: 496
P
Progger Offline OP
Senior Member
Progger  Offline OP
Senior Member
P

Joined: Sep 2009
Posts: 496
@Dark_samurai
No i didnt do it before level_load i did it after it
but it still do not work here is the player code

Code:
function move_Pengu()
{
	var walk_percentage;
	var winken_percentage;
	var sli;  
	var winks;  
	player=my;

	while(1)
	{
		c_move(my, vector(my.skill1, 0, 0), nullvector, IGNORE_PASSABLE | GLIDE);  
		c_move(my,vector(0,0,my.skill5),nullvector,IGNORE_PASSABLE | GLIDE);
		c_move(my,vector(0,0,-20),nullvector,IGNORE_PASSABLE | GLIDE);
		my.pan += my.skill2;
		
		
		
		
		if (my.skill1)
		{
			walk_percentage += 1.5 * my.skill1 * sign(my.skill1);
			ent_animate(my,"walk",walk_percentage, ANM_CYCLE); 
		}
		
		if(my.skill5)
		{
			
			my.tilt=-90;
			sli += 1.5 * my.skill5 * sign(my.skill5);
			ent_animate(my,"slide",sli, ANM_CYCLE); // "walk" animation loop 
		} 
		else
		{
			my.tilt=0;   
			sli=0;
		}
		
		if(my.skill4)
		{
			winks += 1.5 * my.skill4 * sign(my.skill4);
			ent_animate(my,"winken",winks, ANM_CYCLE);
		} 
		ent_sendnow(my);
		wait(1);
	} 
}



@Razoron no i tried this but thanks for trying to help me laugh

and here is function main()

Code:
function main()
{
	fps_max=60;
	ent_createlayer("cubemap+6.tga", SKY | CUBE | SHOW , 1); // create the sky cube
	media_loop("flies.mp3",0,100);
	mouse_map =mouse_pcx;
	mouse_mode = 4;
	video_screen=1;
	video_mode=10;
	level_load("penguinland.WMB");
	on_ctrl  = input_text;
	on_server = server_event;

	
	


	if (!connection) // no server could be found?
	sys_exit(NULL); // then shut down the engine
	if(connection==2)
	{
		Scholle=ent_create ("eis2.mdl", vector (100, 50, 6000),Nebel);
		my= ent_create ("pos.mdl", vector (100, 50, 60), move_Pengu);
		wait(-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;
			my.skill3 = 3*(key_a - key_d)* time_step;
			my.skill4 = 1*(key_h)*time_step;
			my.skill5 = (key_space) * speed*time_step;
			
			send_skill (my.skill1, SEND_VEC); // send skill1...3 to the server
			send_skill(my.skill2,SEND_VEC);
			send_skill(my.skill3,SEND_VEC);		
			send_skill(my.skill5,SEND_VEC);
			
			// send client_fired to the server; even client's bullets are created on the server
			simple_camera(); // call the simple camera function
			wait (1);
		}
	}	

	if(connection==3)
	{
		my=ent_create ("pos.mdl", vector (-100, -50, 40), move_Pengu); // create the blue soldier
		while(1)
		{
			
			my.skill1 = 5 * (key_w - key_s) * time_step;
			my.skill2 = 4 * (key_a - key_d) * time_step;
			my.skill3 = 3*(key_a - key_d)* time_step;
			my.skill4 = 1*(key_h)*time_step;
			my.skill5 = 5*(key_space) * speed*time_step;
			simple_camera();
			
			wait(1);
		}
		
	}
}



Last edited by Progger; 03/16/10 15:11.

asking is the best Way to get help laugh laugh laugh
Re: fog in multiplayer game [Re: Progger] #315554
03/16/10 16:33
03/16/10 16:33
Joined: Sep 2009
Posts: 496
P
Progger Offline OP
Senior Member
Progger  Offline OP
Senior Member
P

Joined: Sep 2009
Posts: 496
i found out that it is not possible to use fog in a multiplayer game if you think it is possible show me it pls


asking is the best Way to get help laugh laugh laugh
Re: fog in multiplayer game [Re: Progger] #315555
03/16/10 16:41
03/16/10 16:41
Joined: Jul 2005
Posts: 1,930
Austria
Dark_samurai Offline
Serious User
Dark_samurai  Offline
Serious User

Joined: Jul 2005
Posts: 1,930
Austria
With ANet it's possible for sure wink


ANet - A stable and secure network plugin with multi-zone, unlimited players, voip, server-list features,... (for A7/A8)!
get free version
Re: fog in multiplayer game [Re: Dark_samurai] #315622
03/17/10 17:17
03/17/10 17:17
Joined: Jul 2006
Posts: 511
Germany,NRW
KMS Offline
User
KMS  Offline
User

Joined: Jul 2006
Posts: 511
Germany,NRW
Ich antworte besser in Deutsch:
Versuche doch mal,eine Dummyentity (cube.mdl)per entcreate zu erzeugen und dieser die function Nebel zuzuweisen! Ich sehe da aber vielleicht ein Problem mit dem Player-Pointer?


You need full animated lowpoly-fishes?Look at
http://www.projekt-3d.de/pages/shop2pag.html
Page 1 of 2 1 2

Moderated by  HeelX, Spirit 

Gamestudio download | 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