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 Sep 26, 2010, 04:00 AM   #1
Topotoon
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
Topotoon is offline   Reply With Quote
Old Sep 26, 2010, 05:39 AM   #2
Baldyr
"Hit It"
 
Baldyr's Avatar
 
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:
Q: Who is the woman in the avatar image?
A: Miss Li.
Q: Why does she have a brass-eye?
A: It's a conceptual thing. More of the same on the profile page.

Q: What does you title mean?
A: That is the title of Miss Li's latest single.
Baldyr is offline   Reply With Quote
Old Sep 26, 2010, 12:13 PM   #3
Topotoon
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?
Topotoon is offline   Reply With Quote
Old Sep 26, 2010, 01:56 PM   #4
Baldyr
"Hit It"
 
Baldyr's Avatar
 
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)
You substitute the name eHumanPlayer with the index number of the human player. You use the index number of the rival player in place of eCounterpart. The various MemoryTypes are found here - you might get away with just using the enumerated index number (otherwise the syntax is: MemoryTypes.MEMORY_DECLARED_WAR_ON_FRIEND). And iChange is the (positive or negative) integer value that you like to add or subtract.

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:
Q: Who is the woman in the avatar image?
A: Miss Li.
Q: Why does she have a brass-eye?
A: It's a conceptual thing. More of the same on the profile page.

Q: What does you title mean?
A: That is the title of Miss Li's latest single.
Baldyr is offline   Reply With Quote
Old Sep 26, 2010, 02:34 PM   #5
Topotoon
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
Topotoon is offline   Reply With Quote
Old Sep 26, 2010, 08:25 PM   #6
The_J
Say No 2 Net Validations

 
The_J's Avatar
 
Join Date: Oct 2008
Location: Germany / Netherlands
Posts: 24,851
Images: 51
Are these exactly the commands you put in?
To note: Uppcase/lowercase matters here.
__________________
Civ4-BtS-Mod "Mars, Now!"


Steam eats the souls of little gamers!!!
The_J is offline   Reply With Quote
Old Sep 26, 2010, 09:32 PM   #7
Baldyr
"Hit It"
 
Baldyr's Avatar
 
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:
Q: Who is the woman in the avatar image?
A: Miss Li.
Q: Why does she have a brass-eye?
A: It's a conceptual thing. More of the same on the profile page.

Q: What does you title mean?
A: That is the title of Miss Li's latest single.
Baldyr is offline   Reply With Quote
Old Sep 27, 2010, 12:24 AM   #8
G-Max
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").
G-Max is offline   Reply With Quote
Old Sep 27, 2010, 04:09 AM   #9
Topotoon
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 ^_^
Topotoon is offline   Reply With Quote
Old Sep 27, 2010, 09:32 AM   #10
Baldyr
"Hit It"
 
Baldyr's Avatar
 
Join Date: Dec 2009
Location: Sweden
Posts: 5,530
Quote:
Originally Posted by Topotoon View Post
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?
I believe that the default shortcut to the Python console is shift + ~. But this would only be true for some default keyboard layout. On my Swedish keyboard I need to press shift + ö and if I only happen to press ö (without shift) it opens up the other console.

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:
Q: Who is the woman in the avatar image?
A: Miss Li.
Q: Why does she have a brass-eye?
A: It's a conceptual thing. More of the same on the profile page.

Q: What does you title mean?
A: That is the title of Miss Li's latest single.
Baldyr is offline   Reply With Quote
Old Sep 27, 2010, 01:08 PM   #11
Topotoon
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?
Topotoon is offline   Reply With Quote
Old Sep 27, 2010, 01:16 PM   #12
Baldyr
"Hit It"
 
Baldyr's Avatar
 
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)
Because you can't change the attitude of the human player with a mere Python command, now can you? 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:
Q: Who is the woman in the avatar image?
A: Miss Li.
Q: Why does she have a brass-eye?
A: It's a conceptual thing. More of the same on the profile page.

Q: What does you title mean?
A: That is the title of Miss Li's latest single.
Baldyr is offline   Reply With Quote
Old Sep 27, 2010, 01:31 PM   #13
Topotoon
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 ))
Topotoon is offline   Reply With Quote
Old Sep 27, 2010, 01:35 PM   #14
Baldyr
"Hit It"
 
Baldyr's Avatar
 
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:
Q: Who is the woman in the avatar image?
A: Miss Li.
Q: Why does she have a brass-eye?
A: It's a conceptual thing. More of the same on the profile page.

Q: What does you title mean?
A: That is the title of Miss Li's latest single.
Baldyr is offline   Reply With Quote
Old Sep 27, 2010, 02:18 PM   #15
Baldyr
"Hit It"
 
Baldyr's Avatar
 
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:
Q: Who is the woman in the avatar image?
A: Miss Li.
Q: Why does she have a brass-eye?
A: It's a conceptual thing. More of the same on the profile page.

Q: What does you title mean?
A: That is the title of Miss Li's latest single.
Baldyr is offline   Reply With Quote
Old Sep 27, 2010, 03:30 PM   #16
Topotoon
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
Topotoon is offline   Reply With Quote
Old Sep 27, 2010, 03:46 PM   #17
G-Max
Deity
 
Join Date: May 2006
Posts: 2,566
So, regarding that "you refused to help our enemies in wartime" bit that I inquired about...
G-Max is offline   Reply With Quote
Old Sep 27, 2010, 10:37 PM   #18
Baldyr
"Hit It"
 
Baldyr's Avatar
 
Join Date: Dec 2009
Location: Sweden
Posts: 5,530
Quote:
Originally Posted by G-Max View Post
So, regarding that "you refused to help our enemies in wartime" bit that I inquired about...
I don't think you can do this with Python, at least. Because you pretty much need a game event to trigger any Python code. And not declaring war is really an non-event.

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:
Q: Who is the woman in the avatar image?
A: Miss Li.
Q: Why does she have a brass-eye?
A: It's a conceptual thing. More of the same on the profile page.

Q: What does you title mean?
A: That is the title of Miss Li's latest single.
Baldyr is offline   Reply With Quote
Old Sep 27, 2010, 10:42 PM   #19
G-Max
Deity
 
Join Date: May 2006
Posts: 2,566
So I should ask embryodead?
G-Max is offline   Reply With Quote
Old Sep 27, 2010, 10:51 PM   #20
Baldyr
"Hit It"
 
Baldyr's Avatar
 
Join Date: Dec 2009
Location: Sweden
Posts: 5,530
Quote:
Originally Posted by G-Max View Post
So I should ask embryodead?
Probably.
__________________
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:
Q: Who is the woman in the avatar image?
A: Miss Li.
Q: Why does she have a brass-eye?
A: It's a conceptual thing. More of the same on the profile page.

Q: What does you title mean?
A: That is the title of Miss Li's latest single.
Baldyr is offline   Reply With Quote
Reply

Bookmarks

Go Back Civilization Fanatics' Forums > CIVILIZATION IV > Civ4 - Creation & Customization > Question about relation modificators changing

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



Advertisement

All times are GMT -6. The time now is 09:42 AM.


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