Possible new Mod-making Slavery-and Serfdom more Interesting

I will try again tonight but-if that fails-I will upload what I have so far, and see if you can see where I am going wrong. There are no parseing errors, as I checked this BEFORE I tried to load.

Yours,
Aussie_Lurker.
 
Aussie_Lurker said:
I will try again tonight but-if that fails-I will upload what I have so far, and see if you can see where I am going wrong. There are no parseing errors, as I checked this BEFORE I tried to load.

Yours,
Aussie_Lurker.

download XMLSpy it has 30 days free trial licence, so you may be able to finish your work with XML and see what is wrong with it.

But how to call unit? Snaitf have this unit allegence mod, so how to call special unit? UNIT_SLAVE or UNIT_WORKER?

newUnit = playerX.player.initUnit(pLoser.getUnitType(), pWinner.getX(), pWinner.getY(), UnitAITypes.NO_UNITAI)
 
I see in another thread that LRD has made a slave Skin to replace the worker, I think it would be nice to have this included as an additional type of worker that just requires the Slave Market building as a Pre-requisite for building. It would be cheaper then a regular worker and might have some limitations to what it can build (my thoughts are only Farm, Plantation, Mine, Quarry, Road).

Also their realy needs to be some interaction with Plantations, either build faster or perhaps they become avalible before Calandar or get +1 gold. Possibly make Plantation an upgrade to Farm rather then a whole seperate improvment. Historicaly Plantations arn't just for "special" things all kinds of agriculture would be conducted on plantations because Plantation are simply large farms that use Slave labor.
 
Hi everyone. Just thought I would give a quick update on my progress (which has been very little, I'm afraid, due to Christmas stuff).
Anyway, the basic slavery script seems to work, in that it does add a slave to your population when you are in slavery. I need to check this with a new city, though, to see what impact a -1 culture commerce has on a 0 culture city.
My next step will be to give the slave an appropriate 'icon' in the city screen (I think the settler one would be best, personally) and then look at playing around with slavery-based buildings and units.

Yours,
Aussie_Lurker.
 
:D I found answer to my question. To get sertain units like slave as a combat result you just have to mod Snaitf's "Unit Allegence mode" code so:

Code:
def onCombatResult(self, argsList):
		'Combat Result'
		pWinner,pLoser = argsList
		playerX = PyPlayer(pWinner.getOwner())
		unitX = PyInfo.UnitInfo(pWinner.getUnitType())
		playerY = PyPlayer(pLoser.getOwner())
		unitY = PyInfo.UnitInfo(pLoser.getUnitType())
		#############################
		## Start Modifaction Block ##
		#############################
		xType = unitX.getUnitCombatType()
		yType = unitY.getUnitCombatType()	
		if (yType != gc.getInfoTypeForString("UNITCOMBAT_SIEGE") and yType != gc.getInfoTypeForString("UNITCOMBAT_ARMOR") and yType != gc.getInfoTypeForString("UNITCOMBAT_HELICOPTER") and yType != gc.getInfoTypeForString("UNITCOMBAT_NAVAL") and yType != gc.getInfoTypeForString("NONE")):
			if (xType != gc.getInfoTypeForString("UNITCOMBAT_HELICOPTER") and xType != gc.getInfoTypeForString("NONE")):
				iRand = random.randint(1, 100)
				if (iRand <= 5):
					newUnit = playerX.player.initUnit(pLoser.getUnitType(), pWinner.getX(), pWinner.getY(), UnitAITypes.NO_UNITAI)
					newUnit.finishMoves()
					newUnit.setDamage(50, False)
					newUnit.setExperience(pLoser.getExperience(), -1)
					newUnit.setLevel(pLoser.getLevel())
					for iCount in range(gc.getNumPromotionInfos()):
						if (pLoser.isHasPromotion(iCount)):
							newUnit.setHasPromotion(iCount, True)

##End Snaitf code and start LittleRedPoint slavery code :) code#################################################

		player = gc.getActivePlayer()	
		xType = unitX.getUnitCombatType()
		yType = unitY.getUnitCombatType()
		unitSlave = gc.getInfoTypeForString("UNIT_SLAVE")
		if (player.isCivic(gc.getInfoTypeForString("CIVIC_SLAVERY"))):
			if (yType != gc.getInfoTypeForString("UNITCOMBAT_SIEGE") and yType != gc.getInfoTypeForString("UNITCOMBAT_ARMOR") and yType != gc.getInfoTypeForString("UNITCOMBAT_HELICOPTER") and yType != gc.getInfoTypeForString("UNITCOMBAT_NAVAL") and yType != gc.getInfoTypeForString("NONE")):
				if (xType != gc.getInfoTypeForString("UNITCOMBAT_HELICOPTER") and xType != gc.getInfoTypeForString("NONE")):
					iRand = random.randint(1, 100)					
					if (iRand >= 80):
						newUnit = playerX.player.initUnit(unitSlave, pWinner.getX(), pWinner.getY(), UnitAITypes.NO_UNITAI)
						newUnit.finishMoves()
		#############################
		##  End Modifaction Block  ##
		#############################

So now it is possible to make event to combat that you have chance to get some units what you like. This has a condition that active player must have civic slavery then you have cance 20% to get slave as combat result. First you must add slave to your Civ4UnitInfos.xml

I keep the Snaitf-s code in game and i put this new code under Snaitf-s code. The random condition must be changed to "if (iRand >= 80):" that you can't get both. Now itis possible to get slave or unit.
But you have 25% overall chance to get something from battle.

Snaitf is genius!!! :D He made good option to add new functionality! He is my hero!
 
Will this also over ride the normal Capturing of Settlers/Workers with Slaves? If slaves are going to be basicaly like a worker but inferior (but cheap enough to make building them desirable) then the player would be better off with the normal worker recived from capturing these units. Some additional sweatener would need to be added to make slavery desirable.

Perhaps if you get 2 slaves when a worker is captured and 3 if a settler is captured (ofcorse this will all depend on how usefull slaves actualy are).

Also are you aware that the unit recived on defeating a unit apears to be encoded in the units XML, worker and Settler both have settler as their capture value, all other units have none.
 
Impaler[WrG] said:
Will this also over ride the normal Capturing of Settlers/Workers with Slaves? If slaves are going to be basicaly like a worker but inferior (but cheap enough to make building them desirable) then the player would be better off with the normal worker recived from capturing these units. Some additional sweatener would need to be added to make slavery desirable.

Perhaps if you get 2 slaves when a worker is captured and 3 if a settler is captured (ofcorse this will all depend on how usefull slaves actualy are).

Also are you aware that the unit recived on defeating a unit apears to be encoded in the units XML, worker and Settler both have settler as their capture value, all other units have none.

This capturing system is a bit diferent it isn't affect the normal capturing option of worker or settler. It makes possible to get slave as combat result.
You may change the unit type, to get great general as a combat result.
I added the contition if player has civic slavery. So you get slave as combat result if your civic option is slavery.
 
Hiya Guys.

Well, time for a long-overdue update. Things are moving along at a Snails pace but-well-at least they are MOVING (and in the right direction too ;) )
Anyway, I have now successfully added the building 'Slavemarket' to the BuildingInfo xml file, and it seems completely stable. All I need now are icons for it-and slave specialists-in both the Civilopedia and City Management screens (anyone able to tell me how I can successfully borrow icons of other improvements and specialists?)
Anyway, the next step is to add the National Project 'Slave Labour System'-which will add a free SlaveMarket to every city. Then, once that is done, I just need to add the python script which makes them only visible when you are in slavery. Once those 2 major steps are complete, then I can call stage 1 of my Civics Mod officially finished. Thanks to everyone for all there help so far, I couldn't have gotten even this far without your assistance. Especial thanks to Mylon, Snaitf and LittleRedPoint-you guys have been phenomenal.

Yours,
Aussie_Lurker.
 
Back
Top Bottom