Platy's Peculiar Pleasant Posh Python

Mercernaries Update

1) Fix 2 bugs, 1 with promotion, 1 with city selection

2) Added 3 units available only via Mercernary System

A) Light Cavalry, Classical Era, Treated as 60 Hammers
B) Papal Pikeman, Medieval Era, Treated as 70 Hammers
C) Dreadnought, Future Era, Treated as 250 Hammers

I wanted to finish doing 1 for each Era, but then those 2 bugs are pretty vital, so upload first.

There are a few more things I want to settle first, before I implement the A.I.
First of all, will be XP based on Era, so that not too OP grandmasters at early eras or lame ones at late eras.

Currently, the only A.I. in place is "buy one grandmaster when too rich".
A.I. does hire the 3 new types.
 

Attachments

  • Civ4ScreenShot0006.JPG
    Civ4ScreenShot0006.JPG
    117.5 KB · Views: 184
  • Civ4ScreenShot0007.JPG
    Civ4ScreenShot0007.JPG
    120.7 KB · Views: 159
  • Civ4ScreenShot0008.JPG
    Civ4ScreenShot0008.JPG
    116.5 KB · Views: 168
  • Civ4ScreenShot0005.JPG
    Civ4ScreenShot0005.JPG
    89.5 KB · Views: 142
Slinger can be used for ancient, as it's art is already implemented in BTS. Swiss Pikeman is more Renaissaince IMO, as there is a nice horseman and mounted swordsman implemented in BTS as well that could be used for Medieval as well, assuming you want to upload as little art as possible
 
@ dacubz: I didn't even know there was a Slinger unit in BtS...
But if Gold trading is needed then you are already in Classical era.

@ The Great Golden Python Engineer: what about Mercenaries only hired in Capital city?

Platypedia: Here is a version of Platypedia_CIV4GameText.xml with all 213 tags filled in for each language, although all in English (+ very few translations into French). Awful job! :D

I guess it could be useful for incorporation in the published mods.

Nothing comes out for the Processes page (no Python error). Any idea why?

For the New Concepts page, there is ascii codec error bla bla special accents etc.

EDIT: also: for my mod only, the unit upgrade path does not work. Is it because it is intended for non-limited units only?
 
Mercernaries

Civ4ScreenShot0002_zps9f33ee18.jpg


1) Can only hire at Capital, simpler for A.I.

2) Hiring Costs adjusted (Because Hurry Cost is 3 :gold: : 1 :hammers:, doesn't make sense for hiring to be cheaper than hurry, else who will hurry)

Amateur: From 2 to 3 Times
Standard: From 3 to 5 Times
Elite: From 5 to 8 Times
Grandmaster: Remains at 10 Times

3) XP adjusted to be a % based on what it will be if the unit was trained in the city

Amateur: 50%
Standard: 100%
Elite: 125%
Grandmaster: 150%

Basically, Amateur is like drafting, cheap but low XP.
This way, Grandmaster is not OP in early eras with 20XP units running around, but it is not useless in late eras, since it will always be higher XP than trained ones, since cost so high.
Although in early eras where XP difference among the grades is minimal, Grandmasters still benefit from their promotions, so that justifies the cost.

4) A.I.
During peace time, hire 1 GrandMaster every turn, if surplus gold > 5 times of GrandMaster Cost
During war time, hire up to 5 Standards every turn, so long as it can afford

5) Special Mercernaries
Each of them is only available through mercernary system.
Each of them can last through multiple eras.
You can add as many units as you like, the codes have already been done.

Spoiler :

Code:
		## Available Era, Unit, Cost, Last Available Era
self.EraMercs =	[["ERA_ANCIENT", "UNIT_PELTAST", 25, "ERA_CLASSICAL"],
		["ERA_CLASSICAL", "UNIT_LIGHT_CAVALRY", 50, "ERA_MEDIEVAL"],
		["ERA_MEDIEVAL", "UNIT_HEAVY_SWORDSMAN", 60, "ERA_RENAISSANCE"],
		["ERA_RENAISSANCE", "UNIT_PAPAL_PIKEMAN", 80, "ERA_INDUSTRIAL"],
		["ERA_INDUSTRIAL", "UNIT_GUERILLA", 120, "ERA_FUTURE"],
		["ERA_MODERN", "UNIT_DREADNOUGHT", 250, "ERA_FUTURE"],
		["ERA_FUTURE", "UNIT_ASSAULT_MECH", 250, "ERA_FUTURE"]]

Civ4ScreenShot0011_zps0088e36b.jpg


Civ4ScreenShot0001_zps2de4deb4.jpg


Civ4ScreenShot0014_zps74d906d0.jpg


Civ4ScreenShot0012_zpsbc6873c2.jpg


Civ4ScreenShot0010_zps9eb8e269.jpg


Civ4ScreenShot0013_zps85be6dd4.jpg


Civ4ScreenShot0009_zpsd2cda4a1.jpg
 
@isenchine
Processes only appear in game, not in main menu.
Don't ask me why.

New Concepts, which one?

Unit Upgrade Path, define "does not work"
 
Can you tweak AI to hire during war only if fights with much stronger civ. Civ strength can be taken from scoreboard.
 
@isenchine
Processes only appear in game, not in main menu.
Don't ask me why.

New Concepts, which one?

Unit Upgrade Path, define "does not work"

1) Indeed, thanks!

2) "Game concepts" actually

3) Sorry, thought you would just answer directly. I spare you the 4 first lines of error, then:

File "UnitUpgradesGraph", line 288, in getGraph

KeyError: 114
 
I only provide basic A.I. necessary to function.
For modders that want more sophisicated A.I. like hire more if Aggressive Trait, DIY :D

Generally, I disagree anyway.
Even if fighting against a weak opponent, it is still useful to hire more, to end the war faster, which brings benefits to the winner faster, like more cities etc

Also, it is seldom a one on one war.
If A.I. is fighting against 3 civs, then what to do?
Count the total strength of all 3, or take average or take highest?

@isenchine
@Game Concepts
Nvm, Fixed and uploaded

@Upgrade Path
You have the same problem as Vincent, your upgrade paths are too complicated for the file to processs.
Play around with unitSplitOutgoing = [] and unitSplitIncoming = [] to split some paths into 2.
 
@CivCiv5

Done, but this is the first and last time I bother...

I really ought to start my donation box :D

Inquistion Updates
Replaced Model with BTS one, didn't know there was one
 

Attachments

  • Civ4ScreenShot0004.JPG
    Civ4ScreenShot0004.JPG
    110.4 KB · Views: 135
  • Civ4ScreenShot0003.JPG
    Civ4ScreenShot0003.JPG
    126.9 KB · Views: 169
  • Civ4ScreenShot0000.JPG
    Civ4ScreenShot0000.JPG
    103 KB · Views: 171
DIY means Do It Yourself i guess :D
 
I will give you some ideas, your's if you want to accept them:

1. Peaceful Victory (don't act in any war, be in peace 75% turns of the total number of turns)

2. Civics Unions
1st version of idea:
(Similar from "FFH2 or Rise from Erebus", No Membership, Overcouncil and Undercouncil, but you can replace councils names with NATO, Warsaw Treaty whatever, if player choose their membership that act like Apostolic Palace or United Nations, i hope that you understand me if are you ever played FFH2)

2nd version:
Players vote if some player want to join to Treaty of Security General of the Treaty choose that.

Example:

"Fanatic" want to join to NATO(require 100 of 200).

Montezuma votes Yes (56 votes)
Bismarck votes No (44 votes)
Sitting Bull votes Yes (50 votes)
Alexander votes Yes (50 votes)

156 of 200 (require 100)

Succeed! "Fanatic" joined NATO.
____________________

"platyping" want to join to NATO (require 120 of 240)

Montezuma votes Yes (56 votes)
Bismarck votes No (44 votes)
Sitting Bull votes Yes (50 votes)
Alexander votes Yes (50 votes)
Fanatic votes No (40 votes)

156 of 240 (require 120)

Succeed! "platyping" joined NATO.
_____________________

"Player123" want to join to NATO(require 150 of 300)

Montezuma votes No (56 votes)
Bismarck votes No (44 votes)
Sitting Bull votes No (50 votes)
Alexander votes Yes (50 votes)
Fanatic votes No (40 votes)
platyping votes Yes (60 votes)

Fail! Player123 can't join to NATO 110 of 300 (require 150).


3th version:
All 1st version + Players of the same Treaty can't fight among themselves (all NATO's members cannot declare war on each other and have open borders among themselves), if player change to Enemy Treaty from NATO to Warsaw Treaty, player receive -2 relation points with all NATO's members, if choose No Membership, player doesn't receive any relation point.

4th version:
1st+2nd+3th.

3. Ocean, coast and mountain movement promotion (sorry if you already made that)

4. Promotion for collateral damage
+1,2,...,X collateral unit/s damage.

<iCollateralDamageMaxUnits>6</iCollateralDamageMaxUnits>

if promotion give +1, units now can damage 7 units.
 
1) no use.
What if there are 4 teams in the game and none is at war.
Who wins.
Also, what have you done to deserve victory?

2) nope, I did not play either mod.

3) votes, restricted to whatever is available in xml. Anything new is SDK

4) cannot declare war is pretty easy by activating one callback.
Not good for ai because they will never know why they cannot whack you when they hate you so much.

5) movement promotion is possible provided you are willing to activate a performance taxing callback, which means leave it to SDK

6) collateral is not possible because it is usually done via air or siege units and neither of them trigger oncombatresults
 
Mercernaries

1) Did some trials and errors to find another way to make mercernaries unable to be built and only available by hiring.

The simplest way was to set iCost to -1, but it comes with a problem.
Upgrade Cost becomes pretty high, since you are upgrading a unit with iCost 0 rather than the intended cost.

Thus, the alternative was to set a dummy tech and place them there so that iCost can be > -1 and still untrainable. This requires additional files so I decided to play around with another option.

The conclusion was to set them as team units with max instance 0.
The only drawback is in the pedia they will be identified as team units, but the cost can now be directly implemented in the XML, which makes it easier for modders and solve upgrade cost.

2) Some editing with artdefines to shrink size of fat robot, make peltast and guerilla appear in groups of 3 etc

3) No longer allowed to purchase units without their pre-requisite resources.
To be fair for the A.I., because currently A.I. choice of mercernaries will be either the new units or whichever it is training, so they will never choose those they cannot train.
But all the new ones do not need any resources, which means the A.I. will still hire Heavy Tanks and lame Robots without access to Oil, Uranium, whatever.

4) Better A.I. idea of at war.
A.I. will only consider buying in bulk when there are more than 4 units in their territory in same landmass of capital.
Which means, if it is fighting a war across the ocean, it won't waste $$ buying Standards in bulk, until 5 enemies landed on their continents.

5) Easier Configuration for modders
Values like Max number of enemies before buying in bulk, or addition of new units are set up in simplest way I can provide in the Mercernaries file itself.
Just change the values in the ini part and don't touch anything below unless you know what you are doing.

6) Mercernaries now come with free promotions provided in the Capital, like Red Cross

If there is nothing else, this mod component is considered completed.
 

Attachments

  • Civ4ScreenShot0000.JPG
    Civ4ScreenShot0000.JPG
    116.8 KB · Views: 141
Code:
<?xml version="1.0"?>
<Civ4UnitClassInfos xmlns="x-schema:Mercernaries_CIV4UnitSchema.xml">
	<UnitClassInfos>
		<UnitClassInfo>
			<Type>UNITCLASS_GUERILLA</Type>
			<Description>TXT_KEY_UNIT_GUERILLA</Description>
			<iMaxGlobalInstances>-1</iMaxGlobalInstances>
			<iMaxTeamInstances>-1</iMaxTeamInstances>
			<iMaxPlayerInstances>-1</iMaxPlayerInstances>
			<iInstanceCostModifier>0</iInstanceCostModifier>
			<DefaultUnit>NONE</DefaultUnit>
		</UnitClassInfo>
		<UnitClassInfo>
			<Type>UNITCLASS_ASSAULT_MECH</Type>
			<Description>TXT_KEY_UNIT_ASSAULT_MECH</Description>
			<iMaxGlobalInstances>-1</iMaxGlobalInstances>
			<iMaxTeamInstances>-1</iMaxTeamInstances>
			<iMaxPlayerInstances>-1</iMaxPlayerInstances>
			<iInstanceCostModifier>0</iInstanceCostModifier>
			<DefaultUnit>NONE</DefaultUnit>
		</UnitClassInfo>
		<UnitClassInfo>
			<Type>UNITCLASS_HEAVY_SWORDSMAN</Type>
			<Description>TXT_KEY_UNIT_HEAVY_SWORDSMAN</Description>
			<iMaxGlobalInstances>-1</iMaxGlobalInstances>
			<iMaxTeamInstances>-1</iMaxTeamInstances>
			<iMaxPlayerInstances>-1</iMaxPlayerInstances>
			<iInstanceCostModifier>0</iInstanceCostModifier>
			<DefaultUnit>NONE</DefaultUnit>
		</UnitClassInfo>
		<UnitClassInfo>
			<Type>UNITCLASS_PELTAST</Type>
			<Description>TXT_KEY_UNIT_PELTAST</Description>
			<iMaxGlobalInstances>-1</iMaxGlobalInstances>
			<iMaxTeamInstances>-1</iMaxTeamInstances>
			<iMaxPlayerInstances>-1</iMaxPlayerInstances>
			<iInstanceCostModifier>0</iInstanceCostModifier>
			<DefaultUnit>NONE</DefaultUnit>
		</UnitClassInfo>
		<UnitClassInfo>
			<Type>UNITCLASS_LIGHT_CAVALRY</Type>
			<Description>TXT_KEY_CHARL_UNIT_LIGHT_CAVALRY</Description>
			<iMaxGlobalInstances>-1</iMaxGlobalInstances>
			<iMaxTeamInstances>-1</iMaxTeamInstances>
			<iMaxPlayerInstances>-1</iMaxPlayerInstances>
			<iInstanceCostModifier>0</iInstanceCostModifier>
			<DefaultUnit>NONE</DefaultUnit>
		</UnitClassInfo>
		<UnitClassInfo>
			<Type>UNITCLASS_PAPAL_PIKEMAN</Type>
			<Description>TXT_KEY_CHARL_UNIT_PAPAL_PIKEMAN</Description>
			<iMaxGlobalInstances>-1</iMaxGlobalInstances>
			<iMaxTeamInstances>-1</iMaxTeamInstances>
			<iMaxPlayerInstances>-1</iMaxPlayerInstances>
			<iInstanceCostModifier>0</iInstanceCostModifier>
			<DefaultUnit>NONE</DefaultUnit>
		</UnitClassInfo>
		<UnitClassInfo>
			<Type>UNITCLASS_DREADNOUGHT</Type>
			<Description>TXT_KEY_UNIT_DREADNOUGHT</Description>
			<iMaxGlobalInstances>-1</iMaxGlobalInstances>
			<iMaxTeamInstances>-1</iMaxTeamInstances>
			<iMaxPlayerInstances>-1</iMaxPlayerInstances>
			<iInstanceCostModifier>0</iInstanceCostModifier>
			<DefaultUnit>NONE</DefaultUnit>
		</UnitClassInfo>
	</UnitClassInfos>
</Civ4UnitClassInfos>
Acts like a UU. Except it replaced "NONE" so in the pedia it doesn't say anything. It can be hired, but not built, and no worries of it being a "Team Unit"

Also not sure if you meant to but your "Standard" Promotion is named Mercenary
 
1) Changed Unit Class definitions as suggested

2) Changed Promotion Name, actually was looking around for a name to replace "Standard", so didn't bother with it.

3) Added codes in case modders want to add air or sea mercernary units.
Sea Mercernaries can only be hired in coastal capitals obviously.
Air Mercernaries take into account air capacity.

4) Color coded the mercernary screen.
Those that are red are for various reasons, such as air capacity limit, not enough gold, national unit limit

5) Strategy Text section now shows the Eras they are allowed to be hired.
 

Attachments

  • Civ4ScreenShot0001.JPG
    Civ4ScreenShot0001.JPG
    121.3 KB · Views: 208
  • Civ4ScreenShot0002.JPG
    Civ4ScreenShot0002.JPG
    119.8 KB · Views: 146
Platy,

About your Victory screen with buttons:

I'm trying to merge your Victory screen with k-mod and BUG, and so far this is the result:
attachment.php


As you can see there is no icons for legendary cities and building voting yet. In the moment my doubt is about the icons of cities. I try put the buttons changing the following code: The first is the original code and second is the code who should call the icon.

Code:
screen.setTableText(szTable, 2, iRow, ourBestCities[i][1].getName() + ":", "", WidgetTypes.WIDGET_GENERAL, -1, -1, CvUtil.FONT_LEFT_JUSTIFY)

Code:
screen.setTableText(szTable, 2, iRow, ourBestCities[i][1].getName() + ":", gc.getCivilizationInfo(ourBestCities[i][1].getCivilizationType()).getButton(), WidgetTypes.WIDGET_GENERAL, -1, -1, CvUtil.FONT_LEFT_JUSTIFY)

But not works, can you give some tips where I take a look to change for this second code works?
 

Attachments

  • victory.jpg
    victory.jpg
    151.4 KB · Views: 562
Code for best cities totally rewritten.
The original was written using pycities which do not have certain functions that cycities have
 
@isenchine
@Game Concepts
Nvm, Fixed and uploaded

@Upgrade Path
You have the same problem as Vincent, your upgrade paths are too complicated for the file to processs.
Play around with unitSplitOutgoing = [] and unitSplitIncoming = [] to split some paths into 2.

Thank you very much for the fix in Platypedia.

For the upgrade path, I tried adding units to unitSplitOutgoing = [] but got a Python syntax error (UNIT_WARRIOR is not defined)... So instead I simplified a bit some upgrades and now it shows fine!
 
Thank you very much for the fix in Platypedia.

For the upgrade path, I tried adding units to unitSplitOutgoing = [] but got a Python syntax error (UNIT_WARRIOR is not defined)... So instead I simplified a bit some upgrades and now it shows fine!

You needed to put quotes around the unit ie 'UNIT_WARRIOR'. It doesn't say that in the doco in the code but that is what needs. ;)
 
Back
Top Bottom