 |
|  |
 |
|  |
 |
|
Locutus
|
|
ACS CTP1/2 Manager & Civ4 Co-Manager
|
 |
Hengelo, The Netherlands
Nov 1999 time: 06:13
|
|
DanMc,
There's one problem with your idea of newer settler-units. Unfortunately it is probably not possible to buid city-improvements with SLIC, so you can't create settlers/engineers that do that. This is why I think the way Wes is handling things is the best possible solution, although I'm still working on a trigger that replaces settlers with newer versions in case anyone is still interested (it could with slight adjustments be used to upgrade any ohter unit as well, once it works).
WesW,
Okay, I completed the Garrison-trigger. It's works correctly now: it creates a garrison-unit in all six ages. Note that a two different garrison-units are needed when space-cities get available: the second unit is meant especially for space-cities, because it would otherwise be possible to launch the garrison-units on earth into space, which I think is not very elegant (there's allways someone - human or AI - who will do just that if it's possible). Also, because I don't know what your tech tree looks/will look like and what units and advances you want to use, I sort of guessed what you might want. This can of course easily be changed.
Well, here is:
code:
TypeUnit newunit;
trigger 'Garrison' when (city.built) {
if (HasAdvance(g.player, ID_ADVANCE_SPACE_COLONIES) ) {
if (IsUnderseaCity(city) | | TerrainType(city.location) != 13) {
if (IsUnderseaCity(city) ) {
AddPops(city, 2);
}
CreateUnit(g.player, UnitType("UNIT_SPACE_MARINES_GARRISON"), city.location, 0, newunit);
AddMovement(newunit, 1);
SetOrder(1, 4);
AddOrder(newunit, city.location);
} else { // In case of a space city
AddPops(city, 2);
CreateUnit(g.player, UnitType("UNIT_SPACE_MARINES_SPACE_GARRISON"), city.location, 0, newunit);
AddMovement(newunit, 2);
SetOrder(1, 15);
AddOrder(newunit, city.location);
SetOrder(1, 4);
AddOrder(newunit, city.location);
}
} elseIf (HasAdvance(g.player, ID_ADVANCE_ROBOTICS) ) {
if (IsUnderseaCity(city) | | TerrainType(city.location) != 13) {
if (IsUnderseaCity(city) ) {
AddPops(city, 2);
}
CreateUnit(g.player, UnitType("UNIT_BATTLEBOT_GARRISON"), city.location, 0, newunit);
AddMovement(newunit, 1);
SetOrder(1, 4);
AddOrder(newunit, city.location);
} else { // In case of a space city - i.e. Space Ladder
AddPops(city, 2);
CreateUnit(g.player, UnitType("UNTI_BATTLEBOT_SPACE_GARRISON"), city.location, 0, newunit);
AddMovement(newunit, 2);
SetOrder(1, 15);
AddOrder(newunit, city.location);
SetOrder(1, 4);
AddOrder(newunit, city.location);
}
} elseIf (HasAdvance(g.player, ID_ADVANCE_EXPLOSIVES) ) {
CreateUnit(g.player, UnitType("UNIT_MACHINE_GUNNER_GARRISON"), city.location, 0, newunit);
AddMovement(newunit, 1);
SetOrder(1, 4);
AddOrder(newunit, city.location);
} elseIf (HasAdvance(g.player, ID_ADVANCE_GUNPOWDER) ) {
CreateUnit(g.player, UnitType("UNIT_MUSKETEERS_GARRISON"), city.location, 0, newunit);
AddMovement(newunit, 1);
SetOrder(1, 4);
AddOrder(newunit, city.location);
} elseIf (HasAdvance(g.player, ID_ADVANCE_AGRICULTURAL_REVOLUTION) ) {
CreateUnit(g.player, UnitType("UNIT_PIKEMEN_GARRISON"), city.location, 0, newunit);
AddMovement(newunit, 1);
SetOrder(1, 4);
AddOrder(newunit, city.location);
} else { // or should it be: } elseIf (HasAdvance(g.player, ID_ADVANCE_BRONZE_WORKING) ) {
CreateUnit(g.player, UnitType("UNIT_HOPLITE_GARRISON"), city.location, 0, newunit);
AddMovement(newunit, 1);
SetOrder(1, 4);
AddOrder(newunit, city.location);
// or should it be:
// else {
// CreateUnit(g.player, UnitType("UNIT_WARRIOR_GARRISON"), city.location, 0, newunit);
// AddMovement(newunit, 1);
// SetOrder(1, 4);
// AddOrder(newunit, city.location);
}
}
That's it for now,
Update: Wes, please ignore this one, see the other settlers-thread ("SLIC and Obsolete Units")
Locutus
[This message has been edited by Locutus (edited January 04, 2000).]
|
|
|  |
 |
|  |
All times are GMT. The time now is 05:13. Apolyton Time is 00:13. |
top of page
|
|
|
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
|
|
|
|
|
|