Make colored staring territories with "neutral" SC's.It's not necessary for a variant to work, but it makes a nice map that shows a historical occupation, but keeps the "Home"-SCs for players at a reasonable size.Here's an example (Chungking is neutral, but it's colored as Chinese) :

Attachment:

example.png [ 1.87 KiB | Viewed 1932 times ]

The box is a PNG-file (one for the smallmap and one for the largemap) you have to put in your resources directory.Here are the icons:

// Set the transparent backgrounds for all the images and after that the background for the neutral-SC image protected function setTransparancies() { parent::setTransparancies(); $this->setTransparancy($this->sc); }

/* There are territories on the map that belong to a country but have a supply-center that is considered "neutral" ** They are set to owner "Neutral" in the installation-file and because of that would get drawn in the neutral-color ** We need to check if they are still "neutal" and paint the territory in the color of the country they "should" belong to. ** after that we draw the "neutral-sc-image" on the map. ** ** terrID is the ID of the territory, and if countryID is still 0 it's still neutral and we need to set the countryID to the owner ** it should belong before we call the original paint routine. $sx and $sy are the coordinates the neutral-box is drawn ** after we colored the territory */ public function ColorTerritory($terrID, $countryID) { if ($terrID == 4 && $countryID == 0 && $this->smallmap) { $sx=205; $sy=482; $countryID=1; } // Patagonia smallmap elseif ($terrID == 4 && $countryID == 0 && !$this->smallmap) { $sx=349; $sy=825; $countryID=1; } // Patagonia largemap elseif ($terrID == 5 && $countryID == 0 && $this->smallmap) { $sx=190; $sy=342; $countryID=1; } // San Miguel de Tucuman elseif ($terrID == 5 && $countryID == 0 && !$this->smallmap) { $sx=312; $sy=585; $countryID=1; } // " largemap

parent::ColorTerritory($terrID, $countryID); $this->nsc[$terrID]=0;

// Did we set a sx? If yes we need to draw the box and set nsc of this terrID to 1 // if nsc is 1 we know that territory is considered neutral, but is colored if (isset($sx)) { $this->putImage($this->sc, $sx, $sy); $this->nsc[$terrID]=1; }

}

/* No need to draw the country flags for "neural-SC-territories if they get occupied by ** the country they should belong to ** That means nsc of that territory is 1 and there is a unit from that player on this territory. ** Normally it would draw a flag, because the territory is "neutral" This is to prevent this behaviour */ public function countryFlag($terrID, $countryID) { if (($this->nsc[4] == 1) && ($terrID == 4) && ( $countryID == 1)) return; if (($this->nsc[5] == 1) && ($terrID == 5) && ( $countryID == 1)) return; parent::countryFlag($terrID, $countryID); }

I did quite some improvements to some of the snippets and added the "neutral units" too.But it's a pain to update this thread every time I change something. So made just a download-package on my homepage. (http://olidip.net/download.php)

Who is online

Users browsing this forum: No registered users and 1 guest

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum