LAN game with more than 2 players .. how?
Moderator: Moderators
-
- Spring Developer
- Posts: 374
- Joined: 14 Mar 2005, 12:32
LAN game with more than 2 players .. how?
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 ...
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 ...
Last edited by colorblind on 29 May 2005, 18:08, edited 1 time in total.
-
- Spring Developer
- Posts: 374
- Joined: 14 Mar 2005, 12:32
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):
But when I naievly change it to 3 commanders, i.e.
then Spring crashes the moment the game begins. So much for bright naiev ideas ...
Any help is appreciated.
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;
}
}
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;
}
}
Any help is appreciated.
It's this line:
needs to be:
There are only two sides, "Arm" and "Core"
There is no third side :)
Tell me how that goes.
-Buggi
Code: Select all
string s2=p.SGetValueDef("corcom","side2\\commander");
Code: Select all
string s2=p.SGetValueDef("corcom","side1\\commander");
There is no third side :)
Tell me how that goes.
-Buggi
-
- Spring Developer
- Posts: 374
- Joined: 14 Mar 2005, 12:32
Thanks for the input! Ok, so I changed that and the line
to
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.
Code: Select all
unitLoader.LoadUnit(s2,float3(x2,80,z2),2,false);
Code: Select all
unitLoader.LoadUnit(s2,float3(x2,80,z2),1,false);
-
- Spring Developer
- Posts: 374
- Joined: 14 Mar 2005, 12:32
I've posted a request in the dev forum: http://taspring.clan-sy.com/phpbb/viewtopic.php?t=1298
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
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
- PauloMorfeo
- Posts: 2004
- Joined: 15 Dec 2004, 20:53
I think this might do. You may want to change a few thigns, though, like player names or something (and maybe mapname!?).Tsumari wrote:Can someone upload a link to a script that say places 4 commanders on a map? ...
[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]
{
}
}
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
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
- PauloMorfeo
- Posts: 2004
- Joined: 15 Dec 2004, 20:53
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.Durandal wrote:I still can't figure out the numbers ... I'm stupid...
What numbers don't you understand? Probably someone, if not me, can help you get what they mean.
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... ?)
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... ?)
Last edited by mongus on 28 Jul 2005, 01:48, edited 1 time in total.