Platyping's Python

True, but that line is only in onGameLoad, so if you research the obsolete tech but never reload the game, it will not apply.

Alternatively, you can
1) Add codes onTechAcquired to disable it by setting the values stored to -1
OR
2) Add an extra check onEndGameTurn to check if building is active using that same line, with some minor adjustments to the variable names of course.
 
Something like this:

Code:
	def onEndPlayerTurn(self, argsList):
		'Called at the end of a players turn'
		iGameTurn, iPlayer = argsList

## Matsumoto Start ##
		pPlayer = gc.getPlayer(iPlayer)
		pTeam = gc.getTeam(pPlayer.getTeam())
		obsoleteTech = gc.getBuildingInfo(gc.getInfoTypeForString("BUILDING_MATSUMOTO")).getObsoleteTech()
		if pTeam.isHasTech(obsoleteTech) == false or obsoleteTech == -1:
			if self.Matsumoto[0] != -1 and self.Matsumoto[1] != -1:
				MatsumotoCity = CyMap().plot(self.Matsumoto[0], self.Matsumoto[1]).getPlotCity()
				MatsumotoCity.changeDefenseDamage(-100)
## Matsumoto End ##

The code for onEndGameTurn wouldn't be necessary I guess?
 
Nope, it was placed there because it will be more efficient.
Placing it at EGT, it will only activate once when you click end turn, while placing it at EPT, you are activating it for each player when you click end turn.

The original codes
Code:
	def onEndGameTurn(self, argsList):
		'Called at the end of the end of each turn'
		iGameTurn = argsList[0]
		
## Matsumoto Start ##
		if self.Matsumoto[0] != -1 and self.Matsumoto[1] != -1:
			MatsumotoCity = CyMap().plot(self.Matsumoto[0], self.Matsumoto[1]).getPlotCity()
			MatsumotoCity.changeDefenseDamage(-100)
## Matsumoto End ##
already check where the wonder city itself is, and I seriously don't care who is the owner of the city. Now all I need is just to check if the wonder is obsolete.

Thus,
Code:
	def onEndGameTurn(self, argsList):
		'Called at the end of the end of each turn'
		iGameTurn = argsList[0]
		
## Matsumoto Start ##
		if self.Matsumoto[0] != -1 and self.Matsumoto[1] != -1:
			MatsumotoCity = CyMap().plot(self.Matsumoto[0], self.Matsumoto[1]).getPlotCity()
			if MatsumotoCity.getNumActiveBuilding(gc.getInfoTypeForString("BUILDING_MATSUMOTO")):
				MatsumotoCity.changeDefenseDamage(-100)
## Matsumoto End ##
This will do.
You see that I don't even care who is the owner and which is the obsolete tech and obviously not the team as well. Save alot of steps and checks.
 
Shimabara Castle
Spoiler :
Civ4ScreenShot0004-21.jpg


Thanks to Arian, I found new artwork to play with.

The actual figures in financial advisor are still the same.
This is done by adding a hidden negative extra cost which will then alter the daily net income.
Inflation will include this automatically.
Thus, although the financial advisor still tell you your expenses is X, the changes are reflected in the daily net income in the main screen.

Artwork by embryodead
 
Galata Tower
Spoiler :
Civ4ScreenShot0005-14.jpg

Simple copy and paste job.
Wanna do something for just the colony maintenance as this one was related to colony somehow.
However, couldn't find a way to get just the colony expenses, so end up as total city expenses.

Artwork by embryodead


Edits:
Tomb of Unknowns
Added Movie File

Big Ben
Fixed calculation error. Should be a * rather than a / in the formula.
 
Doing more experiments recently, looking for some opinions.

Currently, there are some wonders adding invisible daily income, such as Big Ben adding income based on game turn, and e-Bank adding income based on % of treasury.

These are currently using changeGold() in Begin/EndPlayerTurn such that the intended amount is added directly to the player's gold each turn.

The downside is that this income is neither reflected in the financial advisor nor the main screen, such that some people are confused that they are getting gold each turn even though they are supposed to be running a negative income.

Thus, the new system I derived solved this "negative stated income but positive real income" problem, although the financial advisor screen may be confusing for some.

------------------------------------------------------------------------------------------
Using Big Ben as an example, it adds X amount of gold per turn based on current game turn, adjusted by game speed.

Current Style:
B1.jpg

B2.jpg

In both the financial advisor and main screen, this is not reflected.
So although it is stated the player is getting -11 gold per turn, in reality he is getting (133 -11) gold per turn.

New Style:
Civ4ScreenShot0003-21.jpg

Civ4ScreenShot0002-26.jpg


The financial advisor screen looks confusing because the wonder income is added as a negative extra cost (negative cost means income), which is not stated here, but added before inflation calculations.
This is why the total cost before inflation is actually -89, because initially it was 44.
44 - 133 = -89
Thus, for the main screen, it now reflects the real income, which is Total Income - Total Expense (37 - 35) + Wonder Income (133) = 135

In short, the main screen now displays the real income that you are getting every turn, rather than showing you a negative income, yet every turn you are getting more and more gold.
The only thing is that, now the wonder income gets inflated by inflation and the financial advisor screen may not be that clear.
Bleh, in the past, both are wrong, now at least the main screen, which is more important, is correct.

Thus, should I carry out this change, or is it too confusing?
Since e-Bank was done by tsentom1 and it is widely used in most mods, this change may make it better to manage your income I guess
 
@dacubz
What virus thing? :hmm:

@others
Okie dokie, will implement the changes tomorrow when I free.
Basically a shift of codes from EndGameTurn to ExtraCost, with some adjustments.
Probably gonna balance Big Ben abit while I am at it, since 1 gold per gameturn seems quite high :rolleyes:

Sleepy now, can only recall Big Ben, e-Bank, Singapore Flyer and Wembly Stadium will be affected.
 
I beleive the wiki page for it is operation olympic games but the wiki page for it is pretty short (since its pretty now). Basically in 2008 the US placed a virus in the computers or whatever of Irans nuclear stuff. Basically the project would ruin someones nuclear program (both power and missiles)
 
Version 4.0
This version implements a new coding style for wonders granting gold per turn.

Problem
As mentioned in earlier posts, the traditional style of coding for this kind of wonder (common example e-Bank of tsentom1) makes use of changeGold() to add the income directly to the player's treasury each turn.
The result is that the gold is added accurately, but this extra income is neither reflected in the financial advisor nor the main screen.
This confuses players with a "negative stated income, positive real income" situation where players are getting more gold per turn then the gold stated in the main screen.

Solution
The new coding system uses getExtraCost to grant the income.
1) Main screen now shows the extra income from wonders.
2) Extra codes added to account for inflation, such that the real added income is as intended.
Example, if Wonder is supposed to add 1000 gold per turn and inflation rate is 25%,
The extra cost added is -800, such that after it is inflated, it becomes 800 + (25% of 800) = 1000, the intended amount.
This solves the inflation problem stated in previous posts.
3) Income is updated immediately.
Example, Singapore Flyer provides income based on total population in all cities.
Thus, if I draft in 5 cities, there is a drop in total population.
The income stated in the main screen will be adjusted accordingly immediately.
4) No more checks done turnly I guess, since it is no longer done in EndGameTurn
5) As calculations are done in integers (1st time to get the extra cost, 2nd time to get the result after inflation), there are bound to be rounding errors. The most it will be just 1 or 2, which I think is much better than remove the inflation adjustments which inflats the intended income too much when inflation is high.
6) For standalones, I let it return the value directly. If you are using more than 1 of these, you have to add the adjustments up first before you return. Refer to packs.

Balance Adjustments

Big Ben
Nerfed from 1 to 0.5 Gold per Game Turn, adjusted by GameSpeed.
Thus, on Turn 300 on Standard Speed, it will gives 150 Gold per turn.
Spoiler :
BigBen-2.jpg


Singapore Flyer
Added the cap limit to the Strategy Section of Civilopedia.
The cap limit of 1000 Gold per turn was there all along, just not stated.
Spoiler :
SingaporeFlyer-1.jpg


Wembley Stadium
Added the cap limit to the Strategy Section of Civilopedia.
The cap limit of 1000 Gold per turn was there all along, just not stated.
Spoiler :
Wembley-1.jpg


E-Bank
1) Added the cap limit to the Strategy Section of Civilopedia.
The cap limit of 500 Gold per turn was there all along, just not stated.
2) Interest buffed from 1% to 2%
3) Removed onBuildingBuilt Bonus, because now the codes are done in CvGameUtils, might as well remove the whole CvEventManager.
Spoiler :
E-Bank-1.jpg


Federal Reserves
Old Benefits:
Ensures player has 200 gold at start of each turn

New Benefits:
The on Built Benefit of E-Bank
1000 Gold + 20% of Gold Reserves
The 1000 Gold was added in case the poor guy has nothing. 20% of nothing = nothing.
No more turn checks.
Spoiler :
FederalReserves.jpg


Ivy Mike
Added codes to remove improvements when fallout added

New Project

Olympic Games
Spoiler :
OlympicProject.jpg

I was thinking whether to use this name or not, because it is guaranteed it is definitely going to confuse people, but oh well... not my problem :D

Rather than doing something to the nukes directly as dacubz suggested, I decided to do something to the uranium instead. Since there is already a Nanite Defuser around...
Adds fallout to the uranium mine itself, and may affect surrounding plots too.
Note: I said "Mine", if it is not a mine, it will not be affected, since I doubt meltdown occurs at a fort lalala.

P.S.
I was looking for the button display of meltdown but cannot find it, so using the button for fallout instead. If someone knows where, tell me.

As for the other benefit, it removes the SDI that is already built by rivals.
Thus, you can nuke them happily until they build it again.:evil:

@dacubz
Next time find me a movie pic for this kind of hard to find stuff :gripe:


Megapack and Gigapack updated
Since Gigapack exceeded 10 MB, Movies taken out and released as Movie Pack 2 just like Megapack.

Superb Eye-Catching Impressive Movie Pack
 
I beleive this could act as a movie if you still need one

Personally dont agree with the benefits though, SDI has nothing to do with the project whatsoever-it was aimed directly at nuclear facilities - meaning it wouldnt even effect nukes when they were built or if they currently have any. It should be aimed at nuclear power plants instead (I guess since there is no building required to build nukes, the uranium thing represents what happens)
 
Well, destroy all nuclear power plants sounds boring.
In fact, I never built a single one of them in my games, they are just useless to me, coal plant does the same stuff without meltdown. Of course hydro is the best choice.

The uranium stuff is just temporary since I can clear the fallout in less than 3 turns with enough workers, although the surrounding destroyed improvements may be severe if there are towns.
Anyway, when you lose access to uranium, your power plants don't provide power as well, so they are affected.

Thus, a second benefit was added so that it does not look useless.
SDI is controlled by computers obviously, so since this operation is pretty much using computer virus, I guess why not?
There isn't much info on the operation itself anyway :D
 
Yeah, SDI in real life is more about missiles rather than nukes.
But SDI in game is totally about nukes rather than missiles, since the only missile has 100% evasion.

Anyway, if you want the effects to be so severe to remove the uranium itself permanently rather than temporaily with fallouts:
Code:
pPlot.setBonusType(-1)

Uranium is already pretty rare, most people have only 1 or 2, unless you are a run-away civ.
Removing it totally might be too OP since nukes pretty much dominate a war if one side does not have it.
Adding a very slim chance of removing = most likely it is not gonna happen.
If it is on built effect, chances are you built it for nothing.
If it is a chance to happen every turn, then you have to suffer checks every turn :D
 
Hi,

I tried your new style on coding for channel tunnel and I get the following error:

Code:
MemoryError: stack overflow
Traceback (most recent call last):
  File "BugEventManager", line 361, in _handleDefaultEvent
  File "CvEventManager", line 1168, in onBuildingBuilt
RuntimeError: unidentifiable C++ exception

The wonder screen shows up again and again.

CvEventManager line 1168 (in red):
Code:
			if b_NoCoastal == 0:
				chosenPlayer = Chosen[CyGame().getSorenRandNum(len(Chosen), "which player")]
				bCitychosen = 0
				(loopCity, iter) = chosenPlayer.firstCity(false)
				while(loopCity):
					if loopCity.isCoastal(10):
						if bCitychosen == 0:
							chosenCity = loopCity
							bCitychosen = 1
						elif loopCity.getCulture(chosenPlayer.getID()) > chosenCity.getCulture(chosenPlayer.getID()):
							chosenCity = loopCity					
					(loopCity, iter) = chosenPlayer.nextCity(iter, false)
				chosenCity.pushOrder(OrderTypes.ORDER_CONSTRUCT, gc.getInfoTypeForString("BUILDING_CHANNEL_TUNNEL") , -1, false, false, false, true)
				[COLOR="Red"]chosenCity.popOrder(0, true, false)[/COLOR]
				CyInterface().addImmediateMessage(CyTranslator().getText("TXT_CHANNEL_TUNNEL",(chosenCity.getName(),chosenPlayer.getCivilizationDescriptionKey(),)), None)

I couldn´t test the others so far.
 
Golden Bull
Spoiler :
Civ4ScreenShot0001-20.jpg

Well, since we have one for City Maintenance, one for Units, here is the one for Civics.
Was thinking of extra stuff if civic is Monarchy, but cannot really decide if this is pro or anti Monarchy.
It seems to restrict powers of the king but at the same time is all about choosing who to become king?

On hidesight, it seems there is another Golden Bull at 1222.
Not sure which is a more important one, so just stick with this for now.


@Alrik
Thanks for pointing out, I tested most of the others except this.
The way the code is functioning is, instead of just planting the wonder into the city directly the old style, the new style "builds" the wonder in the city, thus triggering all the onBuildingBuilt codes meant to trigger.

As such, I forgot that what Channel Tunnel is doing, is that when it is built, it creates a 2nd Channel Tunnel in another foreign coastal city.
Thus, this is an exception where it has to be the old style, where the 2nd one is added directly into the new city without triggering more stuff.
Using the new style, when the 2nd CT is built, it is gonna trigger the whole onBuildingBuilt codes for CT, which means a 3rd CT is gonna be built. And then a 4th and so on, resulting in infinite loop. Thats why there is a runtime error.

Will revert to the old style for this, this one is an exception case. Thanks
 
Back
Top Bottom