Simple Python Things

A python exception is an error while running the game, do you have them turned on in your ini file? something like

hidePythonExceptions = 1;

change it to 0 and see if it tells you anything.

Also, can you post the whole code of the function the code is in (ie onGameStart())
 
Where is it in the CvEventManager?

What happens? Nothing? Just a part?

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...

...so...do you still want it?


EDIT: File below is only temporary storage, doesn't have anything to do with the rest of the stuff here.
 

Attachments

My mistake. I paste code into : def onUnitBuilt
repaired and now I go test it :)
sorry. I send word about result. Thanks for patience...
 
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

Okay, I have attached a changed version, search for "planetbreaker" (...I should change the comments at some points :think:).
It's just the rocket, it will turn water to grass.
Resources go:
- Fish -> Cow
- Clam -> Pig
- Crab -> Sheep
- Oil -> Oil
- Whale -> Deer

If you want to get the rocket via a wonder, do you think you can change the Hanseatic league yourself, or do you need help?
 

Attachments

Thank you very much, The_J. Will test it :) As for the code that I wrote above, the error was in the location in python file. It's working now.
Thank you again for your help :)
Hroch
 
I believe all one has to do, to make The J's code yield World Units with more than 1 instance is to change

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

to

if cvUnitClass.getMaxGlobalInstances ()>=1 and bWorld:
list1.append(i)
iNumInfos += 1​
elif cvUnitClass.getMaxGlobalInstances ()!=1 and not bWorld:
list1.append(i)
iNumInfos += 1​
 
I never understand what is the point of the boolean bWorld check behind for this.

Isn't it simply cvUnitClass.getMaxGlobalInstances() > 0 and you can confirm it is a World Unit anyway...

Why split it into 2 parts
 
I'm not sure anymore, but I guess I thought that making another copy of the function would be rather inelegant ^^.

I believe all one has to do, to make The J's code yield World Units with more than 1 instance is to change

:crazyeye: I thought we already solved that.
 
HI THE_J,

how are you good friend?

ive began working on a new concept mod ,

i wonder - in your mars mod youve made it so theres no water,

can you help me by making a small python addition for a map script that will replace ocean and couse with 2 other land terrain? and most important - make sure starting location are set not on those newly water land plots...?

hope you can help :)
 
I actually did not deal with the mapscripts :blush: (or at least a lot less than you'd expect).
I did not change anything in the starting plot algorithms, and just replaced water with desert after the map was created. Therefore I don't think I'm capable of helping you :blush:, sorry :(.
 
Wow man... i just took a look at your stuff, you have some great treats in there!

I had a quick Q about the militia mod. How customisable is it?

for example could I have different units spawning from different improvements, and can different civics had different effects, and could UU's be spawned for specific civs?

My brain has just started to contemplate the possiblities!
 
Yeah, it's like that at the moment.
Adding a check for a civ is not really hard (1 line, if it's really only that), but it would mean that you have to copy the Python code for each civ.
Unless you could come up with some more sophisticated idea how to determine automatically which unit should be spawned.
 
Create a new unit class.
Set each new unit you want to spawn as unique unit of each civ.
Then it is done with 1 line without the need to copy the line 20 times for 20 civs
 
Im sorry to bother u all, but i have been looking for the thing im about to say for maybe 1.5-2h. Then i stumbled upon this thread and i couldnt read more then the 1st page. Even though this thread is amazing im just wasted from reading a lot of stuff.

1st:
How to remove promotion visual from a unit after getting a new one. This should be used to reduce clutter from having a lot of promos on a single unit. So instead of having Combat I and Combat II icons on the unit GUI part, i would like to see only icon for Combat II but to have both effects. So 10% + 10% instead of removing Combat I completely.
Im stupid today so ill write down another example. I have Woodsman I, II and III. Instead of having icon for all 3 promos, there would be only Woodsman III icon, but unit would benefit from all 3 levels of that promo.

2nd:
Considering ranged combat for gun and archery units. There iCombat and iAirCombat in unit xml file. But if those to values differ it is hard to know what real value for bombardment (iAirCombat) is. Lets say a unit has 8 :strength: and 6 air :strength:. Game would show 8:strength:. Is is possible to make it 8:strength:/6:strength: in some easy way or not? Also could that be dynamic? For example wounded unit by 50% of mentioned would be 4:strength:/3:strength:.

Tnx a lot for reading my mumbling. Im sorry if this was answered (im sure it was) but i was too slow or stupid to find it. :(
 
Back
Top Bottom