Ganraeln : I think your question is too complex to be answered in this topped thread where all subjects flow through each other. You might get better results with a new thread with the only focus on your problem.
Announcement
Collapse
No announcement yet.
Initial Python reference
Collapse
This is a sticky topic.
X
X
-
PJay,
Thanks for the response. After posting the first time, and seeing a bunch of posts responding to something else entirely, I was probably coming off a bit snippish. That, I'm sure, will get me nowhere, especially since we should all be grateful for any information given out by these fine folks.
I'll just wait for the SDK, I think. I'm hoping the documentation is much better then. Otherwise, it's looking very much like hunt and peck - something I've never found very much fun.
Comment
-
Hi guys,
Just let me quickly explain what I am trying to attempt.
I have created a specialist-Slave-which is only ever going to appear under the Slavery Civic, because I think the Slavery Civic is currently a little lacklustre.
Anyway, After modding the SpecialistInfo.xml file, I did a VERY simple python script, called CvCivics.py, to access this specialist under the Slavery Civic. Problem is, it is NOT currently working. Here it is:
def onBeginPlayerTurn(self, argsList):
'Civic Chosen'
iGameTurn, iPlayer, iCity = argsList
if iCivic==gc.getInfoTypeForString('CIVIC_SLAVERY')):
pSpecialist.gc.getFreeSpecialist(7)-int(2)
print("You have enslaved the local natives")
Can anyone help me with some advice as to what I need to add? Thanks in advance.
Yours,
Aussie_Lurker.Last edited by The_Aussie_Lurker; December 10, 2005, 05:36.
Comment
-
This part looks very wrong:
pSpecialist.gc.getFreeSpecialist(7)-int(2)
if you defined gc like everybody does, it can't be used with anything in front of it. I don't quite get what you want this line to do exactly.
What do you think pSpecialist is (it's not defined in your code here)?
Why the - int(2) ?
Anyway, the freespecialist functions you find in the API are for things like mercantilism giving 1 free specialist, and can be set in XML without python. Perhaps you'll have to give the specialists' bonusses directly to the cities instead of giving them indirectly through a specialist.no sig
Comment
-
Anyone knows how rivers are generated in map scripts? I can see land/peak/hills/water on one side, ice/tundra/grass/plains/desert on another, and resources and forest/jungle in the third part, but can't find rivers.Clash of Civilization team member
(a civ-like game whose goal is low micromanagement and good AI)
web site http://clash.apolyton.net/frame/index.shtml and forum here on apolyton)
Comment
-
On river generation in map scripts: It is done by a set of global functions, mainly, if I'm not mistaken, getRiverAltitude, which seems to provide the altitude of a plot in order to compute where the river should flow.
The problem is the rivers are computed to flow from a source to the sea rather than the opposite. This means the rivers will sometimes cross mountain ranges because they seem unable to decide to go sideways when they meet a mountain, and even that wouldn't ensure they will someday meet the sea. If anyone knows how to replace the whole river system generation, I'd like to hear from them.Clash of Civilization team member
(a civ-like game whose goal is low micromanagement and good AI)
web site http://clash.apolyton.net/frame/index.shtml and forum here on apolyton)
Comment
-
Hi I've got a question for someone:
I want to extract the combat log; I've found the relevant functions that write to the combat log, but since CyInterface().addCombatMessage is not in the SDK, I can't think of a way to get these logs extracted to a text file!
Any help on this would be appreciated -- I'm probably looking in the wrong places since I went to the Python first (I'm a programmer) :P
Comment
-
Okey :-). Well my solution was to check every tile around the unit that moved. One could also check the direction and reverse it to get the old tile but I didn't want to do that.
Originally posted by Bhruic
Another question - it's possible to add new Promotion types, yes? I haven't been able to successfully do so at this point, just want to make sure I'm not banging my head against the wall pointlessly.
edit: nm, got it working. Apparently if you add a new promotion type and try and load an old savegame, it'll die, but if you start a new one, it works fine.
Bh
Originally posted by Locutus
General
onUnitCreated
'Unit Completed'
arguments: unit
onUnitLost
'Unit Lost'
arguments: unit
Also is there any onImprovementRemoved or something?Last edited by Zuul; January 20, 2006, 07:26.
Comment
-
Originally posted by Zuul
How do you add it?
Can't get those to work. When are they called? When I tried to check unit x y it gave me an error.
Also is there any onImprovementRemoved or something?
As for removing Improvements, no, no function exists for that (that I'm aware of).
Bh
Comment
Comment