Simple Python Things

Thank you all :).

I have a question about leader traits. Is it possible to create a trait that allows the player to sacrifice population regardless of your current civic?

:( Tested it, and no, it's not possible.
The same with buying and conscripting :(.

The wonder notification feature should really be a part of BUG, IMO.

That's the best compliment a interfacemod can get :).

OK i got it to work, by putting some older python in, heck if i know what the hack is going on????

http://forums.civfanatics.com/showpost.php?p=8451122&postcount=37

BUT i always get a CRASH with this python?:mad:

And when you do get the crash?
 
And when you do get the crash?

Its usually right around after Liberalism is acquired. It has to be python, caused i checked everything else, with a debug dll and a artdefines/unit program to check files.

Right now i went BACK to my OLD version 004 and going to start OVER again for the 10th time its hard because i like to play from start and Liberalism usually takes around 4-5 hours to get to. I just like to be sure is all. I put the python up for someone with the way it works (but not correctly) and one that doesnt work, but separately only.:confused::crazyeye:
 
I've looked in the API, and can't see a command to do that :(.
You could do it through an event, which is triggered through the wonder, and reveals the resouce (look at the event "A man named Jed").

Yes. I understand. A little request, please. Can you, please made for my a little minimod with: If city built a XY_wonder wil be in his city range added coal resource, please? Have you patience and time make it for me? After I will rename resource to right name...

Can you, please make it for me?

sorry for indiscretion

Hroch
 
I had an idea for a promotion: Gladiator

When a unit with this promotion is in a city with a Colosseum, it automatically gains an XP point for every turn it stays there.

I had it in mind for a Gladiator unit I'm working on for my mod. Is this doable?
 
I had an idea for a promotion: Gladiator

When a unit with this promotion is in a city with a Colosseum, it automatically gains an XP point for every turn it stays there.

I had it in mind for a Gladiator unit I'm working on for my mod. Is this doable?

That sounds kinda like a retool of theLopez's Military Bases Mod
 
Yes. I understand. A little request, please. Can you, please made for my a little minimod with: If city built a XY_wonder wil be in his city range added coal resource, please? Have you patience and time make it for me? After I will rename resource to right name...

Can you, please make it for me?

sorry for indiscretion

Hroch

You mean, somewhere in the fat cross should be placed a coal resource?
That shouldn't be a problem :).

I had an idea for a promotion: Gladiator

When a unit with this promotion is in a city with a Colosseum, it automatically gains an XP point for every turn it stays there.

I had it in mind for a Gladiator unit I'm working on for my mod. Is this doable?

It stays there...that brings the same problem like in your last ideas. I can attach an effect so special missions, and idle, fortify and sleeping are missions, so that's not the problem, but i could still wake up the unit, and move it somewhere.
-> To create a bugless version, i would need to make the unit immobile after sleeping, waiting, etc.
That would not be a problem for the AI (okay, the AI would completly not understand, how that works), but maybe for the human player.

That sounds kinda like a retool of theLopez's Military Bases Mod

If there's someone, who could update it...:D
 
You mean, somewhere in the fat cross should be placed a coal resource?
That shouldn't be a problem :).


Wow. Very very thanks. It is important for me. For this I hope very long time. I have Alchemy technology and special functions and wonders allowed with... Coal I after rename to my special resource :)
thanks
Hroch
 
I wanted to code it today, but then i thought, that you'll also have the problem, that the resource is placed, but you will not be able to see it, until you reach the right technology.
Maybe it would be the better solution for you, to create a wonder like hollywood, which provides coal.

But i'll still do it :).
 
The J I liked your idea of adding AI to tsentoms old python promotion. However I decided to toy around and try to improve the functions, focusing on what type of AI the unit is.

However I ran into some problems with the function: getUnitAIType

Code:
		if not pPlayer.isHuman():
			if (iPromotion<>gc.getInfoTypeForString('PROMOTION_SURVIVAL')):
				if not pWinner.isHasPromotion(gc.getInfoTypeForString('PROMOTION_SURVIVAL')):
					if pWinner.canAcquirePromotion(gc.getInfoTypeForString('PROMOTION_SURVIVAL')):
						if pWinner.getUnitAIInfo(gc.getInfoTypeForString('UNITAI_COUNTER')):
							dice = gc.getGame().getMapRand()
							result = dice.get(4, "Gold")
							if ((result==1) or (result ==2)):
								pWinner.setHasPromotion(gc.getInfoTypeForString('PROMOTION_SURVIVAL'),True)
								pWinner.setHasPromotion(iPromotion,False)
								return

however i got this error to occur on the line:
pWinner.getUnitAIInfo(gc.getInfoTypeForString('UNITAI_COUNTER')):

Python Argument Types in CyUnit.getUnitAIType(CyUnit, str)
did not match C++ signature(class CyUnit {value})

I was just wondering if you knew exactly what the problem is here?
 
Se if changing this:
PHP:
if pWinner.getUnitAIInfo(gc.getInfoTypeForString('UNITAI_COUNTER')):

to this:
PHP:
if pWinner.getUnitAIType(gc.getInfoTypeForString('UNITAI_COUNTER')):


works.
 
however i got this error to occur on the line:
pWinner.getUnitAIInfo(gc.getInfoTypeForString('UNITAI_COUNTER')):



I was just wondering if you knew exactly what the problem is here?

Besides, that Mechaerik has said a solution (which i haven't tried out, i just trust in the post), i don't understand the exception.
getUnitAIInfo is a function from CyGlobalContext(), so this wouldn't have worked, but also this function should take the arguments, which you give it.
No idea, why it complains about a string :confused:.

Btw, i hope you'll put that version into the database :).
I've also looked at the other promotions from tsentom, but didn't have a good idea, how to make a senseful decission, so looking after the unitai is really a good idea :goodjob:.
 
I have a few questions on the Circus Hagenbeck. I was thinking of retooling it to be like the World Fair. How easy is it change the start day? Also, if it is in a city that gets razed to the ground, what happens?
 
Starting year: In part 3 is the line:
PHP:
if (CyGame().getTurnYear(iGameTurn)>=1890) and ( iGameTurn % 3 ==0 ):

The first is the starting year, the second the changing interval (i guess, i should have defined 2 variables with good names...too late).

If a city gets razed...err...haven't tested it.
It will not affect the movement of the circus, i guess, because that's independent from the old city.
Maybe the function, which removes the circus, will fail...a simple check, if the city is none shouldn't be difficult to integrate :D.
 
Just now looking at the Circus's code. Why did you use spaces instead of tab?
 
I wanted to code it today, but then i thought, that you'll also have the problem, that the resource is placed, but you will not be able to see it, until you reach the right technology.
Maybe it would be the better solution for you, to create a wonder like hollywood, which provides coal.

But i'll still do it :).

How it is for you easy, The_J. I not understand Python but I can Change wonder_name and Source_name in code :)

thank you very much
Hroch
 
Just now looking at the Circus's code. Why did you use spaces instead of tab?

:confused: i used tabs.

I am getting the PLUNDER from everyONE barbarians also, and now it even gives :science: to the LOSER? Second pic even if i havent got the plunder promo?

- Barbarians: The barbs are nearly a normal civ, so they also research techs -> that works correct.
- Science to the loser: I can't see, where that's done. The message, that Zara Yaqob has plundered 4 :science: means, that one of his units with the industry espionage promotion has won a battle against one of your units.
- Gaining :science: without promotion: :confused:. I guess, you didn't name another promotion "INDUSTRY_ESPIONAGE"?

How it is for you easy, The_J. I not understand Python but I can Change wonder_name and Source_name in code :)

thank you very much
Hroch

That's good :).


European Coal And Steel Community

Spoiler :


This wonder will, besides the xml effects, add 2 coal and iron resources in the fat cross of the city .

There's only one change in the CvEventManager, search for "european coal and steel community".

- There are checks for water, impassable terrain and existing resources. If there are not enough plots available, not all resources are placed.
- attention: Resources, which you can't see, could be overwritten!

XML: New are only the entries for the building in buildingInfos, buildingClassInfos and artdefines_building, and the text for it.


@hrochland:
If you only want one resource, then change CoalCounter<2 to CoalCounter<1 everywhere.
For only coal, remove IronCounter, and all, what comes after " elif..." at the end.

I've also seen the 2 buttons in the database. Thanks :), i'll replace them.


------------------------------------------------------------------------

I've also re-uploaded the industry espionage promotion, because it had the same problem like the sneak promotion, a wrong variable.
I've also re-uploaded Circus Hagenbeck with the check, which Affores has mentioned.
 
Top Bottom