Spontaneous Religion Spawning HELP

Creatureboy11

A Civ4 Leader
Joined
Oct 24, 2010
Messages
246
Location
USA
Hello. I do not know how to use python (but would like to), and had an idea for a (probably python) script about... yes, Spontaneous Religion Spawning. I would like a step-by-step help into coding this into Civ4. Here is how it would work.
  1. The date is appropriate (see spoiler at end)
  2. A civ with the appropriate religious technology (Buddhism, Hinduism, & Judaism only) can recieve early religions
  3. A civilization (with technology, for early religions) is randomly chosen to recieve the religion.
  4. City (which is NOT a holy city) is randomly chosen in the civ (With bias towards already-religious cities)
  5. "{Insert Religion} is founded in {Insert City}!"
Spoiler :
Appropriate Dates of the Religions
  • Buddhism - 3000 to 2000 BC (If nobody has religious tech, first to research it gets the religion)
  • Hinduism - 2500 to 1500 BC (If nobody has religious tech, first to research it gets the religion)
  • Judaism - 1000 to 500 BC (If nobody has religious tech, first to research it gets the religion)
  • Christianity - 50 BC to 50 AD
  • Islam - 500 to 1000 AD
  • Confucianism - 50 BC to 500 AD
  • Taoism - 1 to 550 AD
 
If you wanna be able to do this yourself, you can check out my signature for some entry points for getting into Python modding. You can PM me if you get into trouble sorting things out.

If you instead need to get the work done, you could prompt me in some weeks or so, when I actually have the time. Otherwise there would be a number of knowledgeable people on these boards who can help out.
 
It doesn't make that much sense to me, even the beginning. Anybody who wishes to help me, this would be my EXTREMELY BASIC "Not-so-much-a-code" (Non-Python, this is hypothetical):
"Begin Script
-4000 = 4000BC (And so on)
buddhism = Buddhism (And so on)
meditation = Meditation (and so on)
holycity = Holy City
religion = Any Religion
ifyear = -3500 to -2500, find civ with "meditiation"
[Found Civs with "meditation"]
Randomize potential civs
[Found Civ]
Randomize City in Civ - -10% chance with "holycity" - 10% with "religion"
[Found City]
Found "buddhism" in city
Popup "Buddhism has been founded in 'City Name'"
 
This does indeed look like an interesting little project, but I'd still urge you to give Python a chance and do it yourself. :D Because you can do it.
 
This does indeed look like an interesting little project, but I'd still urge you to give Python a chance and do it yourself. :D Because you can do it.
Will try to understand the language. Is there a Rosetta Stone for Python? Truely - any speciefic lessons I should see (besides beginner ones?)
 
Python is quite simple as far as syntax goes, and you're basically doing iteration and conditional statements. Any textbook will explain this, as will the documentation at Python.org.

The tricky bit is rather how to implement your script in CivIV Python, but I wrote a tutorial on that. (See my signature.)
 
Will ask again: Any specific lessons?
New Question: Any specific things to see, or parts of code to look at? This is entirely no sense to me; except "print 'Hello World'".
 
You mean the tutorial I wrote? Well, if you're gonna make your own Python mod you should probably read the whole thing...

But you should still read up on basic Python programming before attempting modding. You'll end up saving time doing that!

If you only intend to ever make this one single mod, then you could probably just hope for someone to do the work for you. :p
 
Yeah, pretty much. Maybe just a few pointers. If you (or another modder) has free-time and makes this, I would like notes on the page so I could know what does that.
 
Can anybody be a fellow and help me with this? :mischief:
 
Let's try...
First question: Do you know any programming language? Doesn't matter which one. Want just to know if you know at least some basics.

If you do, then
a) Most basic python lesson: There are no brackets etc., the indentation matters. If it's indentet in the same block, then it's in the same logical hirachy.
b) the first concrete step is to go into the Assets\Python\CvEventManager, and find the right function. I guess you'll have to take a look at onBeginGameTurn.
 
My only programming language I understand is XML.
 
XML is not a programming language, it's a data storage format ;).

:think: i don't think i have the patience to teach someone basic programming over the internet without any template.
If nothing happens until tomorrow, and no one else volunteers, then i'll whack it together tomorrow.
If you then afterwards want any change, then you'll have to do it yourself, but i can assist if you also try it yourself.
 
I'll attempt practicing tomorrow. Please reply by 12 PM EST if nobody steps up.
 
Meh, i should not offer to code anything.
Attached is the work of the last 1.5 hours...(damn bugs :mad:)
In the religionInfos.xml, i've changed all religion prereqs to future tech.
In the CvEventManager i made 2 changes, signed with "random religion", which you would have to add to your mod.
The rest is done in RandomReligions.py, and as long as you only have the standard religions in whatever-you-play, then you should not have to change anything in there.


But be aware now, the religion techs are now far less valuable then before, so the AIs are only researching them slowly. If you do more modding there, you should add something additional to these techs, so that the AIs see a benefit in them.
 

Attachments

It's BTS. Can you make it Vanilla, plz?
 
Also... on BTS...
 

Attachments

  • Civ4ScreenShot0000.JPG
    Civ4ScreenShot0000.JPG
    65.7 KB · Views: 77

Attachments

1. Thank you.
2. The dates are NOT like they should based on the mod. Examples: 75 AD Christians, 1010 AD Muslims. Both examples, 1 turn off.
EDIT: Christians and Muslims got religion at same date, in Vanilla test run.
 
Back
Top Bottom