Platyping's Python

4th Python Wonder Post :goodjob:

The Great Granary
Spoiler :
Civ4ScreenShot0000-4.jpg


Thanks to The_J for a hint :D
 
Think Lend Lease act is a posibility? Similar the the Roman Coliseum, You build the project, get to choose a player that you have atleast pleased relationship with. You can then build their UU.

Some things I want to see though is if you do that, and you have a UU also for that unit, you can build both.

I realize this might not be the best for regular civ, since not that many modern UU. But I really wanna see it for my mod, and I would also like this to be able to be built more than once. is that possible for projects?
 
Actually, the Flavian Amphitheatre doesn't allow you to "build" others' UU.

It replaces the default unit with the UU when the default unit is built.
Thus, you still cannot see the UU in you build selection.

Thus, it is not possible to see BOTH your UU and the other UU in your build selection screen, because the other UU is not seen in the build selection screen
 
I tried using canTrain function before where I simply put True for all units to see what is available.

Results:
I can build all units without requirements, including those without iCost, such as Great General.
However, certain constraints still hold:
1) Still cannot exceed global, team or player number limits, Eg Missionaries
2) Can only see the type that your civ can build, Babylon can only see Bowyer, but not default Archers, neither can it see the Mali UU

Edits:
Replaced all codes using isPlayerCityRadius checks due to inaccuracy of the code (Tsukiji, Silk Road, Machu, Great Mosque)
Megapack and Gigapack updated
 
sucks, really wanted that one

also hint for changing to modules, I'm sure you know not to put all the xml in the same file, keep each wonder seperate, so i would suggest making a python script to help you with that. Assuming you always put the new xml at the bottom, which means all the lines above you want to delete, so im sure theres a python way to go into the documents and do that, since i know the J got python to edit xml files
 
The module thing is on to-do list, but not priority list :D
The horror of reuploading 100+ works put me off :cry:

Tomb of Khalid ibn al-Walid
Spoiler :
Civ4ScreenShot0001-8.jpg


Simple copy and paste from Leaning Tower
Since it is a tomb of a GG, you have to "kill"/use a GG to build it lalalala~

Artwork by stolenrays
 
np on the code! I am guessing you know that you needed to run

CyTranslator().getText("INTERNET_EFFECT", ())

(or what ever in the () for the strings like resource type etc.)

to make it actually display. Not sure if the sevopedia would be any different, I will check it.

edit: for the sevopedia users will have the merge my code in as the python is slightly different, however, the code itself is untouched
 
Going to re-download just in case it was the d/l or me, but I gave the Itsukushima Shrine a go and couldn't get it to show up even in the civilopedia from the main menu. The entry is there, but clicking it just gives an empty entry.
Didn't try in game though.
 
@dacubz145

yeah python can do a lot of stuff with xml including the writing of xml files (in fact it can even edit itself, which I used in my own logging system werein the Logging instances are stored into the logging file itself :p)

I could always write a simple program for splitting an xml file into several ones if you can tell me exactly what it needs to do/formatting and stuff
 
I am assuming a translator is impossible? Since you can't have python go to a website and type things in im assuming

But how about converting names to text names? For example, I want to translate my mod into several languages, but usually my descripions are just the name, not the text name (so it jsut says marine not TXT_KEY_UNIT_MARINE) is there a way for it to take the description, rename it to the TXT thing (replacing spaces, -, etc with _ and capitalizing the letters) then setting up a text doucument and automatically places the original one in the english portion? Seems complicated too me since it also has to make sure it is not already TXT_KEY_UNIT_NAME
 
so if you had a civilizations adjective as

<Adjective>British</Adjective>

you would want a program to change that to

<Adjective>TXT_KEY_CIV_BRITISH_EMPIRE_ADJECTIVE</Adjective>

with a text tag in the xml of

<TEXT>
<Tag>TXT_KEY_CIV_BRITISH_EMPIRE_ADJECTIVE</Tag>
<English>British</English>
<French>Anglais</French>
<German></German>
<Italian>Inglese</Italian>
<Spanish></Spanish>
</TEXT>

yup that be easy...

I should be able to do that. But you were also talking about something to sort out modular xml? I am interested in how that works.

Also I could attempt a built in translator using google translate (python has internet tools) but I can't say how effective it will be/if it will work
 
If you could do a translater that would ba absolutely amazing!!! You should definatly try!

But the modular thing, Platyping wants to amek his wonders modular( although he said not taht important to him) and I said, since all of his wonders are at the bottom (so the wonder info is teh last building) I am assuming, you then would have to delete the same amount of lines above it every time for every wonder correct? But it takes a while to select what you want, I thought python could do that, although he didnt seem to interested and it would not be something i would release since its specific so this situation
 
I see, well I will start work on the text re-aligner tommorrow and see what I can do about a translator (I might even resort to javascript/html if python can't do it, but I am sure gonna try :p)
 
I am in the learner stages of java, but it seems like java could probably do it

the best of course would be combining the two programs, do you think youll be able to choose the languages? Or will it automatically choose the default Civ ones? Since I dont have Italian i hope that wont cause a problem??

Also we should talk about this in my travel through time modern alliances mod so we dont plug up platypings thread with offtopic stuff
 
Going to re-download just in case it was the d/l or me, but I gave the Itsukushima Shrine a go and couldn't get it to show up even in the civilopedia from the main menu. The entry is there, but clicking it just gives an empty entry.
Didn't try in game though.

Thanks for reporting,
there is a typo in the CIV4BuildingInfos.XML file where all entries are ITSUKUSHIMA_SHRINE except the Art Define tag which was simply ITSUKUSHIMA.
Fixed.
Usually, I do testing for old works only in gigapack so didn't notice the standalone problem... too troublesome to load 100+ standalones

@dacubz145
The big problem with making modular is more because I am sick of reuploading all 100+ works again lol.
And I am still concerned about the fact that making it modular makes it harder for new players with no modding experience to get it to work, which I pointed out earlier.
 
I was thinking about some projects;
1)National Healthcare System: Some type of health bonus?? I thought at first +1 health per 10% gold, but that would requier to much checking, if you can even check that
2)Some type of big recycling system, that when you build a recycling center it takes away all unhealthiness
 
Some type of big recycling system, that when you build a recycling center it takes away all unhealthiness
Actually I made a toxic waste treatment plant, to give some bonus when clearing fallout, and more if the nearest city has recycling centre, but after making it, it seems too similar to Hierapolis Sawmill, so I dumped it :D
 
I 100% disagree with you on the modular point. Personally I am not longer interested in the modular part, since when you have such a big mod its easier to keep it in regular xml. But lets face it, no one, is going to play a mod with only one wonder. Not taht any of your wonders arent good enough but one wonder just doesnt have enough impact to play a mod no? So by default they want to play your larger packs. Then all of a sudden, they want to add your wonder to a simple mod they are making, or another mod. I would bet more people know to just paste it in modules, than edit all of the xmls. There is definatly a lot of more errors to happen with the xml way. Plus when they see how yours is in modular, they will figure it out as well

Personally yes 100 is a lot, which is why i wouldnt do it, maybe if you want in gigapack. And maybe if you want to update a wonder switch it to modular? But 100 is just to much work and dont think its worth it

Quick question though. In my african mod, I want to replace all projects with cures. Since all of the projects are non-african, i beleive cures for dieseases would be more important to say
I dont have any ideas for more bonuses though, any ideas? Maybe a pernemant food bonus or something
 
+1 pop in all cities like cure for cancer
+1 additional pop when growth like longevity
+ heal rate like human genome
enables special health buildings?
free promotion to new units built
Provides free special resources in capital
 
Back
Top Bottom