[BtS] JKP1187's EVENTS

Sorry, Im Sort of new to CIV 4 and I dont know any of this code, (Wish I did) When Im installing this, Where do I put it in?
 
Unzip the file's contents into this path:

C:\Program Files\Firaxis Games\Sid Meier's Civilization 4\Beyond the Sword\Mods

A new folder titled "JKP1187's EVENTS" will automatically be created.

Afterwards, to load, go to ADVANCED from the main Civ menu, then select "Load a Mod" and select JKP1187's EVENTS.

To make things quicker, you can set up a shortcut so that you can load the events mod directly from startup. The "target" in the shortcut should be set at:

"C:\Program Files\Firaxis Games\Sid Meier's Civilization 4\Beyond the Sword\Civ4BeyondSword.exe" mod=/JKP1187's EVENTS

(The path may change depending on what folder your copy of Civ4BeyondSword.exe is located.)
 
Aw, I thought it was something that could be used with any scenario/map.

Nonetheless, I Installed it. Thanks :p.
 
It can be, but you'd need to either merge the mods (which, if there are no alterations to the random events files or CvEventManager.py, would just be a matter of copying JKP1187 Events files over to the appropriate folder,) or (I believe) by putting the events files in the Custom Assets folders. (I'm not sure exactly how Custom Assets works, so you'd need to poke around the forum.)
 
Updated to v.1.21. Also -- the file is uploaded to a third-party server due to recent issues with the CFC server.

v. 1.21

1.) The major change is that I streamlined the Python code. Somehow, when I entered the code into IDLE (often copying and pasting from other files, especially when I wrote it in another text editor then transferred it over,) the tab spacing went all screwy, but IDLE, for some reason, never got it to look right. It was all still working, but this may have created some problems for users who tried to copy and paste the code into their own mods. I went back using Notepad++ and made sure that all of the tabs and spacing was in conformity for all of my code. I also deleted some code that I wasn't using, but had left in as comments.

2.) Adjusted trigger chances for several events (in most cases, made them more likely to occur.)

3.) Fixed typo in "Futbol War" code.

4.) XP necessary for unit to trigger "Crossing the Rubicon" is now 10, not 12.
 
FYI -- I just uploaded a slightly cleaner version; after checking it on my lunch break, there were still a few tabs here and there that I needed to clean up. No substantive changes.

@ Ekmek: Malaccan Pirates? C'mon, it's just a few transports, what's the big deal? :D
 
Hi jkp!

I am impressed by your events, in particular the pirates events. :goodjob: I have a couple of questions:

Is it possible to scale the fleet requirements to the number of coastal cities, as well as map size? So that it would require, say, one ship per coastal city, PLUS a number depending on map size? I think that would be a neat way to take into account not just the map size, but also the map type. On a archipelago map, you're bound to have more coastal cities, than on a pangea map, for example.

The second question: How often do these events fire per game? If I'm not mistaken, there's a chance they won't fire at all in any particular game? But if it DOES fire, how many times per game can they fire?
 
Hi jkp!

I am impressed by your events, in particular the pirates events. :goodjob: I have a couple of questions:

Is it possible to scale the fleet requirements to the number of coastal cities, as well as map size? So that it would require, say, one ship per coastal city, PLUS a number depending on map size? I think that would be a neat way to take into account not just the map size, but also the map type. On a archipelago map, you're bound to have more coastal cities, than on a pangea map, for example.

The second question: How often do these events fire per game? If I'm not mistaken, there's a chance they won't fire at all in any particular game? But if it DOES fire, how many times per game can they fire?

For your first question, that would probably be possible. You'd need to edit the Python script for each event, and I'm not sure off the top of my head what script would be used, but I can't think of any reason why it wouldn't be doable. Unfortunately, I haven't had a lot of time for modding lately.

For the second question, iPercentGamesActive is set at "40" or "50" for the new pirate events except "Pirates of the Neutral Zones", which I've evilly set at "100". iPercentGamesActive is a % chance that the event will be available for being called in any game (so 100 = it will be in 100% of all games).

iWeight is a number that helps determine how likely it is that the event -- if it is active in the game -- will be triggered, assuming that the other prerequisites are met. I do not know what the upper limit on this number is, but "200" seems to be the average. I've set the weight at 220 for these pirate events (again, except Neutral Zones, which is at 400.)

Increasing one or both of these numbers will increase the likelihood of these events being in more of your games.

Like all barbarian events, the events can only be triggered once in a game.

If you're interested, check out Solver's "how-to" thread on events modding:

http://forums.civfanatics.com/showthread.php?t=230567
 
Thanks for the reply! :) Just to be clear: Can they fire once per player per game, or just once per game?
 
Once per game. If you wanted to change it, set <bGlobal> to "0", but I wouldn't recommend that. Pirate ships can travel far, especially in the later game, and will probably be able to affect more than one civ anyway.
 
I checked this for compatibility with 3.17 and it needs some minor changes. As far as I can see it, it's compatible/playable with 3.17.

JKP, I noticed your Blessed Sea event fix made it into the 3.17 patch (although slightly different coded):

JKP fix

Code:
def canTriggerBlessedSea(argsList):
	kTriggeredData = argsList[0]
	map = gc.getMap()
[B]#### Start of JKP1187's fix
	pPlayer = gc.getPlayer(kTriggeredData.ePlayer)
	iGalley = CvUtil.findInfoTypeNum(gc.getUnitClassInfo, gc.getNumUnitClassInfos(), 'UNITCLASS_GALLEY')
	iCaravel = CvUtil.findInfoTypeNum(gc.getUnitClassInfo, gc.getNumUnitClassInfos(), 'UNITCLASS_CARAVEL')
	iGalleon = CvUtil.findInfoTypeNum(gc.getUnitClassInfo, gc.getNumUnitClassInfos(), 'UNITCLASS_GALLEON')
	pPlayerGY = pPlayer.getUnitClassCount(iGalley)
	pPlayerCL = pPlayer.getUnitClassCount(iCaravel)
	pPlayerGN = pPlayer.getUnitClassCount(iGalleon)
	pAggregate = pPlayerGY + pPlayerCL + pPlayerGN

	if pAggregate < 1:
		return False
#### End of JKP1187's fix[/B]

	if gc.getGame().isOption(GameOptionTypes.GAMEOPTION_ONE_CITY_CHALLENGE) and gc.getPlayer(kTriggeredData.ePlayer).isHuman():
		return false


	iMapMinLandmass = 2 * gc.getWorldInfo(map.getWorldSize()).getDefaultPlayers()
	iOurMaxLandmass = gc.getWorldInfo(map.getWorldSize()).getDefaultPlayers() / 2
	
	if (map.getNumLandAreas() < iMapMinLandmass):
		return false

	iOurLandmasses = 0
	for i in range(map.getIndexAfterLastArea()):
		area = map.getArea(i)
		if not area.isNone() and not area.isWater() and area.getCitiesPerPlayer(kTriggeredData.ePlayer) > 0:
			iOurLandmasses += 1
			
	if (iOurLandmasses > iOurMaxLandmass):
		return false
			
	return true

Firaxis fix

Code:
def canTriggerBlessedSea(argsList):
	kTriggeredData = argsList[0]
	map = gc.getMap()
		
	if gc.getGame().isOption(GameOptionTypes.GAMEOPTION_ONE_CITY_CHALLENGE) and gc.getPlayer(kTriggeredData.ePlayer).isHuman():
		return false


	iMapMinLandmass = 2 * gc.getWorldInfo(map.getWorldSize()).getDefaultPlayers()
	iOurMaxLandmass = gc.getWorldInfo(map.getWorldSize()).getDefaultPlayers() / 2
	
	if (map.getNumLandAreas() < iMapMinLandmass):
		return false

	iOurLandmasses = 0
	for i in range(map.getIndexAfterLastArea()):
		area = map.getArea(i)
		if not area.isNone() and not area.isWater() and area.getCitiesPerPlayer(kTriggeredData.ePlayer) > 0:
			iOurLandmasses += 1
			
	if (iOurLandmasses > iOurMaxLandmass):
		return false

[B]	player = gc.getPlayer(kTriggeredData.ePlayer)
	if player.getUnitClassCount(CvUtil.findInfoTypeNum(gc.getUnitClassInfo, gc.getNumUnitClassInfos(), 'UNITCLASS_GALLEY')) == 0:
		if player.getUnitClassCount(CvUtil.findInfoTypeNum(gc.getUnitClassInfo, gc.getNumUnitClassInfos(), 'UNITCLASS_CARAVEL')) == 0:
			if player.getUnitClassCount(CvUtil.findInfoTypeNum(gc.getUnitClassInfo, gc.getNumUnitClassInfos(), 'UNITCLASS_GALLEON')) == 0:
				return false[/B]
			
	return true

I'll post an updated version of this mod in a next post.
 
JKP, I have merged the 3.17 patch changes for this mod. I'm not sure if I have done the merge for the text changes as you would like it (I remember you changed something in the text for the impeachment event), so you might have to redo CIV4GameText_Events_BTS.xml. The only file I haven't changed is Civ4PromotionInfos.xml

EDIT: impeachment texts

<English>The House of Representatives has impeached the President due to alleged corruption and the Senate is now debating whether or not to remove him from office. Polls indicate the President is losing support rapidly among the people.</English>

vs. Firaxis 3.17:

<English>The Congress wants to impeach the President. The population supports this motion.</English>

What is the right one again?
 

Attachments

  • JKP1187's EVENTS 3-17.zip
    310 KB · Views: 196
Top Bottom