Simple Python Things

I tried to merge your World Unit changes into the C2C version of the pedia for two reasons. Yours has much less code than my version and the index on yours does not switch from the World Unit (hero) list to the units list. However I am getting the error below which is not even in the area that changes. Would you have time to look at my version of the code? I have included it just in case you do but I fully understand if you can't get to it.

Edit attachments removed - everything working now, ;)
 
I guess I forgot the "If I forget it, then remind me" part :/.

Don't see any obvious problems with the merge :dunno:.
I'd like to take a look at it directly, but I don't have C2C currently here, my connection itself is clogged with another download, tomorrow I'll pack my PC into the car, because I'll move to the Netherlands on Monday, and the ersatz computer for here is not capable of Civ4.
Means I'll probably earliest be able to look at it on Tuesday :/. Sorry :sad:.

And preemptively: I should have internet there, but in case I don't appear again, then you know what's going on. Should only be temporary.
 
Your World Unit changes J can you make it so that it shows not only 1 World Unit but
say that I have 3 I-400 World Units. So if I have more than one World Unit of the same unit it will so up too.



What I did to get that to work with your World Unit changes I added this to your SevoPediaMain: I know its not right but got me close to what I want. If you can make the change I Thankyou for your hard work.


###world units - part 8 - The_J
def getSortedUnitList(self, numInfos, getInfo,bWorld):
list1 = []
iNumInfos = 0
for i in range(numInfos):
cvUnit = gc.getUnitInfo(i)
cvUnitClass = gc.getUnitClassInfo(cvUnit.getUnitClassType ())
if cvUnitClass.getMaxGlobalInstances ()==1 and bWorld:
list1.append(i)
iNumInfos += 1
if cvUnitClass.getMaxGlobalInstances ()==3 and bWorld:
list1.append(i)
iNumInfos += 1
elif cvUnitClass.getMaxGlobalInstances ()!=1 and not bWorld:
list1.append(i)
iNumInfos += 1

list2 = [(0,0)] * iNumInfos
i = 0
for iUnit in list1:
list2 = (gc.getUnitInfo(iUnit).getDescription(), iUnit)
i += 1

list2.sort()
return list2
###world units - part 8 - The_J
 
Never thought that there's really a need for that ^^ (besides in dacubz mod).
But yeah, I think I can change that in the next days.
Maybe today, will have to see (why that? Had a major RL screw up today, which prevented me from preparing for the move on Monday, which means I'm still sitting in front of my gaming machine; let's see if I have time tonight).
 
You will be pleased to know that while looking at Roamty's code I identified the problem in mine. I had the indentation wrong on one of the lines :blush:.
 
And why did I not see that :gripe:?
-> Which line? Want to see it myself.
:blush:

The iNumInfos += 1 after the elif. I had it at the same level as the elif not indented as it should have been.

So I had
if cvUnitClass.getMaxGlobalInstances ()==1 and bWorld:
list1.append(i)
iNumInfos += 1​
elif cvUnitClass.getMaxGlobalInstances ()!=1 and not bWorld:
list1.append(i)​
iNumInfos += 1​

Instead of the correct
if cvUnitClass.getMaxGlobalInstances ()==1 and bWorld:
list1.append(i)
iNumInfos += 1​
elif cvUnitClass.getMaxGlobalInstances ()!=1 and not bWorld:
list1.append(i)
iNumInfos += 1​
 
I think the indentation was different on your version to mine so when I copied the code across I had to make the indentation correct and just got that one line wrong. I use CompareIt! for the task. Now I have to g back and figure out how to put our hero (world unit) screen back in. I didn't know we had one. ;)
 
The_J, Merry X'mas and a Happy New Year.

Congratulations for your RL forward moves.

BTW, where are you moving to in the Netherlands? Spent about a year overall there 10 years ago and found some of it to be a beautiful and fun place to be.
 
:) thanks.
Due to paranoia I'll not disclose where I move (I actually already did, 2 weeks ago), but it's too the south east, and it's indeed a very beautiful city there :).

While I'm posting, and the thread is on the top: I'm without civ til next year, so I can't do any work here for the moment (saying it just in case).
 
Really The_J, I don't mind paranoia, it's just a Hullo and good wishes for the Season, after 2+ years of silence.

Promise no Civ thoughts here.
 
While I'm posting, and the thread is on the top: I'm without civ til next year, so I can't do any work here for the moment (saying it just in case).

The worst part is you can't play civ, not that you can't mod it. ;)
 
Hello. I'm not sure, but I think you've made ​​a code for " planet buster ". I have turned to my mod reverse idea. I need a rocket that hits the sea and the create land 3x3 squares.
Do you think it could be done that code ? Wonder "ritual circle" will give a unique rocket or somethink. Land may be formed on coast, ocean and deep sea.
Thank you for your answer
Hroch
 
That is possible, but the AI will totally not understand it.
Okay, it does also not really understand the planet buster, but you use the planet buster in the same way like you use an ICBM, but your suggestion would need to be used different.
Still can do it, if you don't care about the AI.

But since I'm without civ at the moment, this would have to wait til the first weekend in the new year...


Really The_J, I don't mind paranoia, it's just a Hullo and good wishes for the Season, after 2+ years of silence.

Promise no Civ thoughts here.

Happy holidays and thanks for the great job :)

Also happy holidays to you :).

The worst part is you can't play civ, not that you can't mod it. ;)

I'll survive it ;).
 
Hi. Please, I tried make this code but is not functional. Can you check, where is error, please?

PHP:
## Old Arena Start ##
		if iBuildingType == gc.getInfoTypeForString( 'BUILDING_OLDARENA' ):
			pPlayer = gc.getPlayer(pCity.plot().getOwner())
			u_bubu = gc.getInfoTypeForString( 'UNIT_AMAZONSWORD' )
			iX = pCity.getX()
			iY = pCity.getY()
			### da jednotku a povyseni ###
			pNewUnit = pPlayer.initUnit( u_bubu, iX, iY, UnitAITypes.UNITAI_SPY, DirectionTypes.NO_DIRECTION )
			pNewUnit.setHasPromotion(gc.getInfoTypeForString( 'PROMOTION_BLITZ' ), true)
			pNewUnit = pPlayer.initUnit( u_bubu, iX, iY, UnitAITypes.UNITAI_SPY, DirectionTypes.NO_DIRECTION )
			pNewUnit.setHasPromotion(gc.getInfoTypeForString( 'PROMOTION_SELFPRESERVATION3' ), true)
			pNewUnit.setHasPromotion(gc.getInfoTypeForString( 'PROMOTION_MORALE' ), true)
			### zpráva ###
			CyInterface().addMessage(CyGame().getActivePlayer(),false,15,CyTranslator().getText("TXT_KEY_BUBU_GAMETXT1",()),'',0,'Art/Interface/Buttons/Units/Bubu.dds',ColorTypes(44), -1, -1, True,True)
## Old Arena Konec ##

Thanks
Hroch
 
Back
Top Bottom