Advertisement
Civilization Fanatics' Center  

Welcome to Civilization Fanatics' Center.

You are currently viewing our site as a guest which gives you limited access to our site features. By joining our free community, you will be able to participate in the discussions, search the forum, send private messages, vote in polls, upload your own screenshots to the gallery, and access many other special features. Registration is fast, simple and absolutely free, so sign up today! If you have any problems with the registration process or your account login, please contact support.

Go Back   Civilization Fanatics' Forums > CIVILIZATION IV > Civ4 - Creation & Customization

Notices

Reply
 
Thread Tools
Old Apr 19, 2010, 04:02 AM   #1
jbryant
Prince
 
jbryant's Avatar
 
Join Date: Jun 2006
Location: Beale AFB, CA
Posts: 417
Get AI to Stop Changing Civics!

Ok, so everything is going pretty well with the Iran-Iraq mod I'm working with. However, turn 1 the Ayatollah goes all free speech and free religion. Very un-Ayatollah-esque. How can I stop him from ruining his great Islamic Republic?
__________________
My country may she always be right, but right or wrong my country!

CIV IV Scenarios:
Iran-Iraq Scenario
Afghan Civil War

CIV III Scenarios: Vietnam War MP
The Establishment of AFRICOMM
NEAsia 2nd Korean war/Taiwan and China
Operation Enduring Freedom
jbryant is offline   Reply With Quote
Old Apr 19, 2010, 04:06 AM   #2
phungus420
Deity
 
phungus420's Avatar
 
Join Date: Mar 2003
Posts: 6,296
This is pretty much what Python scripting is for. I'm not sure on the details, but you would be better served starting a thread in the Python/SDK forums about this.
__________________
Do not PM me with questions about modding. I will not answer. If you want help with something, start a thread on it, or post in a related existing thread.
phungus420 is offline   Reply With Quote
Old Apr 19, 2010, 07:35 AM   #3
Jarlaxe Baenre
Secular Humanist
 
Jarlaxe Baenre's Avatar
 
Join Date: Feb 2010
Location: Alberta, Canada
Posts: 1,677
Or you could modify his AI and give him two favourite civics - the ones that you want him to have.
Jarlaxe Baenre is offline   Reply With Quote
Old Apr 19, 2010, 08:15 AM   #4
jbryant
Prince
 
jbryant's Avatar
 
Join Date: Jun 2006
Location: Beale AFB, CA
Posts: 417
Well he changes off one of his favorites, so I'm not sure this will work out.
__________________
My country may she always be right, but right or wrong my country!

CIV IV Scenarios:
Iran-Iraq Scenario
Afghan Civil War

CIV III Scenarios: Vietnam War MP
The Establishment of AFRICOMM
NEAsia 2nd Korean war/Taiwan and China
Operation Enduring Freedom
jbryant is offline   Reply With Quote
Old Apr 19, 2010, 08:29 AM   #5
topsecret
Great Spy
 
topsecret's Avatar
 
Join Date: Feb 2010
Location: Home
Posts: 925
Images: 4
Quote:
Originally Posted by jbryant View Post
Well he changes off one of his favorites, so I'm not sure this will work out.
Ai's Should not do that!
__________________
I will be gone June 2 - July 1
-
You've made it this far, now keep going!
---
If at first you don't succeed, then skydiving isn't for you.
topsecret is offline   Reply With Quote
Old Apr 19, 2010, 09:47 AM   #6
stolenrays
Emperor
 
stolenrays's Avatar
 
Join Date: Aug 2009
Posts: 1,675
I couldn't figure it out either!
stolenrays is offline   Reply With Quote
Old Apr 19, 2010, 03:54 PM   #7
The_J
Say No 2 Net Validations

 
The_J's Avatar
 
Join Date: Oct 2008
Location: Germany / Netherlands
Posts: 25,002
Images: 51
Quote:
Originally Posted by topsecret View Post
Ai's Should not do that!
Sure it should, if it makes sense .
I've even seen Toku running free market.


@Topic:
Assets\Python\CvGameUtils.py:
PHP Code:
    def cannotDoCivic(self,argsList):
        
ePlayer argsList[0]
        
eCivic argsList[1]
###can't change civic start
        
pPlayer gc.getPlayer(ePlayer)
        
iLeader pPlayer.getLeaderType ()
        if 
iLeader ==gc.getInfoTypeForString("LEADER_WHATEVER"):
                        if 
eCivic ==gc.getInfoTypeForString("CIVIC_FREE_RELIGION"):
                                return 
True
###can't change civic end        
        
return False 
cannotDoCivic has to be activated in Assets\XML\PythonCallbackDefines.xml (if i'm not wrong).
__________________
Civ4-BtS-Mod "Mars, Now!"


Steam eats the souls of little gamers!!!
The_J is offline   Reply With Quote
Old Apr 19, 2010, 05:22 PM   #8
Jarlaxe Baenre
Secular Humanist
 
Jarlaxe Baenre's Avatar
 
Join Date: Feb 2010
Location: Alberta, Canada
Posts: 1,677
Create new techs that enable all the other civics, and make sure they are not researchable by anyone. Then give certain civs techs that will enable specific civics.
Jarlaxe Baenre is offline   Reply With Quote
Old Apr 19, 2010, 05:45 PM   #9
topsecret
Great Spy
 
topsecret's Avatar
 
Join Date: Feb 2010
Location: Home
Posts: 925
Images: 4
Quote:
Originally Posted by Jarlaxe Baenre View Post
Create new techs that enable all the other civics, and make sure they are not researchable by anyone.
Or use this:CLICK THIS
Disable tech is what to read only civ "X" cannot research tech "Free Speech" so only civ "X" cannot get free speech which is enabled by "Free Speech"
__________________
I will be gone June 2 - July 1
-
You've made it this far, now keep going!
---
If at first you don't succeed, then skydiving isn't for you.
topsecret is offline   Reply With Quote
Old Apr 19, 2010, 07:46 PM   #10
Androrc the Orc
Emperor
 
Androrc the Orc's Avatar
 
Join Date: Apr 2004
Location: Vienna, Austria
Posts: 1,533
Wouldn't it be easier to just disable specific civilizations from getting specific civics?

For example, putting this in CvPlayer::canDoCivics in CvPlayer.cpp:

Code:
	if (eCivic == (CivicTypes) GC.getInfoTypeForString("CIVIC_FREE_RELIGION") && getLeaderType() == (LeaderHeadTypes) GC.getInfoTypeForString("LEADER_AYATOLLAH"))
	{
		return false;
	}
Replace LEADER_AYATOLLAH with the actual type tag you are using for the Ayatollah leader.
Androrc the Orc is offline   Reply With Quote
Old Apr 20, 2010, 10:11 AM   #11
topsecret
Great Spy
 
topsecret's Avatar
 
Join Date: Feb 2010
Location: Home
Posts: 925
Images: 4
Quote:
Originally Posted by Androrc the Orc View Post
Wouldn't it be easier to just disable specific civilizations from getting specific civics?

For example, putting this in CvPlayer::canDoCivics in CvPlayer.cpp:

Code:
	if (eCivic == (CivicTypes) GC.getInfoTypeForString("CIVIC_FREE_RELIGION") && getLeaderType() == (LeaderHeadTypes) GC.getInfoTypeForString("LEADER_AYATOLLAH"))
	{
		return false;
	}
Replace LEADER_AYATOLLAH with the actual type tag you are using for the Ayatollah leader.
I'm clueless on Python so I just use XML
__________________
I will be gone June 2 - July 1
-
You've made it this far, now keep going!
---
If at first you don't succeed, then skydiving isn't for you.
topsecret is offline   Reply With Quote
Old Apr 23, 2010, 06:12 PM   #12
mechaerik
Dry Bones
 
mechaerik's Avatar
 
Join Date: Oct 2008
Location: Los Angeles
Posts: 5,539
That's actually C++, not python- The_J's example is python.
mechaerik is online now   Reply With Quote
Reply

Bookmarks

Go Back Civilization Fanatics' Forums > CIVILIZATION IV > Civ4 - Creation & Customization > Get AI to Stop Changing Civics!

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[BTS] How to avoid AI of changing civics Duque d'Caxias Civ4 - Creation & Customization 8 Aug 28, 2009 07:12 AM
Changing Civics Crash Hephaistion Civ4 - Creation & Customization 2 Nov 17, 2008 04:49 PM
Problems with changing civics dact Civ4 - General Discussions 5 Oct 28, 2007 03:46 AM
Changing civics massdriller Civ4 - Strategy & Tips 2 May 09, 2006 12:33 AM
Civ 4 and Alpha Centauri: Why stop at Civics? sliganian Civ4 - General Discussions 30 Jan 13, 2006 06:33 PM


Advertisement

All times are GMT -6. The time now is 11:18 PM.


Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
This site is copyright © Civilization Fanatics' Center.
Support CFC: Amazon.com | Amazon UK | Amazon DE | Amazon CA | Amazon FR