Apolyton Archive  |  Preserved copy of the Apolyton Civilization Site and its forums as they stood in September 2005. Read-only; nothing here can be posted to or replied to.  |  Forum index |  About this archive |  The 1998–2001 UBB forums
Today on Apolyton WARDELL INTERVIEW PROMO A.C.S. HISTORY CHAPTER 4 GET CIV4 /w FREE PLUS! A.C.S. PHOTO GALLERY GET A.O.M. V1.1
Apolyton Civilization Forums
main| civ2| civ3| civ4| smac| ctp2| ron| moo3| galciv| galciv2| alt| about|
ApolytonPLUS | register | search | faq | new posts | pm (-/-) | upload | members
hall of fame new! | civgroups | civgroups news | interviews | the column | radio | chat | directory | news | store | PLUS
Apolyton Civilization Forums : Powered by vBulletin version 2.0.3 Apolyton Civilization Forums > Miscellaneous > Archive > CtP2-Creation/AI/Mods/Scenarios-Archive > What do you think?
Show a Printable Version | Email This Page to Someone! | Receive updates to this thread | Report this to Apolyton news!

bottom of page
  
Author
Thread    < Last Thread     Next Thread > Post New Thread     Post A Reply
ískallin is offline ískallin
Prince
of the Republic of Iceland
Mar 2002
time: 05:28
  Old Post 02-06-2003 15:57
Edit/Delete Message Reply w/Quote
#1 Report this post to a moderator
What do you think? Support Apolyton, buy Alpha Centauri

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

Attachment: scen0002.zip
This has been downloaded 4 time(s).

BureauBert is offline BureauBert
Chieftain
Vienna, Europe
Apr 2003
time: 06:28
  Old Post 02-06-2003 17:34 Visit BureauBert's homepage!
Edit/Delete Message Reply w/Quote
#2 Report this post to a moderator
Support Apolyton, buy Galactic Civilizations: Deluxe Edition

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:

/////////////////////////////////////////////////
// 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:

////////////////////////////////////////////////////////////////////////////////////////////////
// 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!

ískallin is offline ískallin
Prince
of the Republic of Iceland
Mar 2002
time: 05:28
  Old Post 02-06-2003 20:23
Edit/Delete Message Reply w/Quote
#3 Report this post to a moderator
Remove this text

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.

Martin Gühmann is offline Martin Gühmann
Emperor
Berlin, Germany
Mar 2001
time: 06:28
Post  Old Post 02-06-2003 21:46 Visit Martin Gühmann's homepage!
Edit/Delete Message Reply w/Quote
#4 Report this post to a moderator
Increase the size of your Attachments

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

ískallin is offline ískallin
Prince
of the Republic of Iceland
Mar 2002
time: 05:28
  Old Post 03-06-2003 01:20
Edit/Delete Message Reply w/Quote
#5 Report this post to a moderator
Increase the size of your Attachments

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!!

Peter Triggs is offline Peter Triggs
Prince
Gone Fishin, Canada
Jan 2000
time: 05:28
  Old Post 03-06-2003 03:09
Edit/Delete Message Reply w/Quote
#6 Report this post to a moderator
Support Apolyton

iskallin,

Looks like I'm the only one who downloaded the zip, and I can't find the map in it.

Tamerlin is offline Tamerlin
King
Toulouse (South-western France)
Apr 2002
time: 06:28
  Old Post 03-06-2003 06:07
Edit/Delete Message Reply w/Quote
#7 Report this post to a moderator
Browse Apolyton AD-FREE

Peter is right, there are only two files, a txt and a slc one.

  < Last Thread     Next Thread > Post New Thread     Post A Reply
All times are GMT. The time now is 05:28.
Apolyton Time is 00:28.
    top of page
Rate This Thread:
archivepost
Forum Jump:
Forum 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
vB code is ON
Smilies are ON
[IMG] code is ON
 




Contact Us - Apolyton Civilization Site - Support Us!

Building a better Apolyton through better information. Click here and take our poll!
Non-US visitors, click here!

Powered by: vBulletin Version 2.0.3
Copyright ©2000, 2001, Jelsoft Enterprises Limited.

Page generated in 0.0784 seconds (95.17% PHP - 4.83% MySQL) with 31 queries
Page Loading Time:

Support Apolyton: Amazon USA | Amazon UK | Amazon DE | Amazon FR |
Support Apolyton and get FREE PLUS, Buy from Chips&Bits: Galactic Civilizations | Galactic Civilizations: Deluxe Edition | Call to Power 2 | Civilization: The Boardgame | GURPS/ Alpha Centauri | Alpha Centauri | Civilization IV | Civilization III: Complete |


Front Page | Civilization IV | Civilization III | Civilization II | Call to Power II | Alpha Centauri | Master of Orion III
Rise of Nations | Galactic Civilizations | Galactic Civilizations II | Misc
Alt.Civs | Civ I | C:CtP I | About | News | Directory | Apolyton Store | Forums | Chat | Columns | Interviews | Newsletter
Scenario League | CSC | Clash of Civs | Spanish Site | CtP Maps | Cradle of Civ | WesW's Ctp1/2 Site | Civ3 Haven

apolyton.net | apolyton.com | civilization2.net | civilization3.net | civilization4.net | civilizationiv.info | calltopower.net | galciv.net | galciv2.net | moo3.net