Simple Python Things

I merged the Militia Mod with my Custom Assets and when my fiancee got her first militia, she became addicted to building farms. It was actually rather funny, when I looked at her territory, it seemed like there was nothing but farms and fortified militia from three different ages all over. It was a sea of pitchfork-wielding and gun-toting workers standing around on their farms! :lol:
 
Hi, firstly, let me say that I really like the stuff you've done, big fan :goodjob:. I've been reworking my custom assets and I'm having a little trouble with incorporating the "Planetbuster", I've also incorporated the Nuclear Arsenal mod (if you aren't familiar with it, it adds several more nukes and some buildings/projects). The problem I am having is that I'm trying to adapt the planetbuster script so that it applies to all of the nukes to varying degrees (as well as changing the terrain to "TERRAIN_DESERT" instead of "TERRAIN_COAST"). I also have added several other python modcomps (slaver promotion as well as several of tsentoms promotions) to CvEventManager.py and I am not sure if they would interfere or not (I doubt it, but you never know). I can get planetbuster to work as a standalone mod, but not in my custom assets. Any suggestions?
 
Thanks for the compliments :).


The other modcomps shouldn't interfere with it, as long there's no other function attached to onNukeExplosion.

What exactly is not working? Is the terrain not transformed? Or no effect at all?
Do you have the python exceptions enabled?


---------
Edit: Attached unrelated, just need some space.
 

Attachments

  • Clipboard01.jpg
    Clipboard01.jpg
    42.5 KB · Views: 154
Nothing else is attached to onNukeExplosion and nothing is happening. The nuke detonates and spreads fallout all over the place but no change in terrain (I have even waited several turns and same old terrain, no deserts that were not there before). When I checked it as a mod, it worked fine (creates nice, :nuke: lakeside property), but as a custom asset it does nothing. I've attached a copy of my CvEventManager.py in case you would like to see it (don't know maybe you'll see something I don't). Other than that I don't have exceptions enabled, but I'll enable them and check it out when I get home.
 
I used IDLE to edit it, I was wondering about how it looked. I always run "Check Module" under the Run tab and it said that my syntax was wrong and that I should Select All, Untabify and Tabify and that is how it looked afterwards. I try it again without running check module.
 
Worked like a charm :D Only now, it is changing coast to desert, it doesn't irradiate the former coast (only the land that actually was land before the nuke). Any recommendations on how to make it not change the coastal plots to desert, I'm stumped, I was up until 4 this morning trying to get it to leave the water tiles alone and it's not working. Another funky side-effect is that when it turns the water to desert, it doesn't remove any rivers present so there will be a river flowing through to desert and then a delta in a desert tile.
 
Cannibalism as religion :lol:?


What are the error messages?

You didn't add the new religions in your event manager. I guess, you forgot it?
But that shouldn't lead to errors.

NO thats why i gave you a copy of my eventmanager so YOU could put it in there, mine does not have the tabs for it set correct and WILL NOT accept anything after Taoism.

And i did change the 7 to a 16 for religions also.
 
Thanks again J, that worked like a charm, it now only turns land into desert and not water as well. Could I bother you for advice one more time?
 
making it so that the nukes also remove features (other than fallout) and bonuses. I want to make it so that nukes are an absolute weapon of last resort (or a psychotic madman). If you nuke a city, it is going to make the city useless to the enemy or anyone else (at least until I incorporate your pioneer tank). BTW, I've incorporated nearly all of your python modcomps (as well as tsentom1's promotions). Thanks again for all of the great code! :goodjob:
 
Thanks for the compliments :).



PHP:
pPlot.setBonusType(-1)
pPlot.setFeatureType(-1,1)

this should it be. Just add it after the plot transformation.
I'm not sure about the second parameter in setFeatureType. If 1 doesn't work, try 0 or -1.

Because i guess, you don't know it: Civ 4 Python API. Makes programming a lot easier.




Nearly all my modcomponents...also the Monsanto Wonder?
If yes: I'll have to update it, because it cripples the worker AI, so if you're working on a public mod, i suggest to not release it, until i fix that.
 
Then you should have said that ;).

If you really have problems with editing a .py file, then try to download python, or edit it with Word ;).

File is attached :).

See i always get this stuff, after taoism all the time?? At least this time it didnt stop at the religions.

load_module CvEventManager
Traceback (most recent call last):
File "<string>", line 1, in ?
File "<string>", line 52, in load_module
File "CvEventInterface", line 12, in ?
File "<string>", line 52, in load_module
File "CvCustomEventManager", line 26, in ?
File "<string>", line 35, in load_module
File "<string>", line 13, in _get_code
File "CvEventManager", line 1584
MonasteryName = BUILDING_"+NumReligion[iReligion]+"_MONASTERY"
^
SyntaxError: invalid syntax
 
Top Bottom