Simple Python Things

The answer would definatly be SDK as python that would be a long code and pretty taxxing on game preformance (assuming your doing more than one unit)

The_J are you have the same opinion? A small program of this nature have a high impact?
 
taxing...I don't think so, since not many GPs are born.
But I'm not even sure if it's possible to do it Python, since there's AFAIK no real counter for the GPs, means there's no way to determine how many names are already used. *that* is the main problem.
 
taxing...I don't think so, since not many GPs are born.
But I'm not even sure if it's possible to do it Python, since there's AFAIK no real counter for the GPs, means there's no way to determine how many names are already used. *that* is the main problem.

Ok, so I will seek the solution in SDK. Thank you!
 
The_J,I would like to use your "StartingPopupCivSpecific" in my mod.
But the scenario in my mod starts in the future,so how do I solve this?
Thank you.
 
Is the mod set up to be only used with this scenario?
If yes, then you can just change this line:
PHP:
if (gc.getGame().getGameTurnYear() == gc.getDefineINT("START_YEAR") and not gc.getGame().isOption(GameOptionTypes.GAMEOPTION_ADVANCED_START)):

to:
PHP:
if not gc.getGame().isOption(GameOptionTypes.GAMEOPTION_ADVANCED_START):
 
Hi, The_J . I'm not sure if my request is not arrogance . I think it is probably quite complex, but it would be great if there was simple advice.

I use the script [Map Script ] Planet Generator
It's an amazing tool with a single error. It does not work with added terrain. In my mod 's is it Swamp . Planet generator can do a lot of land on a small map and swamp me is missing because they are bound to it in the mode of other things .
Is there any easy way to instruct the script to generate swamp too ?

I think that this arrangement would help the other players and modders .

If the adjustment was too complex script I will use generator as is now . I suspect that the author of the script is not already here :(
 
At the moment sadly not possible :ack:.
It seems in general doable, but I still have not replaced my graphics card (yeah...money considerations...), so I can't test it. And it's too complicated to try it without testing.
-> sorry, cannot do it now :(.
 
Hi. I have an idea how to make a tame animal without the SDK. Te can tell me if this can work , please.

PHP:
		pPlayer = gc.getPlayer(pWinner.getOwner())
		if pWinner.isHasPromotion(gc.getInfoTypeForString('PROMOTION_TRAINER')):
			if (unitY.getUnitCombatType() == gc.getInfoTypeForString("UNITCOMBAT_ANIMAL")):
				if CyGame().getSorenRandNum(100, "Bob") <= 20:
					iUnit = pLoser.getUnitType()
					newUnit = pPlayer.initUnit(gc.getInfoTypeForString( 'UNIT_T_WOLF' ), pWinner.getX(), pWinner.getY(), UnitAITypes.NO_UNITAI, DirectionTypes.NO_DIRECTION)
					newUnit.finishMoves()
					CyInterface().addMessage(pWinner.getOwner(),False,15,CyTranslator().getText("TXT_KEY_TRAINER",()),'',0,'Art/Interface/Buttons/Units/wolf.dds',ColorTypes(44), pWinner.getX(), pWinner.getY(), True,True)

when the animal attacked a hunter with this promotion, 20% of the animal dead, but appears as a new unit, not an animal

thanks, Hroch
 
1) There isn't a UNITCOMBAT_ANIMAL, unless you defined it.
Just use
Code:
if pLoser.isAnimal():

2) if CyGame().getSorenRandNum(100, "Bob") <= 20:
is actually 21%, not 20%.
CyGame().getSorenRandNum(100, "Bob") returns a value from 0 to 99, not 1 to 100.

3) Looking at the codes, you are always getting this T_Wolf Unit regardless of what kind of animals you killed.
Thus, iUnit = pLoser.getUnitType() this line is useless. Remove it.
 
many thanks :)
will be this right ?
PHP:
		pPlayer = gc.getPlayer(pWinner.getOwner())
		if pWinner.isHasPromotion(gc.getInfoTypeForString('PROMOTION_TRAINER')):
      if pLoser.isAnimal():
				if CyGame().getSorenRandNum(100, "Bob") <= 19:
					newUnit = pPlayer.initUnit(gc.getInfoTypeForString( 'UNIT_T_WOLF' ), pWinner.getX(), pWinner.getY(), UnitAITypes.NO_UNITAI, DirectionTypes.NO_DIRECTION)
					newUnit.finishMoves()
					CyInterface().addMessage(pWinner.getOwner(),False,15,CyTranslator().getText("TXT_KEY_TRAINER",()),'',0,'Art/Interface/Buttons/Units/wolf.dds',ColorTypes(44), pWinner.getX(), pWinner.getY(), True,True)

I´m not coder. I only try to make changes by way as I think it could be functional :)
 
Code:
		pPlayer = gc.getPlayer(pWinner.getOwner())
		if pWinner.isHasPromotion(gc.getInfoTypeForString('PROMOTION_TRAINER')):
			if pLoser.isAnimal():
				if CyGame().getSorenRandNum(100, "Bob") < 20:
					newUnit = pPlayer.initUnit(gc.getInfoTypeForString( 'UNIT_T_WOLF' ), pWinner.getX(), pWinner.getY(), UnitAITypes.NO_UNITAI, DirectionTypes.NO_DIRECTION)
					newUnit.finishMoves()
					CyInterface().addMessage(pWinner.getOwner(),False,15,CyTranslator().getText("TXT_KEY_TRAINER",()),'',0,'Art/Interface/Buttons/Units/wolf.dds',ColorTypes(44), pWinner.getX(), pWinner.getY(), True,True)

In programming, you have to make sure indentation (number of spaces) is correct.
The animal line is wrong
 
Very sorry The_J . I am writing to your thread because you are reliable and always answer me :) Today platyping because was the log in . I have this weekend off, so tune my mod :)
 
Back
Top Bottom