Sections for various scenarios in mulplayer. Can Help-me?

Posted By: NeoNeper

Sections for various scenarios in mulplayer. Can Help-me? - 06/07/12 20:00

I have many doubts about the "mulplayers" using sections.
I do not know where or when I use "session_open", and the "session_connect."
Do not know if any of them call on the server, or all of the client.
I've tried several different ways, but am not having success.

> In a "dataBase" I signed a few names that are references to scenarios which players can connect.
> Each of these names is amount to a "WMB"
> When a player enters, he can choose one of these scenarios in a list, and when selected this scenario "WMB" is loaded into it.
If another player to choose this same scenario, both will be connectados in the same scenario, and will be able to interact with each other.

My problem is just load these scenarios.
I saw in the documentation that using A8 Litec "seession_connect" and "session_open", I could connect the players in different scenarios, but there is no better example for full understanding.

All the ways I tried here were frustrated and so I come to ask help from the community.

Can Help-me?
I'll post my last attempt, so you can evaluate where I am wrong, and so can help me better!


Code:
function main(){

	if (!connection)
	{

		str_cpy(messages_str, "Can't find any server. Please try again later.");
		wait (-4);
		sys_exit(NULL);

	}  	
	if (connection == 1) //Server
	{
		
		if (session_open("city_demo"))
		{			
			level_load("ignia.wmb"); // load level anew
			while (dplay_status < 8) wait(1);
			dplay_localfunction = 2;
		
		}

	} 
	if (connection == 2) //Client Connection
	{

		
		if (session_connect("city_demo","localhost"))
		{
			dplay_localfunction = 2;
			level_load("ignia.wmb"); // load level anew		
			while (dplay_status < 4) wait(1); // wait until the level state is received from the server
			
    		player = ent_create("warlock.mdl",vector(0,0,100),moveplayer);	
		wait(1);//wait util a function
	
		while(!player){wait(1);}
	        ent_createlocal("target_ring.mdl",_vec(player.x,player.y,player.z),func_seletor);	

		camera.arc=90;
		camera.x = player.x-50;
		camera.y = player.y-50;
		camera.z = player.z + 120;
	        camera.tilt = -27;
		
		
		
		}

	} 
}


In this example , he Connect the world and create my player, but does not perform the function of the player.
But my doubts persist as to whether this really is the correct way, I come to ask for your help.
Posted By: MasterQ32

Re: Sections for various scenarios in mulplayer. Can Help-me? - 06/07/12 20:05

first question:
session_open / session_connect is the runtime version of -sv and -cl parameters
session_open creates a server,
session_connect connects to a server
Posted By: NeoNeper

Re: Sections for various scenarios in mulplayer. Can Help-me? - 06/07/12 20:10

Yes I am using the parameters (-sv-ip localhost) to the server and (-cl-ip localhost) to the client.
I edited the post I put a Previous and example of my last test performed, so you can get a better idea and can help me
Posted By: NeoNeper

Re: Sections for various scenarios in mulplayer. Can Help-me? - 06/09/12 16:30

Nothing? Somebody?
Posted By: NeoNeper

Re: Sections for various scenarios in mulplayer. Can Help-me? - 06/10/12 20:48

Hello friends. I still eat this doubt.
> I am also another problem

When I'm running mode (-sv) I can not perform the function attached to the entities..

EX:
I running server in (-sv) mode.
Affter i Running the Client in mode (-cl)
However, the functions of the entities are not running.
Sample:
my = ent_create ("warlock.mdl", vector (100, 50, 40), move_players);

The Function move_players no work.

IF i Running in mode (-cl -sv) ALL functions Begin to running

Can anyone help me?
Posted By: FoxHound

Re: Sections for various scenarios in mulplayer. Can Help-me? - 06/10/12 20:51

Get into the workshops http://tutorial.3dgamestudio.net/ and do 25. When done do it again. Multiplayer is hard. Even when it is made as easy as 3dgs does it. Next stop using -cl and -sv. These are crutches and not something you can use for the final game, so no need to start with them either. Put up a panel with two buttons, one says server and other says client and have those functions start the game as described. Again, Multiplayer is hard and will take a lot of studying. It can be done though, I've done it and so can you.
Posted By: NeoNeper

Re: Sections for various scenarios in mulplayer. Can Help-me? - 06/11/12 18:46

Thanks for responding.
But I already have a project ready, based on Client Server, where my server is also a client and other clients interact.
I'm not any doubt in this style of play.
My question refers to games where I only own a SERVER (-sv) and Not a (Server Client) (-sv -cl).

I have not found any AUM and also found nothing about this in the official manual.
I no found no example about it.

All the examples I find to by on servers that are also customers (-sv -cl)
I am wanting to Develop a project in Which I own the server that is not a CUSTOMER.

As I said earlier, when I try, the functions of the bodies have not been executed. I do not know what to do to fix it.

Note that the code I posted in the first POST has no connection type (3);
Only (1) = Server and (2 ) = Client. END. No Have a connection (3) = Client / Server.
In this example, the function of the entity (move players) No work.
And ALL Functions for Entityes also no Works.

You can try to help me please:??
© 2023 lite-C Forums