a solution could be to add to the team definitions:
Code: Select all
StartPosition=#;
Moderator: Moderators
Code: Select all
StartPosition=#;
Code: Select all
file.GetDef(startPosType,"0","GAME\\StartPosType");
if(startPosType==2){
for(int a=0;a<gs->activeTeams;++a)
readyTeams[a]=false;
for(int a=0;a<gs->activeTeams;++a)
teamStartNum[a]=a;
SAFE_NEW CStartPosSelecter();
} else {
for(int a=0;a<gs->activeTeams;++a)
readyTeams[a]=true;
if(startPosType==0){ //in order
for(int a=0;a<gs->activeTeams;++a)
teamStartNum[a]=a;
} else { //random order
std::multimap<int,int> startNums;
for(int a=0;a<gs->activeTeams;++a)
startNums.insert(pair<int,int>(gu->usRandInt(),a)); //server syncs these later
int b=0;
for(std::multimap<int,int>::iterator si=startNums.begin();si!=startNums.end();++si){
teamStartNum[si->second]=b;
++b;
}
}
}
Code: Select all
if(startPosType==2){
for(int a=0;a<gs->activeTeams;++a)
gs->Team(a)->startPos=float3(startRectLeft[gs->AllyTeam(a)]*gs->mapx*8,-500,startRectTop[gs->AllyTeam(a)]*gs->mapy*8);
}
Changed by: tvo
Changed at: Wed 22 Aug 2007 22:03:13
Branch: trunk
Revision: 4240
Changed files:
* trunk/Documentation/Spring start.txt
* trunk/rts/Game/GameSetup.cpp
* trunk/rts/Game/GameSetup.h
Comments:
* Add StartPosX and StartPosZ tags to TEAM section of start script (GameSetup),
to be used in combination with the new StartPosType 3 (Choose Before Game).
They are in the range of map coordinates as returned by unitsync.
* Removed the loop that was supposed to initialize the startPos of each team
to the upper left corner of it's start rectangle, because it actually
initialized the startpos to garbage data because gs->mapx and gs->mapy had
not been initialized there yet.
* Add a CGameSetup::StartPosType enumeration so we don't have this mess with
magic numbers in CGameSetup.
* Added a check for startPosType, it is set to 0 (Fixed) if the script sets
it to a value out of range.