June 2, 2003, 06:57
|
#1
|
Prince
Local Time: 14:51
Local Date: November 2, 2010
Join Date: Mar 2002
Location: ATM Hawera NZ
Posts: 616
|
What do you think?
I'm trying to compile a ww2 map, on 1. september 1939.
So far i've only cities and amies.
What do you think
Any feedback appreciated.
PS. How do you make alliances via SLIC?
PSS. How do you implent the pilleboxes and barbed wire fences from activision ww2 scn to a another scn?
Thank you
__________________
When it all comes to it, life is nothing more than saltfish - Salka Valka
|
|
|
|
June 2, 2003, 08:34
|
#2
|
Warlord
Local Time: 04:51
Local Date: November 2, 2010
Join Date: Apr 2003
Location: Vienna, proud home of bureaucracy
Posts: 252
|
Hi ískallin!
This is a quick reply concerning the pillbox/barbed-wire question, since I already implemented them to my own mod-in-progress:
Look into the /Scenarios/WW2_something(?)/scenario0000 or /scenario0001 folder (they contain basically the same files with just some different scenario-events).
Find the graphics/sprite-files:
If you have installed the Activision-scen. the tileimps for both the pillbox and the barbed wire are in the TileFile - I am not sure if the original TileFile already contains them.
For the BARBED WIRE you only need the according *.tga's in graphics/pictures (unfortunately I actually haven't installed the Acti-Scen and therefore I can't tell you the numbers - but as far as I remember they included a list to be found in the /sprites-folder). For the BARBED WIRE you will have to find THREE files named like
UPTIxxx.tga
UPTIxxxD.tga
UPTIxxxL.tga
For the PILLBOX you will need the pictures for both the pillbox-ti and the pillbox-unit - something like:
UPTIxxx.tga
UPTIxxxD.tga
UPTIxxxL.tga
AND
UPUPxxxa.tga
UPUPxxxb.tga
and ADDITIONALLY
the pillbox-sprite:
GUxxx.spr
Next you will have to copy the PILLBOX-unit from the scenario's units.txt to your MOD_units.txt.
SPECIAL ISSUE: The pillboxes work by creating a pillbox-unit on the pillbox-tileimp when a defined unit-type moves to the tileimp. As the script doesen't care for the owner of tileimp/unit (yet? - I am thinking but nor actually working on it), the pillboxes can be 'activated' by anyone. IF you use the 'auto-withdraw'-function in diplomod.slc this results in expelled enemy's pillbox-units spread over the enemy's territory, doing nothing and impossible to disband. My temporary solution is providing a special border-guard-unit as a 'pillbox-garrison' (I took the green machinegunner from the same scenario), that won't be built by the AI (which doesen't really matter since we haven't yet and possibly will be unable to teach the AI how to use the pillboxes properly).
If you want to stick with this solution you will also have to provide some 'pillbox-garrison-unit' in your MOD_units.txt and NOT provide it to the AI in their unitbuildlist.txt.
NEWSPRITES: According entry in your MOD_newsprite.txt for the pillbox needed.
TILEIMPS: You will also have to copy the pillbox & barbed wire-entries from the scenario's tileimp.txt to your MOD_tileimp.txt.
Apart from adding some entries to the Great Library and some other textfiles (have a look at the Activision-files again), the main thing will be the following SLIC:
PHP Code:
|
/////////////////////////////////////////////////
// Script for the Invasion of France scenario //
// last update 12-19-00 by Tony Evans //
/////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
//adapted for MoT_Mod 20-Apr-2003: //
// //
// //
//Note 01-June-2003: Check for Airplanes (barbed wire) now performed by //
//IsAirUnit (MG's UnitCheckers from GoodMod) in aihelpers.slc. //
////////////////////////////////////////////////////////////////////////////
//---------------------------------------------------------------------------
// Zeroes out movements points from any land units that move onto Barbed Wire
//-----------------------------------------------------------------------------
HandleEvent(MoveUnits) 'WWBarbedWireMove_F' post {
location_t tmpLoc;
army_t tmpArmy;
unit_t tmpUnit;
int_t numUnits;
int_t checkUnit;
int_t i;
tmpLoc = location[1]; // destination location
if (TileHasImprovement(tmpLoc, TerrainImprovementDB(TILEIMP_BARBED_WIRE))) {
tmpArmy = army[0];
numUnits = tmpArmy.size;
for(i = 0; i < numUnits; i = i + 1) {
GetUnitFromArmy(tmpArmy, i, tmpUnit);
checkUnit = tmpUnit;
if (!IsAirUnit(tmpUnit)) { // if unit is not an airplane
AddMovement(tmpUnit, -1000); // subtract any remaining movement points
}
}
}
}
//-----------------------------------------------------------------------------------
// Creates/Removes Pillbox unit when Infantry moves on/off a Pillbox Tile Improvement
//-------------------------------------------------------------------------------------
HandleEvent(MoveUnits) 'WWActivatePillbox_F' post {
location_t tmpLoc;
location_t tmpLoc2;
army_t tmpArmy;
unit_t tmpUnit;
unit_t pillboxUnit;
int_t numUnits;
int_t unitType;
int_t foundInfantry;
int_t foundPillbox;
int_t infantryLeft;
int_t i;
tmpLoc = location[0]; // start location
tmpLoc2 = location[1]; // destination location
foundInfantry = 0;
foundPillbox = 0;
infantryLeft = 0;
tmpArmy = army[0];
// If the tile left has a Pillbox and no other Infantry remain, kill the Pillbox unit
if (TileHasImprovement(tmpLoc, TerrainImprovementDB(TILEIMP_PILLBOX))) {
numUnits = tmpArmy.size;
for(i = 0; i < numUnits; i = i + 1) {
GetUnitFromArmy(tmpArmy, i, tmpUnit);
unitType = tmpUnit.type;
if (unitType == UnitDB(UNIT_BORDER_GUARD)) { // if unit is Border Guard
infantryLeft = 1;
}
}
if (infantryLeft == 1) {
numUnits = GetUnitsAtLocation(tmpLoc);
for (i = 0; i < numUnits; i = i + 1) {
GetUnitFromCell(tmpLoc, i, tmpUnit);
unitType = tmpUnit.type;
if (unitType == UnitDB(UNIT_BORDER_GUARD)) { // if unit is Border Guard
foundInfantry = 1;
} elseif (unitType == UnitDB(PILLBOX)) {
pillboxUnit = tmpUnit;
}
}
if (foundInfantry == 0 && pillboxUnit.valid) {
KillUnit(pillboxUnit);
}
}
}
// If the destination tile has a Pillbox and doesn't have a Pillbox unit, create one
if (TileHasImprovement(tmpLoc2, TerrainImprovementDB(TILEIMP_PILLBOX))) {
numUnits = tmpArmy.size;
if (numUnits == 12) {
return CONTINUE;
}
for(i = 0; i < numUnits; i = i + 1) {
GetUnitFromArmy(tmpArmy, i, tmpUnit);
unitType = tmpUnit.type;
if (unitType == UnitDB(UNIT_BORDER_GUARD)) { // if unit is Border Guard
foundInfantry = 1;
}
}
if (foundInfantry == 1) {
numUnits = GetUnitsAtLocation(tmpLoc2);
for (i = 0; i < numUnits; i = i + 1) {
GetUnitFromCell(tmpLoc2, i, tmpUnit);
unitType = tmpUnit.type;
if (unitType == UnitDB(PILLBOX)) { // if unit is a Pillbox
return CONTINUE;
}
}
CreateUnit(tmpArmy.owner, UnitDB(PILLBOX), tmpLoc2, 0);
}
}
}
HandleEvent(MoveIntoTransport) 'WWPillboxTransport_F' pre {
location_t tmpLoc;
army_t tmpArmy;
unit_t tmpUnit;
unit_t pillboxUnit;
int_t numUnits;
int_t unitType;
int_t foundInfantry;
int_t foundPillbox;
int_t infantryLeft;
int_t i;
tmpArmy = army[0];
if (ArmyIsValid(tmpArmy)) {
tmpLoc = tmpArmy.location;
foundInfantry = 0;
foundPillbox = 0;
infantryLeft = 0;
// If the tile left has a Pillbox and no other Infantry remain, kill the Pillbox unit
if (TileHasImprovement(tmpLoc, TerrainImprovementDB(TILEIMP_PILLBOX))) {
numUnits = tmpArmy.size;
for(i = 0; i < numUnits; i = i + 1) {
GetUnitFromArmy(tmpArmy, i, tmpUnit);
unitType = tmpUnit.type;
if (unitType == UnitDB(UNIT_BORDER_GUARD)) { // if unit is Border Guard
infantryLeft = infantryLeft + 1;
}
}
if (infantryLeft >= 1) {
numUnits = GetUnitsAtLocation(tmpLoc);
for (i = 0; i < numUnits; i = i + 1) {
GetUnitFromCell(tmpLoc, i, tmpUnit);
unitType = tmpUnit.type;
if (unitType == UnitDB(UNIT_BORDER_GUARD)) { // if unit is Border Guard
foundInfantry = foundInfantry + 1;
} elseif (unitType == UnitDB(PILLBOX)) {
pillboxUnit = tmpUnit;
}
}
foundInfantry = foundInfantry - infantryLeft;
if (foundInfantry == 0 && pillboxUnit.valid) {
KillUnit(pillboxUnit);
}
}
}
}
}
HandleEvent(BoardTransportOrder) 'WWPillboxBoard_F' pre {
location_t tmpLoc;
army_t tmpArmy;
unit_t tmpUnit;
unit_t pillboxUnit;
int_t numUnits;
int_t unitType;
int_t foundInfantry;
int_t foundPillbox;
int_t infantryLeft;
int_t i;
tmpArmy = army[0];
if (ArmyIsValid(tmpArmy)) {
tmpLoc = tmpArmy.location;
foundInfantry = 0;
foundPillbox = 0;
infantryLeft = 0;
// If the tile left has a Pillbox and no other Infantry remain, kill the Pillbox unit
if (TileHasImprovement(tmpLoc, TerrainImprovementDB(TILEIMP_PILLBOX))) {
numUnits = tmpArmy.size;
for(i = 0; i < numUnits; i = i + 1) {
GetUnitFromArmy(tmpArmy, i, tmpUnit);
unitType = tmpUnit.type;
if (unitType == UnitDB(UNIT_BORDER_GUARD)) { // if unit is Border Guard
infantryLeft = infantryLeft + 1;
}
}
if (infantryLeft >= 1) {
numUnits = GetUnitsAtLocation(tmpLoc);
for (i = 0; i < numUnits; i = i + 1) {
GetUnitFromCell(tmpLoc, i, tmpUnit);
unitType = tmpUnit.type;
if (unitType == UnitDB(UNIT_BORDER_GUARD)) { // if unit is Border Guard
foundInfantry = foundInfantry + 1;
} elseif (unitType == UnitDB(PILLBOX)) {
pillboxUnit = tmpUnit;
}
}
foundInfantry = foundInfantry - infantryLeft;
if (foundInfantry == 0 && pillboxUnit.valid) {
KillUnit(pillboxUnit);
}
}
}
}
}
//---------------------------------------------------------
// Stops the moving and disbanding of those pesky Pillboxes
//-----------------------------------------------------------
HandleEvent(MoveUnits) 'WWPillboxStayPut_F' pre {
int_t i;
int_t tmpNum;
int_t unitType;
unit_t tmpUnit;
army_t tmpArmy;
tmpArmy = army[0];
if (ArmyIsValid(tmpArmy)) {
tmpNum = tmpArmy.size;
for(i = 0; i < tmpNum; i = i + 1) {
GetUnitFromArmy(tmpArmy, i, tmpUnit);
unitType = tmpUnit.type;
if (unitType == UnitDB(PILLBOX)) {
return STOP;
}
}
}
}
HandleEvent(DisbandArmyOrder) 'WWDisbandFail_F' pre {
int_t i;
int_t tmpNum;
int_t unitType;
unit_t tmpUnit;
army_t tmpArmy;
location_t tmpLoc;
int_t numUnits;
int_t infantryLeft;
int_t foundInfantry;
unit_t pillboxUnit;
tmpArmy = army[0];
infantryLeft = 0;
foundInfantry = 0;
if (ArmyIsValid(tmpArmy)) {
tmpLoc = tmpArmy.location;
// If the tile left has a Pillbox and no other Infantry remain, kill the Pillbox unit
if (TileHasImprovement(tmpLoc, TerrainImprovementDB(TILEIMP_PILLBOX))) {
numUnits = tmpArmy.size;
for(i = 0; i < numUnits; i = i + 1) {
GetUnitFromArmy(tmpArmy, i, tmpUnit);
unitType = tmpUnit.type;
if (unitType == UnitDB(UNIT_BORDER_GUARD)) { // if unit is Border Guard
infantryLeft = infantryLeft + 1;
} elseif (unitType == UnitDB(PILLBOX)) { // Stop disbanding if Pillbox unit is in army
return STOP;
}
}
if (infantryLeft >= 1) {
numUnits = GetUnitsAtLocation(tmpLoc);
for (i = 0; i < numUnits; i = i + 1) {
GetUnitFromCell(tmpLoc, i, tmpUnit);
unitType = tmpUnit.type;
if (unitType == UnitDB(UNIT_BORDER_GUARD)) { // if unit is Border Guard
foundInfantry = foundInfantry + 1;
} elseif (unitType == UnitDB(PILLBOX)) {
pillboxUnit = tmpUnit;
}
}
foundInfantry = foundInfantry - infantryLeft;
if (foundInfantry == 0 && pillboxUnit.valid) {
KillUnit(pillboxUnit);
}
}
}
}
}
HandleEvent(DisbandUnit) 'WWDisbandFail2_F' pre {
unit_t tmpUnit;
unit_t tmpUnit2;
int_t unitType;
int_t unitType2;
location_t tmpLoc;
int_t infantryLeft;
int_t foundInfantry;
int_t numUnits;
unit_t pillboxUnit;
int_t i;
tmpUnit = unit[0];
unitType = tmpUnit.type;
tmpLoc = tmpUnit.location;
infantryLeft = 0;
foundInfantry = 0;
// If the tile left has a Pillbox and no other Infantry remain, kill the Pillbox unit
if (TileHasImprovement(tmpLoc, TerrainImprovementDB(TILEIMP_PILLBOX))) {
if (unitType == UnitDB(PILLBOX)) {
return STOP; // Stop disbanding of Pillbox unit
} elseif (unitType == UnitDB(UNIT_BORDER_GUARD)) { // if unit is Border Guard
infantryLeft = 1;
}
if (infantryLeft == 1) {
numUnits = GetUnitsAtLocation(tmpLoc);
for (i = 0; i < numUnits; i = i + 1) {
GetUnitFromCell(tmpLoc, i, tmpUnit2);
unitType2 = tmpUnit2.type;
if (unitType2 == UnitDB(UNIT_BORDER_GUARD)) { // if unit is Border Guard
foundInfantry = foundInfantry + 1;
} elseif (unitType2 == UnitDB(PILLBOX)) {
pillboxUnit = tmpUnit2;
}
}
if (foundInfantry >= 2 && pillboxUnit.valid) {
KillUnit(pillboxUnit);
}
}
}
}
|
Please NOTE that you will have to replace the check for airunits in the first function (barbed wire) with your own ckeck if you don't use Martin G.'s UnitCheckers (from GoodMod) in your MOD.
Well I hope & think I forgot nothing important so far. To achieve the demanded text length for today here is another piece of SLIC: Since we are very glad about our abilities to build advanced military facilities we don't want our ignorant mayors to build odd things like farms and shopping centers over them:
PHP Code:
|
////////////////////////////////////////////////////////////////////////////////////////////////
// Prevents the building of tile improvements over forts, military camps, barbed wires, //
// pillboxes, air bases and villages - except for the replacement of one of these 'military' //
// ti's by another one and except for roads, railroads, maglevs. //
// //
// Code snippets from City Expansion by BlueO, Pedrunn and IW //
// Adapted for preserveforts.slc by BureauBert 22-Apr-2003 //
////////////////////////////////////////////////////////////////////////////////////////////////
int_f TileHasFort(location_t tmpLoc) {
if(TileHasImprovement(tmpLoc, TerrainImprovementDB(TILEIMP_FORTIFICATIONS))
|| TileHasImprovement(tmpLoc, TerrainImprovementDB(TILEIMP_MILITARY_CAMPS))
|| TileHasImprovement(tmpLoc, TerrainImprovementDB(TILEIMP_BARBED_WIRE))
|| TileHasImprovement(tmpLoc, TerrainImprovementDB(TILEIMP_PILLBOX))
|| TileHasImprovement(tmpLoc, TerrainImprovementDB(TILEIMP_AIR_BASES))
|| TileHasImprovement(tmpLoc, TerrainImprovementDB(TILEIMP_VILLAGE))) {
return 1;
} else {
return 0;
}
}
HandleEvent(CreateImprovement) 'DontLetPlaceImpsOverForts' pre {
if(TileHasFort(location[0]) == 1) {
if(value[0] == TerrainImprovementDB(TILEIMP_ROAD)
|| value[0] == TerrainImprovementDB(TILEIMP_RAILROAD)
|| value[0] == TerrainImprovementDB(TILEIMP_MAGLEV)
|| value[0] == TerrainImprovementDB(TILEIMP_UNDERSEA_TUNNEL)
|| value[0] == TerrainImprovementDB(TILEIMP_FORTIFICATIONS)
|| value[0] == TerrainImprovementDB(TILEIMP_MILITARY_CAMPS)
|| value[0] == TerrainImprovementDB(TILEIMP_BARBED_WIRE)
|| value[0] == TerrainImprovementDB(TILEIMP_PILLBOX)
|| value[0] == TerrainImprovementDB(TILEIMP_AIR_BASES)
|| value[0] == TerrainImprovementDB(TILEIMP_VILLAGE)) {
// really odd: != does not work in the above statements
}
else {
return STOP;
}
}
}
|
Note that you will most likely have to remove villages and military camps from the above list.
I hope this helps - good luck and have fun!
|
|
|
|
June 2, 2003, 11:23
|
#3
|
Prince
Local Time: 14:51
Local Date: November 2, 2010
Join Date: Mar 2002
Location: ATM Hawera NZ
Posts: 616
|
Thanks BureauBert, i'll try that.
Oh and i forgot to mention that the scn is for now only playable with WAW but i'll change that in beta version.
__________________
When it all comes to it, life is nothing more than saltfish - Salka Valka
|
|
|
|
June 2, 2003, 12:46
|
#4
|
Super Moderator
Local Time: 04:51
Local Date: November 2, 2010
Join Date: Mar 2001
Location: Tübingen, Germany
Posts: 6,206
|
Quote:
|
Originally posted by BureauBert
If you have installed the Activision-scen. the tileimps for both the pillbox and the barbed wire are in the TileFile - I am not sure if the original TileFile already contains them.
|
The original tile file does not contain the graphics for these two tileimps. I don't know if the Apolyton tile file does but I know that my purple hills tile file does.
-Martin
__________________
Civ2 military advisor: "No complaints, Sir!"
|
|
|
|
June 2, 2003, 16:20
|
#5
|
Prince
Local Time: 14:51
Local Date: November 2, 2010
Join Date: Mar 2002
Location: ATM Hawera NZ
Posts: 616
|
I have the Activision-scen instilled so that is not a problem. But what do you think about the city placement and stuff...
Feedback please!!
__________________
When it all comes to it, life is nothing more than saltfish - Salka Valka
|
|
|
|
June 2, 2003, 18:09
|
#6
|
King
Local Time: 02:51
Local Date: November 2, 2010
Join Date: Jan 2000
Location: Gone Fishin, Canada
Posts: 1,059
|
iskallin,
Looks like I'm the only one who downloaded the zip, and I can't find the map in it.
|
|
|
|
June 2, 2003, 21:07
|
#7
|
King
Local Time: 04:51
Local Date: November 2, 2010
Join Date: Apr 2002
Location: Toulouse (South-western France)
Posts: 2,051
|
Peter is right, there are only two files, a txt and a slc one.
__________________
"Democracy is the worst form of government there is, except for all the others that have been tried." Sir Winston Churchill
|
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is On
|
|
|
All times are GMT -4. The time now is 22:51.
|
|