 |
|  |
 |
|
slamp
|
 |
Cannes, France
Sep 1999 time: 06:13
|
|
Hi,
I have a trigger which adds 4 pops to a city
and creates 2 pikemens when the city is create. I want to add a granary to this city.
How do you do that ?
The trigger is like below:
trigger 'MakeCities' when (city.built && (g.year <= 3) && (player.cities <= 10)) {
AddPops(city.1,4);
CreateUnit(player, UnitType("UNIT_PIKEMEN"), city.1.location, 0);
CreateUnit(player, UnitType("UNIT_PIKEMEN"), city.1.location, 0);
AddBuildingToBuildList(city.1, BuildingType("IMPROVE_SILO"));
}
[This message has been edited by slamp (edited December 03, 1999).]
|
|
|  |
 |
|
wheathin
|
|
Slamp is not the only one who wants to know. Can anyone help?
And, btw, does AddBuildingToBuildList actually create the building, or just put in the queue? I couldn't tell.
I am trying to resurrect my "Packages" idea from June - but I need a SLIC function that lets me add buildings to the city.
Wheathin
|
|
|  |
 |
|
wheathin
|
|
.... *ahem*
Still waiting to find out if you can use slic to add a building to city... anyone?
wheathin
|
|
|  |
 |
|
TP
|
|
Slamp,
I did not try the trigger you have outlined here as I think that you already have tried it without being lucky. Well, I do not see any way to do that, I am afraid. The "AddBuildingToBuildList" function does actually what it is saying - it adds a building to the build list (=build queue) of a given city. Unfortunately there is no "RushBuy" function in SLIC which would have enabled you to force a rush-buy (together with incremental gold) to build a building within one round as a work-around. Seems like this is a dead-end.
By the way, I have just visited your homepage. As I can not speak French, I might be wrong, but do you live in Toulouse ? If yes, we might meet next year as I will be in the area of Langeudoc Roussillon for a couple of days. Due to reading about Sierra's "Gabriel Knight 3" (and playing right now), I stumbled over the history of the Cathars, Rhennes-Le-Chateaux and have literally fallen in love with the lovely landscape and that mystery.
WesW,
You have asked in a seperate mail whether "I could write triggers so that any sea or space city starts with a pop of 3 and machine gunners.".
Now I won't go into SLIC coding anymore as PowerSLICs is finished and my vacation ends on Sunday. Also I have to admit ashamingly, I am now into another great game I already mentioned which puts CTP at least for the time being off my desk: "Gabriel Knight 3 - Blood of the Damned, Blood of the Sacred", a supérbe adventure game (GK1 and GK2 both have been 100% crap, but GK3 is simply stunning - mostly because of the detailed and mysterious story taking place in a beautiful area in France).
Still the below code which is based on Slamp's code should do what you need (Slamp, I assume you are fine that I have modified your above code a bit - if not, please shout):
trigger 'Slamp_TP_SupportSeaCities' when (city.built && IsUnderseaCity(city)) {
AddPops(city.1,2);
CreateUnit(player, UnitType("UNIT_MACHINE_GUNNER"), city.1.location, 0);
CreateUnit(player, UnitType("UNIT_MACHINE_GUNNER"), city.1.location, 0);
}
This code should give you a pop of 3 per sea city and 2 machine gunners in them as soon as the city is founded. I have tested this code and it works.
That's the good news. Now to the bad news...
Unfortunately, the corresponding "IsSpaceCity" function (to detect whether a city is located in space) is broken in CTP 1.2 (at least in my setup here) and thus can not be called from within SLIC. This means that no SLIC code can be applied to cities which have just been founded in space (there may be a solution, but I am 99% sure that I have not overlooked something).
Hope this helps - if not, go and purchase GK3 (http://www.sierrastudios.com/games/gk3) for the search of an ancient well-known item...
TP
[This message has been edited by TP (edited December 10, 1999).]
|
|
|  |
 |
|
wheathin
|
|
the "FinishBuilding" function just orders a city to finish building a settler if that is what it is doing (or something like that). It only works for settlers.
quite useless.
wheathin
|
|
|  |
 |
|
TP
|
|
Slamp,
Thanks a lot for talking a bit about you ! I may take your offer and send you a mail in a couple of weeks when I am going to start next year's vacation planning. Merci beaucoup ! My name is Thomas (age 28) and I am originally from the southern part of Germany (Black Forest) but moved to the Frankfurt area about 2.5 years ago due to job reasons. I might relocate to Switzerland though in 2000/2001 within the company where I am working right now.
Locutus,
Copied from SLIC readme which you can find at Apolyton too (I think in the modification section of CTP):
INT TerrainType(location)
Return the terrain type of the location.
TP
|
|
|  |
 |
|  |
 |
|
TP
|
|
Locutus,
GREAT idea to use the TerrainType function as a workaround to check whether a city is actually a space city.
I haven't tried it (too less time these days), but I know that as soon as a city is built (which you can trigger via city.built) the city's location is saved in city.location.
So the trigger for space cities would most likely look like:
trigger 'Slamp_TP_SupportSpaceCities' when (city.built && TerrainType(city.location) == 20) {
AddPops(city.1,2);
CreateUnit(player, UnitType("UNIT_MACHINE_GUNNER"), city.1.location, 0);
CreateUnit(player, UnitType("UNIT_MACHINE_GUNNER"), city.1.location, 0);
}
Hope this works (I am especially not sure whether space is linked to the number 20, but it is the 20th entry in terrain.txt, so I suppose it is correct.
Can someone test please ?
TP
|
|
|  |
 |
|
TP
|
|
Sorry guys,
3 issues after my testing (I just had to do it, at least until now past midnight:
1. Not so bad:
The terrain number lies between 10 and 17 based on my testing, you have to find the final right number. Please use the following code:
trigger 'Slamp_TP_SupportSpaceCities' when (city.built) {
if (TerrainType(city.location) == XX) {
AddPops(city.1,2);
CreateUnit(player, UnitType("UNIT_MACHINE_GUNNER"), city.location, 0);
CreateUnit(player, UnitType("UNIT_MACHINE_GUNNER"), city.location, 0);
}
}
2. Slightly bad:
After building the "star ladder", the first space city you automatically get with this wonder, will NOT be affected by the SLIC code, i.e. it will stay a city with 1 pop and no gunmen.
3. Severly bad:
The gunmen which get created, are not created in space but on Earth just down the space tile where the new space city is. I do not see a way to find a solution for that currently.
TP
|
|
|  |
 |
|  |
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
|
|
|
|
|
|