Need help w/Capture and Great General...

rarmonio8920

Chieftain
Joined
Oct 15, 2008
Messages
28
Hi everyone. First post here and I'd like to say that there's a lot of great tutorials here. I've been successful in learning how to work with the XML.

What I'm trying to do has to do with great generals and capturing.

1.) I'd like to have Great Generals be captured and remain as Great Generals. I think that's easily solved if I just change <Capture>NONE</Capture> to <Capture>UNITCLASS_GREAT_GENERAL</Capture> in the Civ4UnitInfos.xml file.

2.) If the Great General has become a Warlord, I'd like to be able to capture the Great General if he has been defeated.

I'm trying to make a Naruto mod and right now, but it hasn't worked too well... :(

If you don't watch Naruto, a Bijuu is simply a demon (9 total throughout the world). A Jinchuuriki is a person that has had the demon sealed into them, making them much more powerful. Bijuus are, for the most part, immortal, but Jinchuuriki are not. So if a jinchuuriki were to be killed, the Bijuu would live on after that.

I've been trying to do the following:
- Create a Bijuu unit, one that is similar to a Great General unit.
- The Bijuu can then be sealed into any unit, becoming a jinchuuriki, similar to how Great Generals can act as a Warlord for (I think) every unit.
- If the jinchuuriki is defeated in battle, I would like for him to be captured as a Bijuu again.

I've been successful in capturing my created Bijuu unit when they are not a Jinchuuriki. But if I kill a Jinchuuriki, it is killed and doesn't remain as a Bijuu.

Any thoughts?
 
That sounds like something you might be able to do in python. When ever a Jinchuuriki unit is defeated, use some python code that creates a new version of the Bijuu nearby.

My python skills are a little weak, but I'm sure you could get some help from the code gurus around here. ;)
 
Uh oh, Python! I've never tried doing that before, but I'm sure I could figure it out. I was able to figure out XML in a couple days... Is the learning curve for Python much steeper?

What would you say would be the simplest script to make? I think it'd work well if a Jinchuuriki were defeated, his respective Bijuu could be re-generated as a Barbarian-type unit that just randomly attacks. It would be very accurate in that Bijuu attacks are supposed to be unpredictable, and like natural disasters.
 
Well, if you have ever done any programming before it shouldn't have too much of a learning curve. I was able to figure out how to do some simple things by looking at what others have done in their mods. Though like I said, I'm not very good at it.

Your plan sounds doable to me. I use something similar in my game that I borrowed and modified from the FFH mod.

In the CvEventManager.py file, I have:

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())
		pPlayer = gc.getPlayer(pWinner.getOwner())

		# Added Mage Mod code; if using Slavery civic you have a 25% chance to recieve a slave unit after defeating an enemy unit.
		if pPlayer.getCivics(gc.getInfoTypeForString('CIVICOPTION_LABOR')) == gc.getInfoTypeForString('CIVIC_SLAVERY'):
			if (pLoser.getUnitCombatType() != gc.getInfoTypeForString('UNITCOMBAT_NAVAL')):
				iRnd = CyGame().getSorenRandNum(100, "Bob")
				if iRnd <= 25:
					CyInterface().addMessage(pWinner.getOwner(),True,25,'You have enslaved the enemy forces!','AS2D_UNITCAPTURE',0,'Art/Interface/Buttons/Units/Worker.dds',ColorTypes(8),pWinner.getX(),pWinner.getY(),True,True)
					newUnit = pPlayer.initUnit(gc.getInfoTypeForString('UNIT_SLAVE'), pWinner.getX(), pWinner.getY(), UnitAITypes.NO_UNITAI, DirectionTypes.DIRECTION_SOUTH)

You could probably do something similar to that and change it your needs.
 
Back
Top Bottom