 |
|  |
 |
|
Maquiladora
|
|
code: HandleEvent(BeginTurn) 'LITE_StartUp' post {
location_t startLocation;
unit_t startUnit;
unit_t tmpUnit;
int_t i;
int_t PBEMPlayer;
for(PBEMPlayer = 1; PBEMPlayer < 33; PBEMPlayer = PBEMPlayer + 1) {
if(IsPlayerAlive(PBEMPlayer)) {
// movement bonus for first turn
GetUnitByIndex(PBEMPlayer, 0, startUnit);
AddMovement(startUnit, 900);
startLocation = startUnit.location;
// free units
for (i = 0; i < 2; i = i + 1) {
CreateUnit(PBEMPlayer, UnitDB(UNIT_SETTLER_NOMAD), startLocation, 0, tmpUnit);
AddMovement(tmpUnit, 900);
}
// bonus Gold + PW
SetPW(PBEMPlayer, 5000);
AddGold(PBEMPlayer, 9900);
// random extra bonus advance
i = Random(6);
if (i == 0) {
GrantAdvance(PBEMPlayer, AdvanceDB(ADVANCE_MASONRY));
} elseif (i == 1) {
GrantAdvance(PBEMPlayer, AdvanceDB(ADVANCE_IRON_WORKING));
} elseif (i == 2) {
GrantAdvance(PBEMPlayer, AdvanceDB(ADVANCE_HULL_MAKING));
} elseif (i == 3) {
GrantAdvance(PBEMPlayer, AdvanceDB(ADVANCE_TRADE));
} elseif (i == 4) {
GrantAdvance(PBEMPlayer, AdvanceDB(ADVANCE_DRAMA));
} elseif (i == 5) {
GrantAdvance(PBEMPlayer, AdvanceDB(ADVANCE_JURISPRUDENCE));
}
}
}
DisableTrigger('LITE_StartUp');
}
// bonuses for first 3 cities
HandleEvent(CreateCity) 'LITE_CityBonus' post {
city_t tmpCity;
tmpCity = city[0];
if (player[0].cities <= 3) {
// for all 3 cities
CreateUnit(player[0], UnitDB(UNIT_HOPLITE), tmpCity.location, 0);
CreateUnit(player[0], UnitDB(UNIT_HOPLITE), tmpCity.location, 0);
CreateUnit(player[0], UnitDB(UNIT_WARRIOR), tmpCity.location, 0);
CreateUnit(player[0], UnitDB(UNIT_SETTLER_ORIG), tmpCity.location, 0);
CreateUnit(player[0], UnitDB(UNIT_CARAVAN), tmpCity.location, 0);
// extra for capital
if (player[0].cities <= 1) {
PlantGood(tmpCity.location);
// Has to be event
Event: CreateUnit(player[0], tmpCity.location, tmpCity, UnitDB(UNIT_CARAVAN), 0);
Event: CreateUnit(player[0], tmpCity.location, tmpCity, UnitDB(UNIT_CARAVAN), 0);
Event: CreateUnit(player[0], tmpCity.location, tmpCity, UnitDB(UNIT_CARAVAN), 0);
}
}
if (g.year > 10) {
DisableTrigger('LITE_StartUp');
}
}
Does anyone know why when i try to use this code with SAP+Goodmod, the trigger doesnt work? I think it might have something to do with the goods created with goodmod at the start.
Its also doesnt create the extra 2 settlers, doesnt give any of the 6 random advances to any players either and doesnt create the free caravans. Basically the whole trigger doesnt work with GoodMod but i dont know how to fix it, it does work with SAP2 alone though. Ignore the new settler names, its just a workaround for a fast moving settler to start the game with. I get no errors, it just doesnt work.
|
|
|  |
 |
|  |
 |
|
MrBaggins
|
|
perhaps if you use the same local variable names in the same event handler (BeginTurn -post) then you get problems?
|
|
|  |
 |
|
Peter Triggs
|
|
Gone Fishin, Canada
Jan 2000 time: 05:25
|
|
Are you in debug mode? I put those handlers into the Vanilla game and got 'out of bounds' errors.
|
|
|  |
 |
|
Maquiladora
|
|
Its on "DebugSlic=Yes" yeah, i didnt get any errors at all though.
|
|
|  |
 |
|
MrBaggins
|
|
Broken how?
Couldn't we keep a 'virtual track' of turn numbers?
|
|
|  |
 |
|
Maquiladora
|
|
When you end turn in PBEM mode the turn count just stays at "0" and even when you end turn and go around in turns, the units (only move once), buildings (dont build) and research just stays the same, it just goes around, without actually ending the turn for any of the players.
If you can force the turn to end and clear all movement points and build/research stuff it would be great.
|
|
|  |
 |
|
MrBaggins
|
|
Isn't there an 'Begin Turn' event. What happens when its invoked?
|
|
|  |
All times are GMT. The time now is 05:25. Apolyton Time is 00:25. |
top of page
|
| archivepost |
|
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
|
|
|
|
|
|