Here's my problem. I'm really bad at building settlers. I just don't. So I thought I'd add a way for them to be automatically generated. However, this was unfair on the AI, so I decided it would be better to add something that will generate settlers for me, if I find it. This should be a very profitable tile improvement that is randomly placed, and can be claimed by moving a unit onto it, that will produce settlers every five turns. The problem I've got is that it's not placed. Here is the code in the SLIC:
Another problem I had was that everyone could build it, despite it requireing an advance that no-one should be getting (however, I've a feeling that was from the cost of the advance being 0, which I've just changed)
Completely unrelated, but my version of the religion mod doesn't work. I've tried it on it's own and with the apolyton pack, and it keeps giving me the error: "APOL_str_loc not found in asset tree". I do have the patch, so have I done anything stupid?
This was done via ModManager, applying the religion mod, failing, and then managing it to apply both at once, with the Apolyton pack on top, which still produced the error.
Code:
int_t tmpOwner; location_t LocationTrue; int_t settTurnsPassed; // Place City Thingy on map at the beginning of the game. HandleEvent(BeginTurn) 'BeginGameCityPlacement' pre { int_t tmpX; int_t tmpY; int_t x; int_t y; location_t tmpLoc; int_t successful; tmpX = GetMapWidth(); tmpY = GetMapHeight(); tmpOwner = 0; settTurnsPassed = 0; successful = 0; while (successful == 0) { x = random(tmpX); y = random(tmpY); MakeLocation(tmpLoc, x, y); if (TerrainType(tmpLoc) != TerrainDB(TERRAIN_WATER_SHALLOW) && TerrainType(tmpLoc) != TerrainDB(TERRAIN_WATER_DEEP) && TerrainType(tmpLoc) != TerrainDB(TERRAIN_WATER_VOLCANO) && TerrainType(tmpLoc) != TerrainDB(TERRAIN_WATER_BEACH) && TerrainType(tmpLoc) != TerrainDB(TERRAIN_WATER_SHELF) && TerrainType(tmpLoc) != TerrainDB(TERRAIN_WATER_TRENCH) && TerrainType(tmpLoc) != TerrainDB(TERRAIN_WATER_RIFT)) {//Well, I don't want it in the water. GrantAdvance (player[0], AdvanceDB(ADVANCE_CITYTHING_PREQ)); Event:CreateImprovement(0, tmpLoc, TerrainImprovementDB(TIMP_CITYTHING), 0);//maybe this will get it working successful = 1; MakeLocation(LocationTrue, x, y); RemoveAdvance(player[0], AdvanceDB(ADVANCE_CITYTHING_PREQ)); } else { successful = 0; } } DisableTrigger('BeginGameCityPlacement'); } //Now check to see when stuff moves next to it? HandleEvent(MoveUnits) 'TakeIt' post { if (army[0].location == LocationTrue) { tmpOwner = army[0].owner; GrantAdvance (tmpOwner, AdvanceDB(ADVANCE_CITYTHING_PREQ)); Event:CutImprovements(LocationTrue); Event:CreateImprovement(tmpOwner, LocationTrue, TerrainImprovementDB(TIMP_CITYTHING), 0); RemoveAdvance(tmpOwner, AdvanceDB(ADVANCE_CITYTHING_PREQ)); } } //Now make the settler? HandleEvent(BeginTurn) 'SettlerCheck' post { if (g.player == tmpOwner && g.player != 0) { if (settTurnsPassed == 5) { settTurnsPassed = 0; Event:CreateUnit(player[0], LocationTrue, 0, UnitDB(UNIT_SETTLER), 0); } else { settTurnsPassed = settTurnsPassed + 1; } } }
Completely unrelated, but my version of the religion mod doesn't work. I've tried it on it's own and with the apolyton pack, and it keeps giving me the error: "APOL_str_loc not found in asset tree". I do have the patch, so have I done anything stupid?
This was done via ModManager, applying the religion mod, failing, and then managing it to apply both at once, with the Apolyton pack on top, which still produced the error.
Comment