| General | Hosted Sites | Civ5 | CivRev | Civ4Col | Civ4 | Civ3 | Civ2 | Civ1 | Misc | Marketplace |
![]() |
|
|
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. |
|
|||||||
![]() |
|
|
Thread Tools |
|
|
#1 |
|
Chieftain
Join Date: Sep 2010
Posts: 7
|
Question about relation modificators changing
Hello :-)
Could anyone please tell me if there is a way to change AI relation modificators like "You have made an arrogant demand" or "You've declared war on our friend"? I'm currently playing a very long game and i've made several, heh, political errors many turns ago, so now everybody hates me ![]() So, is there a way to configure some XML or Python file maybe to make theese modificators gone? Or make them deteriorating with time at least. I've found a file called CIV4MemoryInfos.xml, but there's no numbers in it - only types declarations. I'm playing with Rise of Manking mod by the way. Looking forward for some sort of reply ^_^ Sorry for me English btw
|
|
|
|
|
|
#2 |
|
"Hit It"
Join Date: Dec 2009
Location: Sweden
Posts: 5,530
|
You should be able to run Python commands for this in the built-in Python console. But firstly you need to enable cheat mode (I think) and open up the actual console - on a standard US keyboard it would be shift + ~. Only then would it make any sense to try to walk you through how to run the commands you need to run.
__________________
How to Make a Python Mod - Python modding tutorial CivIV Python Class Reference - modding Python API How to Think Like a Computer Scientist - online Python textbook CivPlayer - Python scripting tool Spoiler:
|
|
|
|
|
|
#3 |
|
Chieftain
Join Date: Sep 2010
Posts: 7
|
Well, I've opened the console. Found some cheats like increasing unit experience and so on even. Ready to learn something about Python commands
![]() My goal stays the same - somehow to drop down the relations modificators ("you've made an arrogant demand" and "you've declared war on our friend"). Any suggestions please?
|
|
|
|
|
|
#4 |
|
"Hit It"
Join Date: Dec 2009
Location: Sweden
Posts: 5,530
|
Yeah, good job getting the console online.
![]() Firstly we need to figure out what players you need to manipulate. Because all players are indexed from zero and up on initialization. If its a scenario you can just count them in the WBS file. Else it gets a bit complicated... (In a non-scenario setup the human player is usually the first player - enumerated zero.) What you basically need is this line: Code:
gc.getPlayer(eHumanPlayer).AI_changeMemoryCount(eCounterpart, MemoryTypes, iChange) I haven't tried it myself but this is what I can gather. (The players might be the other way around, however.)
__________________
How to Make a Python Mod - Python modding tutorial CivIV Python Class Reference - modding Python API How to Think Like a Computer Scientist - online Python textbook CivPlayer - Python scripting tool Spoiler:
|
|
|
|
|
|
#5 |
|
Chieftain
Join Date: Sep 2010
Posts: 7
|
Thanks for an advice. Didn't work though
![]() My string in the console was exactly the following: gc.getPlayer(0).AI_changeMemoryCount(1, 1, -10) (i've tried to target the first hypothetical AI player) Then i've tried this: gc.getPlayer(0).AI_changeMemoryCount(1, MemoryTypes.MEMORY_DECLARED_WAR_ON_FRIEND, -10) and gc.getPlayer(0).AI_changeMemoryCount(1, MemoryTypes.MEMORY_DECLARED_WAR_ON_FRIEND, 10) The answer was always "invalid syntax: command not found". So... The syntax. Just seems i'm making mistakes somewhere. I've tried to white just "gc.GetPlayer(0)" - the console haven't found such a command either". As I understand "gc" is a variable of some sort, no? Shouldn't it be declarated then? Last edited by Topotoon; Sep 26, 2010 at 02:43 PM. Reason: Update |
|
|
|
|
|
#6 |
|
Say No 2 Net Validations
![]() ![]() |
Are these exactly the commands you put in?
To note: Uppcase/lowercase matters here. |
|
|
|
|
|
#7 |
|
"Hit It"
Join Date: Dec 2009
Location: Sweden
Posts: 5,530
|
Are you sure about the console? Because there are two of them. One is the Python console and the other is... something else. The Python console states "Python 2.4.1" though.
Other than that, I also get the "command not found" error sometimes. The console isn't perfect so you might have to restart the game, or something...
__________________
How to Make a Python Mod - Python modding tutorial CivIV Python Class Reference - modding Python API How to Think Like a Computer Scientist - online Python textbook CivPlayer - Python scripting tool Spoiler:
|
|
|
|
|
|
#8 |
|
Deity
Join Date: May 2006
Posts: 2,566
|
I'd be interested in this subject as well. Not just a one-shot Python command, but a permanent alteration of the game rules such that whenever Civ A asks me to declare war on Civ B, I refuse, and I get a -1 relations hit with Civ A, I will also get a +1 relations boost with Civ B ("you refused to help our enemies in wartime").
|
|
|
|
|
|
#9 |
|
Chieftain
Join Date: Sep 2010
Posts: 7
|
Baldyr, well, it seems i'm not so sure about the console type. Maybe i'm running the wrong one.
Could you please tell the exact way to run the one you're talking about? By the way, if AI civs loved me more each time I refuse to declare war on them, I would be already a superstar ^_^ |
|
|
|
|
|
#10 | |
|
"Hit It"
Join Date: Dec 2009
Location: Sweden
Posts: 5,530
|
Quote:
Look at the prompt of the console you're using. If it doesn't say its Python then its not.
__________________
How to Make a Python Mod - Python modding tutorial CivIV Python Class Reference - modding Python API How to Think Like a Computer Scientist - online Python textbook CivPlayer - Python scripting tool Spoiler:
|
|
|
|
|
|
|
#11 |
|
Chieftain
Join Date: Sep 2010
Posts: 7
|
Small success: i've managed to run the right (python) console :-)
Now it accepts the command Baldyr posted in the third post in this thread. I've tried several different variants, each time changing the first of the three digits: gc.getPlayer(0).AI_changeMemoryCount(1, 1, -10) gc.getPlayer(0).AI_changeMemoryCount(4, 1, -10) gc.getPlayer(0).AI_changeMemoryCount(12, 1, -10) and so on. So, i've tried to hit some of my AI opponents to make them change their attitude towards me Each time I entered the command i was looking at the opponents list searching for any changes but it had shown none.What could be wrong? Maybe I need to restart a game after each command or something? By the way, what is the way to specify the AI opponent number precisely? I don't quite sure if I'm playing the scenario or not. It's a single player game which you could start by clicking "play now" in main menu. You're entering all the start conditions like the world size, weather and so on and start playing. Is it the scenario mode? And the last question. It there a way to swiftly check if my commands make any effect on the game at all? |
|
|
|
|
|
#12 |
|
"Hit It"
Join Date: Dec 2009
Location: Sweden
Posts: 5,530
|
My best guess is that you simply have the players in the wrong order, so instead of using the zero player with the getPlayer() method and the opponent with the AI_changeMemoryCount() method - it should probably by the other way around.
Code:
gc.getPlayer(1).AI_changeMemoryCount(0, 1, -10) This would be why you aren't seeing any results.As far as I can gather any such command should alter the game immediately and directly, without the need to restart anything. But there could of course be exceptions to the rule... Maybe wait until the next turn and see if the status has been updated?
__________________
How to Make a Python Mod - Python modding tutorial CivIV Python Class Reference - modding Python API How to Think Like a Computer Scientist - online Python textbook CivPlayer - Python scripting tool Spoiler:
|
|
|
|
|
|
#13 |
|
Chieftain
Join Date: Sep 2010
Posts: 7
|
- I can pull a rabbit out of a hat!
- I can pull a hat out of a rabbit! - Whoa, i've never seen that before! It worked, you know Thanks a lot for all the useful comments ![]() ...They will love me anyway, har-har-har )) |
|
|
|
|
|
#14 |
|
"Hit It"
Join Date: Dec 2009
Location: Sweden
Posts: 5,530
|
Good to hear it worked!
__________________
How to Make a Python Mod - Python modding tutorial CivIV Python Class Reference - modding Python API How to Think Like a Computer Scientist - online Python textbook CivPlayer - Python scripting tool Spoiler:
|
|
|
|
|
|
#15 |
|
"Hit It"
Join Date: Dec 2009
Location: Sweden
Posts: 5,530
|
By the way, this is where I found the method you used. Its near impossible to know all these methods by heart so what you do instead is you check the API. The method in question is part of the class CyPlayer - the other methods of this class can be used in the same manner. Meaning that you firstly have to get a CyPlayer instance, and you do this with CyGlobalContext.getPlayer() - gc is short for CyGlobalContext() - its actually a variable referring to an instance of the CyGlobalContext class.
In case you feel like cheating for real...
__________________
How to Make a Python Mod - Python modding tutorial CivIV Python Class Reference - modding Python API How to Think Like a Computer Scientist - online Python textbook CivPlayer - Python scripting tool Spoiler:
|
|
|
|
|
|
#16 |
|
Chieftain
Join Date: Sep 2010
Posts: 7
|
Thanks a lot. I'll study the reference. Maybe I'll need something else except memory modifacators. I'm not a big cheater though
|
|
|
|
|
|
#17 |
|
Deity
Join Date: May 2006
Posts: 2,566
|
So, regarding that "you refused to help our enemies in wartime" bit that I inquired about...
|
|
|
|
|
|
#18 | |
|
"Hit It"
Join Date: Dec 2009
Location: Sweden
Posts: 5,530
|
Quote:
So it would have to be added in the SDK then, I think. And I don't really have a handle on that myself...
__________________
How to Make a Python Mod - Python modding tutorial CivIV Python Class Reference - modding Python API How to Think Like a Computer Scientist - online Python textbook CivPlayer - Python scripting tool Spoiler:
|
|
|
|
|
|
|
#19 |
|
Deity
Join Date: May 2006
Posts: 2,566
|
So I should ask embryodead?
|
|
|
|
|
|
#20 |
|
"Hit It"
Join Date: Dec 2009
Location: Sweden
Posts: 5,530
|
__________________
How to Make a Python Mod - Python modding tutorial CivIV Python Class Reference - modding Python API How to Think Like a Computer Scientist - online Python textbook CivPlayer - Python scripting tool Spoiler:
|
|
|
|
![]() |
| Bookmarks |
|
| Thread Tools | |
|
|