Simple Python Things

Ah, then it's done with another method.
The unit should have the standard unit AI.
Did you check the XML to see which unit AI is used?

that is stereotyped against lemming :lol:.

:D yeah, the programmers are sometimes funny too :D.
 
Just saying about the new pedia pages you made me a bit back, for the three seperate building pages, you have it checking techs in the pediabuilding and pediamain, and accidently changed pediamain, but it just follows pediabuilding and disregards what pedia main says. Not important to my mod , and not asking for you to change anything just though you should know incase you do anything similar in teh future
 
oh god!!!!! I completely forgot about making your code keldath!!! I have completed it and I am gonna test before giving it to you... so sorry about the wait!
 
Just saying about the new pedia pages you made me a bit back, for the three seperate building pages, you have it checking techs in the pediabuilding and pediamain, and accidently changed pediamain, but it just follows pediabuilding and disregards what pedia main says.

...er...what, where?
 
ok, this is the barb spawning code! Put in in CvEventManager and replace

Code:
	def onBeginGameTurn(self, argsList):
		'Called at the beginning of the end of each turn'
		iGameTurn = argsList[0]
		CvTopCivs.CvTopCivs().turnChecker(iGameTurn)

with

Code:
	def onBeginGameTurn(self, argsList):
		'Called at the beginning of the end of each turn'
		iGameTurn = argsList[0]
		##Barb Spawning Code
		Game = CyGame()
                gc = CyGlobalContext()
                if not gc.getEraInfo(Game.getCurrentEra()).isNoBarbUnits():
                        iBarbChance = 5 #chance of barb spawning
                        if Game.getSorenRandNum(100, "") < iBarbChance:
                                lPlayers = list()
                                for x in xrange(Game.countNumCivPlayersEverAlive()):
                                        pPlayer = gc.getPlayer(x)
                                        if pPlayer.isAlive() and not countNumBuildings(gc.getInfoTypeForString("BUILDING_GREAT_WALL")):
                                                lPlayers.append(x)
                                pyPlayer = PyPlayer(lPlayers[gc.getSorenRandNum(len(lPlayers), "")])
                                del(lPlayers)
                                lPlots = list()
                                for pyCity in pyPlayer.getCityList():
                                        pCity = pyCity.GetCy()
                                        for iIndex in xrange(21):
                                                pPlot = pCity.getCityIndexPlot(iIndex)
                                                if not ( pPlot.isWater() or pPlot.isPeak() ) or pPlot.isCity() or pPlot.getNumUnits(): continue
                                                lPlots.append(pPlot)
                                pPlot = lPlots[gc.getSorenRandNum(len(lPlayers), "")]
                                del(lPlots)
                                pBarbarian = gc.getPlayer(gc.getBARBARIAN_PLAYER())
                                dUnitEra = {
                                        gc.getInfoTypeForString("ERA_ANCIENT") : "UNIT_WARRIOR",
                                        gc.getInfoTypeForString("ERA_CLASSICAL") : "UNIT_SWORDSMAN",
                                        gc.getInfoTypeForString("ERA_MEDIEVAL") : "UNIT_MACEMAN",
                                        gc.getInfoTypeForString("ERA_RENAISSANCE") : "UNIT_MACEMAN",
                                        gc.getInfoTypeForString("ERA_INDUSTRIAL") : "UNIT_MUSKETMAN"
                                        }

                                eDefaultUnit = "UNIT_RIFLEMAN"
                                eUnit = gc.getInfoTypeForString(dUnitEra.get(pBarbarian.getCurrentEra(), eDefaultUnit))
                                pBarbarian.initUnit(eUnit, pPlot.getX(), pPlot.getY(), -1, 4)
                ##Barb Spawning Code
		CvTopCivs.CvTopCivs().turnChecker(iGameTurn)

if it doesn't work as desired tell me and I will look into it! you can change the chance of a barb spawning by increasing or decreasing:

iBarbChance = 5

which is the chance of a barb spawning on that turn!
 
We didn't have a 5th event, did we?

Forgot to take a look at the units in the paramilitary forces event, have to remember that :ack:.

-The Indian Empire wants to join civilization with us. (Required that neither civ is top 3 in score[Since superpower would not do this, and to restrict it from happening in small games], neither can be vassel, Indian civ can not be player, etc)
*Conjoing our empires is a great idea! (All of India becomes Germany, culture and units and everything. German civ renamed to "German-Indian Empire", all other things renamed as well.)
*We are to strong to be dragged down by the Indian Empire, but possibly they would be interested in becoming our vassel (10% chance India becomes Germany vassel)
*Absolutely not.

Spoiler :
attachment.php


- 2 civs are randomly choosen (via the event system; The civs must share borders)
- The absorbed civ cannot be human
- The absorbed civ has to be at war, but not with the absorbing civ
- The absorbed civ must rank last or second last in the scoring
- The absorbing civ must have nationalism as tech

*note to myself: Add a check that the absorbing civ is not in the top3.


Second option will create a vassal (always), AND will lead to a war declaration against the civs with which the vassal is at war, whereas the first answer doesn't.

3)International company wants to move its HQ to your city of X
*Make sure it happens, loose a lot of gold, HQ goes moves to that city, -relation with original hq civ
*Donate money to the cause, loose some gold, 25% chance
*Send best wishes, 10% chance
*Decline invitation, -X% gold, +relation with that civ

Spoiler :
attachment.php


- 2 civs and 2 cities from these are randomly choosen (via the event system; The civs must share borders)
- Both players are not allowed to have mercantilism or state property
- both players are not allowed to be at war with each other
- One city must have a HQ, the other one isn't allowed to have one
- The triggering civ must have the tech industrialism, the other one corporation (...kind of redundant, I know)
- No other checks. Could anyone think of anything which makes sense? (Don't think anything else is really required; a HQ will even work without the necessary resources)

First 3 options like described (might maybe change one to give free executives instead), last gives just a reduction for the inflation.


Anything to criticize regarding the text? Not sure if everything is at least a bit good :blush:.
 

Attachments

  • assimilation.jpg
    assimilation.jpg
    170.2 KB · Views: 292
  • corporation_relocation.jpg
    corporation_relocation.jpg
    163.6 KB · Views: 232
Nice work, they look really good :goodjob:

For text, the second one, definatly needs commas around "due to economical difficulties". Also changed willed to willing at the end of it. Also i would change the discount part. Tax discount and discount on real estate doesn't sound right. I would simplify it to tax discounts or atleast change to tax and realistate discounts.

For first one, I would really suggest taking one path or another. Either economical or war. Because in the text, it says due to economical problems, so there should not be a requirement for the civ being absorbed to be at war. Also for the first oiption you definatly need to go to war with the civs the civ being absored with is at war with. Because without it then there is no reason to go with the second option. Going to war is worse then giving up the gold, and vassel is definatly worse then taking the civ. Like I said though, choice either war or economy.
 
the code I posted wasn't an event but it was code that can spawn barbs in cultural borders. Requested in easter :blush: and I completely forgo about it.
 
Thought that ;).
Was rather a general question if dacubz wants to have a 5th one.

Also for the first oiption you definatly need to go to war with the civs the civ being absored with is at war with. Because without it then there is no reason to go with the second option. Going to war is worse then giving up the gold, and vassel is definatly worse then taking the civ. Like I said though, choice either war or economy.

:hmm: good point.
If I attach the war declarations to the first option, do you think it's then more balanced?

Rest is acknowledged.
 
It wouldd be more balanced, but more importantly it would make more sence. Why would you go to war with people if they become your vassal but not if you absorb them into your empire? Its like the player that is at war with the one being absorbed says "Well we will go to war at you because you are protecting them a little, but if you protect them a lot we will not."

But if you are staying economic route and not going war route, then I would remove war check. Is it possible to have it say if the vassal is at war? Because if you are playing with 20 some civs, you most liekly will not know every war, and that could really sway your opinion because they could be at war with your two biggest allies, or it could be at peace. If that is not possible and you are going economic route I would take out the war declaration as simply saying "Enter the wars that XXX is currently in" Simply is not enough info imo
 
I didn't really intend to make an economic and a militaristic option, just wanted to have 2 different options ^^.
Okay, swapping that part will make more sense :).

I think you're able to open the foreign advisor in such a situation, even with a popup (will have to check that, but I think so).
 
How about a quest for the 5th event? Im not really sure how quests work though, here are 2 base ideas
1)Requires an empty one square island. Basically the island wants to join a country but wants some money. It asks all countries to send money, and all civs get to decide if they want to. Whichever one sends the most they join (nice city, 3 or 4 population).All civs loose the money they bet if they win or lose
2)Same concept except with paramilitary force. Whoever sends most money gets some units.

These sound like events to me beside the fact that they require it to be all civs. Not sure again how quests work so these may not be close to doable
 
I moved the question by flying toaster to its own thread here.

@ dacubz: Not doable, at least I'd not know how. The popups will always have predefined answers, so there's no box to put a number in (and I can't see how else to do it) :dunno:.
 
Fair enough, since putting in a bunch of options for cash would simply be annoying

Which event did you not do? I gave you three to begin with that you said you would do then you just did two so unless I suck at math thats five :lol: just curious which one you did not do
 
Spoiler :
If someone else has a suggestion for an event by all means use their idea, but I got two I think are good that I dont want to forget

-India wants to build a highway(or railroad, road etc) between one of their cities and one of yours. Assume you are the Germans
*Let them in right away and ensure that it is the fastest highway (or raildroad, road etc) in the world! (-100 gold, requires open borders already between the two civs, all of those plots +1 movement, +1 relation between civs, builds raod between cities. I dont know if +1 movement can be done)
*Definatly! But to let in their workers we will need to sign an open borders pact (Requires no open borders to start with, starts open border between two civs, builds road)
*Tell them we will let them build it, then capture their workers! (+1 worker, - relation between civs)
*We will never work with the Indian Empire!
Plays message "The Indian Empire is hoping to build the great Indian-German highway."


This one, since doing pathfinding is not that easy.
So...another suggestion?
 
Ahh yes, so you did the original three? The religious revoultion and all?

A Television chanel in the city of X wants to create a huge tv show about crab fishing.
*Requires the city to have atleast two crabs in the area and have fishing boats on both
*Requires a harbor
1)How about creating a movie instead?! (+1 Hit Movie)
2)Can't Wait to watch that one myself! (+culture and gold in that city, +1 gold on that spot)
3)Maybe we can send in a government owned boat ourselves (+ alot gold in that city, + 1 gold on that plot, have to give up trasnport unit)

Not sure how much python that requires, sort of added that last one to require more python, but I couldnt think of anything else and I was watching a crab fishing show :lol:

Give me a bit and I can probably come up with something else
 
Is there a command for adding air space? If so its fairly obvouis

The airport in XXX would like to expand
1)-a lot of gold, +2 airspace
2)-some gold, +1 airspace
3)Nothing

Didn't go to much in detail because i don't know if there is a command for that

You could add a new building via XML that does it, then give the building with the event.
Name it expanded airport. :p
 
Back
Top Bottom