• Our friends from AlphaCentauri2.info are in need of technical assistance. If you have experience with the LAMP stack and some hours to spare, please help them out and post here.

Snippets for mod makers

Are you talking about the "blank" (iconless) buildings that are part of "City Adopts Religion" event? There are suppose to be two. One is used to track what religion the city is currently, the other is used to determine if the city is converting to a religion for the first time ever. Technically the two buildings are of different classes but they have the same name because the end user is suppose to ignore them.

Thanks for the quick answer, i just found also the reason with IGE, i was just a little bit confused.

Next time i will use IGE first before i post a dumb question here.:rolleyes:

Another point, i guess when i change the SQL file, i can make the buildings invisible.
Will this cause any other problem? I like to hide all the dummy buildings in CCTP.;)
 
It should not cause any problems if you hide the RELIGION_XXX and RELIGION_HAS_BEEN_XXX buildings.
 
Would there be issues from sticking the files into my mod as your steam entries suggest when two mods include the same files without changing anything in them?
 
That should not cause a problem. Each of the snippets have an initialization check that ensures the snippet only initializes if no mod prior to them initialized the snippet.
 
Hey again, just a little question, and iam not sure if this is already answered anywhere.
But is there a way to grant buildings not only to a founder belief?
I would like to expand the Beliefs in CCTP but i need some nice features for Reformations f.e.
 
There are some technical limitations with respect to detecting when a religion is enhanced or reformed that make it tricky/impossible to generalize Beliefs grant buildings to work for non-founder beliefs.

With a custom DLL that provided events on religion enhancement or reformation I could pretty easily develop a general framework for beliefs grant buildings (similar to Policies grant buildings). However, since modding the DLL would limit the cross-mod compatibility, I've generally avoided designs that require it.

There is an approach that I haven't investigated that may be able to detect when a religion is enhanced or reformed without requiring a DLL edit. It would involve hooking into the notifications that are sent out to every player in the game when a religion is founded/enhanced/reformed.
 
Thanks for the answer, so it could be possebile, at the time when we us our own DLL for CCTP, we will think about it again...
Thats a good news;=)
 
I need to release an update to policy grant buildings (to bring it in sync with Reform's version) and I was also going to do a small update to the building event (add some robustness features). I can see about throwing up a copy civfanatics when I make those updates sometime this week.
Done and done. The original post has been edited to include links to the files on CivFanatics.
 
Hello Macchiavelli!

Thanks a lot for Policies grant Buildings!
Is there a way to not make the buildings granted free, but to only let them be buildable with certain policies?
Not like in vanilla, where you can build buildings when adopting a policy branch, but when adopting a certain policy?

Thank you,
Belzhorash.
 
That would best be achieved by using a PlayerCanConstruct check that looks for the player having a specific policy. It would be very simple couple of lines of Lua.
 
That would best be achieved by using a PlayerCanConstruct check that looks for the player having a specific policy. It would be very simple couple of lines of Lua.

Thanks for the info!
I looked at your code over and over again (coming from PHP...) and have no clue where to start.
Is there a slight chance that you do me the favor and write those lines of Lua for me?
All I can offer in exchange is glory, honor, credits in SplitterCiV, SQL and a beer, if you ever are in my area, though. :|


Update:
Got the code from bane, whoward and LeeS.
Everything is fine.
 
Hi, I would like to ask a question about your CityAdoptsReligionEvent and GameEvents.CityConvertsReligion, which I presume it depends on.

Do these events trigger if a city loses a religious majority, and so has no religion?

Thanks in advance.:)
 
psparky, you're picking at the corner case where things start to get tricky. In general CityAdoptsReligion will fire when follower count changes. Based on my memory of the C++ when I last looked at it years ago, Inquisitors will not cause the event to fire but Great Prophets will.

Does that answer your question or do you still have concerns that this snippet won't meet your needs?
 
psparky, you're picking at the corner case where things start to get tricky. In general CityAdoptsReligion will fire when follower count changes. Based on my memory of the C++ when I last looked at it years ago, Inquisitors will not cause the event to fire but Great Prophets will.

Does that answer your question or do you still have concerns that this snippet won't meet your needs?

Thanks for the information and quick reply - I presume you are talking about the built in CityConvertsReligion here.

I'm currently gathering information on the feasibility of adding a new notification related to religion. This would include the case when my cities lost religion (I had a case where my main faith generating city based on DF, lost it's majority due to my own religion spreading there (2 followers each in a five pop city), and with virtually no faith I couldn't fix it easily! This experience started me thinking about what else might be useful to be notified about).

I have a little experience tweaking EUI, so if I do proceed I will probably do it in that context, rather than as a mod. I hope you don't mind that I'm probably just picking your brain and taking inspiration from your code.
 
I presume you are talking about the built in CityConvertsReligion here.
Both, sort of. The built in event has a very misleading name. It doesn't just fire when a city changes religion, it also fires when follower counts change even if the religion is the same. The event provided in the snippet adds some filtering logic that determines when the city actually changes religion and only fires when it has.

If you want to know when a city loses religion the snippet will cover you 95% of the time. The corner cases it misses are Inquisitors.
 
Back
Top Bottom