Page 1 of 2

LAN game with more than 2 players .. how?

Posted: 27 May 2005, 23:49
by colorblind
Call me stupid, but is there any way to begin a LAN multiplayer game with more than two commanders?
For as I can see the "Commanders 1000 res" script only places two commanders on the map; no more, no less. But when playing with more than two players it would be nice if everyone had his own, instead of having to share one ...

Posted: 27 May 2005, 23:52
by Buggi
You just need to edit the script and recompile.

^_^

-Buggi

Posted: 28 May 2005, 12:13
by Durandal
How does one do that ? I've the exact same problem !

Posted: 28 May 2005, 13:05
by colorblind
Uhm, for info on compiling Spring see these threads:
http://taspring.clan-sy.com/phpbb/viewtopic.php?t=921
http://taspring.clan-sy.com/phpbb/viewtopic.php?t=1200

The relevant part of the code in CommanderScript2 is (lines 21-57):

Code: Select all

void CCommanderScript2::Update(void)
{
	switch(gs->frameNum){
	case 0:
		gs->teams[0]->energy=1000;
		gs->teams[0]->energyStorage=1000;
		gs->teams[0]->metal=1000;
		gs->teams[0]->metalStorage=1000;

		gs->teams[1]->energy=1000;
		gs->teams[1]->energyStorage=1000;
		gs->teams[1]->metal=1000;
		gs->teams[1]->metalStorage=1000;

		CSunParser p;
		p.LoadFile("gamedata\\sidedata.tdf");
		string s0=p.SGetValueDef("armcom","side0\\commander");
		string s1=p.SGetValueDef("corcom","side1\\commander");

		CSunParser p2;
		p2.LoadFile(string("maps\\")+stupidGlobalMapname.substr(0,stupidGlobalMapname.find('.'))+".smd");

		float x0,x1,z0,z1;
		p2.GetDef(x0,"1000","MAP\\TEAM0\\StartPosX");
		p2.GetDef(z0,"1000","MAP\\TEAM0\\StartPosZ");
		p2.GetDef(x1,"1200","MAP\\TEAM1\\StartPosX");
		p2.GetDef(z1,"1200","MAP\\TEAM1\\StartPosZ");

		unitLoader.LoadUnit(s0,float3(x0,80,z0),0,false);
		unitLoader.LoadUnit(s1,float3(x1,80,z1),1,false);

//		unitLoader.LoadUnit("armsam",float3(2650,10,2600),0,false);
//		unitLoader.LoadUnit("armflash",float3(2450,10,2600),1,false);

		break;
	}
}
But when I naievly change it to 3 commanders, i.e.

Code: Select all

void CCommanderScript2::Update(void)
{
	switch(gs->frameNum){
	case 0:
		gs->teams[0]->energy=1000;
		gs->teams[0]->energyStorage=1000;
		gs->teams[0]->metal=1000;
		gs->teams[0]->metalStorage=1000;

		gs->teams[1]->energy=1000;
		gs->teams[1]->energyStorage=1000;
		gs->teams[1]->metal=1000;
		gs->teams[1]->metalStorage=1000;

		gs->teams[2]->energy=1000;
		gs->teams[2]->energyStorage=1000;
		gs->teams[2]->metal=1000;
		gs->teams[2]->metalStorage=1000;


		CSunParser p;
		p.LoadFile("gamedata\\sidedata.tdf");
		string s0=p.SGetValueDef("armcom","side0\\commander");
		string s1=p.SGetValueDef("corcom","side1\\commander");
		string s2=p.SGetValueDef("corcom","side2\\commander");

		CSunParser p2;
		p2.LoadFile(string("maps\\")+stupidGlobalMapname.substr(0,stupidGlobalMapname.find('.'))+".smd");

		float x0,x1,x2,z0,z1,z2;
		p2.GetDef(x0,"1000","MAP\\TEAM0\\StartPosX");
		p2.GetDef(z0,"1000","MAP\\TEAM0\\StartPosZ");
		p2.GetDef(x1,"1200","MAP\\TEAM1\\StartPosX");
		p2.GetDef(z1,"1200","MAP\\TEAM1\\StartPosZ");
		p2.GetDef(x2,"1400","MAP\\TEAM2\\StartPosX");
		p2.GetDef(z2,"1400","MAP\\TEAM2\\StartPosZ");


		unitLoader.LoadUnit(s0,float3(x0,80,z0),0,false);
		unitLoader.LoadUnit(s1,float3(x1,80,z1),1,false);
		unitLoader.LoadUnit(s2,float3(x2,80,z2),2,false);

//		unitLoader.LoadUnit("armsam",float3(2650,10,2600),0,false);
//		unitLoader.LoadUnit("armflash",float3(2450,10,2600),1,false);

		break;
	}
}
then Spring crashes the moment the game begins. So much for bright naiev ideas ...
Any help is appreciated.

Posted: 28 May 2005, 21:41
by Buggi
It's this line:

Code: Select all

string s2=p.SGetValueDef("corcom","side2\\commander");
needs to be:

Code: Select all

string s2=p.SGetValueDef("corcom","side1\\commander"); 
There are only two sides, "Arm" and "Core"

There is no third side :)

Tell me how that goes.

-Buggi

Posted: 28 May 2005, 22:18
by colorblind
Thanks for the input! Ok, so I changed that and the line

Code: Select all

unitLoader.LoadUnit(s2,float3(x2,80,z2),2,false); 
to

Code: Select all

unitLoader.LoadUnit(s2,float3(x2,80,z2),1,false); 
This doesn't crash Spring anymore and gives 3 commanders at 3 different positions. The only problem remaining is that two of them have the same color and are on the same team.

Posted: 28 May 2005, 22:38
by Buggi
That seems cosmetic compared to crashing.

Needs more digging.

-Buggi

Posted: 29 May 2005, 18:15
by colorblind
I've posted a request in the dev forum: http://taspring.clan-sy.com/phpbb/viewtopic.php?t=1298

Posted: 30 May 2005, 14:06
by Kickban
1- Connect to the lobby
2 - Start a game
3 - Exit the game
4 - Now you should have a script.txt in your TAS folder
5 - Open it
6 - Make the needed modifications inside (like the number of side, or the ip of the host)
7 - run 'spring.exe script.txt' or drag and drop the script.txt icon on the spring.exe icon.
8 - And it's all, good hunt :p

Posted: 30 May 2005, 18:48
by Durandal
Tried that, didn't work. Windows loads for a little bit, then does nothing.

Posted: 30 May 2005, 20:00
by Liam
don't drag it to the icon then, in my experience i got the same result when dragging it (which i found odd... something to do with spaces in the file path?)

Posted: 26 Jul 2005, 00:25
by Tsumari
Can someone upload a link to a script that say places 4 commanders on a map? I've got some LAN players but we dont use the battle room system and I don't want to spend forever trying to get the battle room to work just to get the script. I'd appreciate it!

Tsumari

..

Posted: 26 Jul 2005, 01:23
by hrmph
What is wrong with the battleroom, why can't you use it?

Re: ..

Posted: 26 Jul 2005, 01:30
by Torrasque
hrmph wrote:What is wrong with the battleroom, why can't you use it?
I'm making a lan now, but it's on my garage, and I don't have an internet connection.

Tunami :
Have you try Fobbah serveur 1.3 ? It's the one I use,

Posted: 26 Jul 2005, 11:56
by PauloMorfeo
Tsumari wrote:Can someone upload a link to a script that say places 4 commanders on a map? ...
I think this might do. You may want to change a few thigns, though, like player names or something (and maybe mapname!?).
[GAME]
{
Mapname=desertdunes.sm2;
StartMetal=1000;
StartEnergy=1000;
MaxUnits=500;
StartPosType=2;
hostip=80.186.228.95;
hostport=8452;
MyPlayerNum=2;
NumPlayers=7;
NumTeams=6;
NumAllyTeams=3;
[PLAYER5]
{
name=guitarism;
Spectator=0;
team=2;
}
[PLAYER4]
{
name=easynow;
Spectator=0;
team=0;
}
[PLAYER3]
{
name=jtgeddes;
Spectator=0;
team=1;
}
[PLAYER6]
{
name=Kixxe;
Spectator=1;
}
[PLAYER2]
{
name=Paulada;
Spectator=0;
team=3;
}
[PLAYER1]
{
name=Gimli;
Spectator=0;
team=4;
}
[PLAYER0]
{
name=Gpox;
Spectator=0;
team=5;
}
[TEAM0]
{
TeamLeader=4;
AllyTeam=1;
Color=5;
Side=Core;
Handicap=0;
}
[TEAM1]
{
TeamLeader=3;
AllyTeam=2;
Color=4;
Side=Core;
Handicap=0;
}
[TEAM2]
{
TeamLeader=5;
AllyTeam=2;
Color=3;
Side=Arm;
Handicap=0;
}
[TEAM3]
{
TeamLeader=2;
AllyTeam=1;
Color=2;
Side=Arm;
Handicap=0;
}
[TEAM4]
{
TeamLeader=1;
AllyTeam=1;
Color=1;
Side=Arm;
Handicap=0;
}
[TEAM5]
{
TeamLeader=0;
AllyTeam=2;
Color=0;
Side=Core;
Handicap=0;
}
[ALLYTEAM0]
{
NumAllies=0;
}
[ALLYTEAM1]
{
NumAllies=0;
}
[ALLYTEAM2]
{
NumAllies=0;
}
NumRestrictions=0;
[RESTRICT]
{
}
}

Posted: 26 Jul 2005, 16:54
by Tsumari
Thanks. I managed to get it working last night after I posted but it is still really good to have this script posted for everyone.

A LAN server for the battleroom would be nice to help get these games going. LAN play has worked flawlessly so far for my friends, but I have to modify the scripts myself. Not a big deal in itself, though!

Tsumari

Posted: 26 Jul 2005, 20:01
by Durandal
I still can't figure out the numbers ... I'm stupid :| Maybe someone could add this to the Wiki ?

Posted: 26 Jul 2005, 22:54
by PauloMorfeo
Durandal wrote:I still can't figure out the numbers ... I'm stupid :| ...
These numbers seem simple to me. I doubt you're stupid enough to not understand them. You are probably just not getting what they mean.

What numbers don't you understand? Probably someone, if not me, can help you get what they mean.

Posted: 27 Jul 2005, 15:58
by Durandal
Well ... for example, the
[ALLYTEAM0]
{
NumAllies=0;
}
[ALLYTEAM1]
{
NumAllies=0;
}
[ALLYTEAM2]
{
NumAllies=0;
}
part ... Does it mean that everybody's allied with Team 0 ? Or does it mean that nobody has any allies at all ?

Posted: 27 Jul 2005, 21:04
by mongus
Edit: sorry forgot the link.

Here is the link to fobbah client

Can some of you test this and tell us how it goes?
no user feedbak on that thread.

ive tested previous releases and they where buggy but usable...

this is sort of a LAN client/server.

there is a help html that explains how it works,but its not that hard to figuer.

pc1 runs birc.exe
pc1 runs lobbyclient join at pc1's IP
pc1 runs lobbyhost join at pc1's IP(have only one of this running)
pc2 runs lobbyclient join at pc1's IP
someone hosts a game.

(you must disable your firewall, or allow rigth ports... ?)