Advertisement
Civilization Fanatics' Center

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

Notices

Reply
 
Thread Tools
Old Oct 30, 2010, 12:10 PM   #61
Baldyr
"Hit It"
 
Baldyr's Avatar
 
Join Date: Dec 2009
Location: Sweden
Posts: 5,530
I actually have a clever question: Should the Pictic ability be limited to the Bristish Isles? North West Europe? Because it helps if the code only needs to check a limited portion of the game map.

Give me some coordinates!
__________________
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 Oct 30, 2010, 12:16 PM   #62
j_mie6
Deity
 
j_mie6's Avatar
 
Join Date: Dec 2009
Location: Bristol (uni)/Swindon (home)
Posts: 2,940
Gender: Male
Images: 10
do you think you can do gaul as well though?

also what about the forest chop!
__________________
My mods = Jamie's Rome Mod 1.3.2, No Global Warming Mod My units = Great Generals, Ninja!, Desert Marine, African Marines, Chinese Rocketeer My utilities: XML text cleaner, City Optimiser/Simulator

Maths A*, Biology A*, Physics A in A levels!!!! Going to study Computer Science at Bristol University!

State Property, the new Forbidden Palace?

Jamie
j_mie6 is offline   Reply With Quote
Old Oct 30, 2010, 12:19 PM   #63
j_mie6
Deity
 
j_mie6's Avatar
 
Join Date: Dec 2009
Location: Bristol (uni)/Swindon (home)
Posts: 2,940
Gender: Male
Images: 10
@ post 61

That is a good point! as soon as the picts leave england they would have better food sources (check out the screenshot of their starting position )

I say the british isles only (possibly northern france as they do seem to like there in the mod )

Do you need the co-ordinates of britain?
__________________
My mods = Jamie's Rome Mod 1.3.2, No Global Warming Mod My units = Great Generals, Ninja!, Desert Marine, African Marines, Chinese Rocketeer My utilities: XML text cleaner, City Optimiser/Simulator

Maths A*, Biology A*, Physics A in A levels!!!! Going to study Computer Science at Bristol University!

State Property, the new Forbidden Palace?

Jamie
j_mie6 is offline   Reply With Quote
Old Oct 30, 2010, 12:22 PM   #64
Baldyr
"Hit It"
 
Baldyr's Avatar
 
Join Date: Dec 2009
Location: Sweden
Posts: 5,530
I'll look into other Civs later. I'm all about the Picts right now.

Yeah, give me the coordinates. Bottom left tile and top right tile, please.
__________________
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 Oct 30, 2010, 12:23 PM   #65
j_mie6
Deity
 
j_mie6's Avatar
 
Join Date: Dec 2009
Location: Bristol (uni)/Swindon (home)
Posts: 2,940
Gender: Male
Images: 10
This may take a bit of figuring... Please hold...
__________________
My mods = Jamie's Rome Mod 1.3.2, No Global Warming Mod My units = Great Generals, Ninja!, Desert Marine, African Marines, Chinese Rocketeer My utilities: XML text cleaner, City Optimiser/Simulator

Maths A*, Biology A*, Physics A in A levels!!!! Going to study Computer Science at Bristol University!

State Property, the new Forbidden Palace?

Jamie
j_mie6 is offline   Reply With Quote
Old Oct 30, 2010, 12:32 PM   #66
Baldyr
"Hit It"
 
Baldyr's Avatar
 
Join Date: Dec 2009
Location: Sweden
Posts: 5,530
Enable cheat mode and hover the tiles in question while holding shift key. The tile coordinates are shown in the lower left part of the game interface.
__________________
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 Oct 30, 2010, 12:34 PM   #67
Asaf
Sleep Deprived
 
Asaf's Avatar
 
Join Date: Mar 2010
Posts: 1,326
Amm... NOT being an experienced modder myself, but a C++ programmer, which I've noticed you need.

If you need some minor SDK programming, I don't mind doing it.
I suggest exposing some missing events or methods to the python API (to CyPlot, for example). Minimum work for me, maximum flexibility for you

Quote:
Originally Posted by Baldyr View Post
I can't even get confirmation on that the canDoCivic() call is happening, so I guess I'm missing something here.
You should set USE_CAN_DO_CIVIC_CALLBACK in PythonCallbackDefines.xml to 1.
__________________
Civ IV Mod components: Power Up | Civics Dependency | Ethnic Buildings | My Custom DLL (Ver 7) | Fourth Yield | Unique Civics

Civ IV Modding Tutorials: Compiling the DLL (including Using Visual Studio & Debugging), Version Control with TSVN

New: A Game Font Editor for Civ IV (version 0.6, updated 15-Aug-2012)
Asaf is offline   Reply With Quote
Old Oct 30, 2010, 12:44 PM   #68
Baldyr
"Hit It"
 
Baldyr's Avatar
 
Join Date: Dec 2009
Location: Sweden
Posts: 5,530
Quote:
Originally Posted by Asaf View Post
I suggest exposing some missing events or methods to the python API (to CyPlot, for example). Minimum work for me, maximum flexibility for you
I'm pretty much done with the improvements solution for the Picts at this point, but I guess that if tile yields could be changed properly with Python by including a custom DLL file to the mod, then I'd say we should go for it... I can wait.

But ask j_mie6 before doing any actual work!

Quote:
Originally Posted by Asaf View Post
You should set USE_CAN_DO_CIVIC_CALLBACK in PythonCallbackDefines.xml to 1.
j_mie6: Are you following?
__________________
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 Oct 30, 2010, 12:54 PM   #69
Baldyr
"Hit It"
 
Baldyr's Avatar
 
Join Date: Dec 2009
Location: Sweden
Posts: 5,530
Asaf, actually, if you could expose some stuff from the SDK to Python I would probably be able to do a great many of j_mie6's requests... Lets see - something along these lines would be very helpful:

CyCity.setExtraUnhappiness()
CyCity.setRevoltChance()
CyCity.setDomainExtraYield()
CyPlayer.setCityExtraDefense()
CyPlayer.changeWarWearinessPercent()
CyPlayer.setMaintenanceDiscount()

...or something. I actually have no idea what is currently available in the C++ and what would have to be written from scratch.
__________________
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 Oct 30, 2010, 01:03 PM   #70
j_mie6
Deity
 
j_mie6's Avatar
 
Join Date: Dec 2009
Location: Bristol (uni)/Swindon (home)
Posts: 2,940
Gender: Male
Images: 10
x=0,y=40 is the bottom left (there is land directly above it at 0,43 this is Ireland)

now there are two options

Britain only - x=10,y=51
Britain and Norway 'Blob' - x=19,y=51

I'm not sure which I want

Btw the carthagian works now!
__________________
My mods = Jamie's Rome Mod 1.3.2, No Global Warming Mod My units = Great Generals, Ninja!, Desert Marine, African Marines, Chinese Rocketeer My utilities: XML text cleaner, City Optimiser/Simulator

Maths A*, Biology A*, Physics A in A levels!!!! Going to study Computer Science at Bristol University!

State Property, the new Forbidden Palace?

Jamie
j_mie6 is offline   Reply With Quote
Old Oct 30, 2010, 01:15 PM   #71
Baldyr
"Hit It"
 
Baldyr's Avatar
 
Join Date: Dec 2009
Location: Sweden
Posts: 5,530
Map tiles are actually counted bottom-up, so tile 0/0 is the lower left corner of the map. But you don't actually have to count individual tiles to get the coordinates. See above.

Try again? And I'll make it really easy for you to tweak the coordinates once my work is done. So practically any valid coordinates should do for testing purposes - even if it means that the code will process the whole map...
__________________
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 Oct 30, 2010, 01:15 PM   #72
j_mie6
Deity
 
j_mie6's Avatar
 
Join Date: Dec 2009
Location: Bristol (uni)/Swindon (home)
Posts: 2,940
Gender: Male
Images: 10
sorry was Butchering an octopus

I don't really understand the convo...
__________________
My mods = Jamie's Rome Mod 1.3.2, No Global Warming Mod My units = Great Generals, Ninja!, Desert Marine, African Marines, Chinese Rocketeer My utilities: XML text cleaner, City Optimiser/Simulator

Maths A*, Biology A*, Physics A in A levels!!!! Going to study Computer Science at Bristol University!

State Property, the new Forbidden Palace?

Jamie
j_mie6 is offline   Reply With Quote
Old Oct 30, 2010, 01:17 PM   #73
j_mie6
Deity
 
j_mie6's Avatar
 
Join Date: Dec 2009
Location: Bristol (uni)/Swindon (home)
Posts: 2,940
Gender: Male
Images: 10
I worked it out in 2 mins lol anyway I think I will take Britain only...

ANYWAY I don't really know what asaf was saying elaborate?
__________________
My mods = Jamie's Rome Mod 1.3.2, No Global Warming Mod My units = Great Generals, Ninja!, Desert Marine, African Marines, Chinese Rocketeer My utilities: XML text cleaner, City Optimiser/Simulator

Maths A*, Biology A*, Physics A in A levels!!!! Going to study Computer Science at Bristol University!

State Property, the new Forbidden Palace?

Jamie
j_mie6 is offline   Reply With Quote
Old Oct 30, 2010, 01:22 PM   #74
Baldyr
"Hit It"
 
Baldyr's Avatar
 
Join Date: Dec 2009
Location: Sweden
Posts: 5,530
I'm not sure what you don't understand...

1. enable cheat mode in CivilizationIV.ini
2. start your scenario
3. decide on a rectangular map area that is the area of effect for the Pictic ability
4. hover the lower left corner of this map area with the mouse arrow while holding down the shift key
5. repeat #4 with the upper right corder of the area
6. write down the map coordinates displayed in the information field in the lower left corner of the game interface while looking them up

So what I need are the map coordinates of two map tiles, like 23/34 and 45/56, or whatever. Either that or I need to know how many tiles the map spans on the X and Y axis respectively. (Don't count! Look it up in the WBS.)
__________________
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 Oct 30, 2010, 01:26 PM   #75
j_mie6
Deity
 
j_mie6's Avatar
 
Join Date: Dec 2009
Location: Bristol (uni)/Swindon (home)
Posts: 2,940
Gender: Male
Images: 10
I didn't count I used my senario file... The two co-ordinates are:

x=0,y=40
x=10,y=51

I don't understand the asaf convo
__________________
My mods = Jamie's Rome Mod 1.3.2, No Global Warming Mod My units = Great Generals, Ninja!, Desert Marine, African Marines, Chinese Rocketeer My utilities: XML text cleaner, City Optimiser/Simulator

Maths A*, Biology A*, Physics A in A levels!!!! Going to study Computer Science at Bristol University!

State Property, the new Forbidden Palace?

Jamie
j_mie6 is offline   Reply With Quote
Old Oct 30, 2010, 01:27 PM   #76
Baldyr
"Hit It"
 
Baldyr's Avatar
 
Join Date: Dec 2009
Location: Sweden
Posts: 5,530
Quote:
Originally Posted by j_mie6 View Post
I worked it out in 2 mins lol anyway I think I will take Britain only...
No you didn't. See above.

Quote:
Originally Posted by j_mie6 View Post
ANYWAY I don't really know what asaf was saying elaborate?
The CivIV Python is basically mirroring the C++ code in the SDK. But not everything is available for the Python modder - tons of things seem not to have been "exposed" to Python. But this is something that obviously can be done in the SDK - add functions, methods and constants to the Python API. Which opens up new possibilities not available before.

BTW - did you get the Greek ability working yet? Because Asaf explained that you need to enable a Python callback in the XML. Look if you can't find the file and the entry for canDoCivic. Please?
__________________
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 Oct 30, 2010, 01:28 PM   #77
Baldyr
"Hit It"
 
Baldyr's Avatar
 
Join Date: Dec 2009
Location: Sweden
Posts: 5,530
I don't know what convo means.
__________________
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 Oct 30, 2010, 01:30 PM   #78
j_mie6
Deity
 
j_mie6's Avatar
 
Join Date: Dec 2009
Location: Bristol (uni)/Swindon (home)
Posts: 2,940
Gender: Male
Images: 10
Ok, What I did was decided in game and put a battleship where I wanted it and then opened a new WBS and looked for the battleships

Have not checked the XML... What does the Callback do?

Convo is short for Conversation
__________________
My mods = Jamie's Rome Mod 1.3.2, No Global Warming Mod My units = Great Generals, Ninja!, Desert Marine, African Marines, Chinese Rocketeer My utilities: XML text cleaner, City Optimiser/Simulator

Maths A*, Biology A*, Physics A in A levels!!!! Going to study Computer Science at Bristol University!

State Property, the new Forbidden Palace?

Jamie
j_mie6 is offline   Reply With Quote
Old Oct 30, 2010, 01:34 PM   #79
Baldyr
"Hit It"
 
Baldyr's Avatar
 
Join Date: Dec 2009
Location: Sweden
Posts: 5,530
Quote:
Originally Posted by j_mie6 View Post
Have not checked the XML... What does the Callback do?
It runs the custom script I supplied. Just set it to 1 as Asaf said. Because it seems to be disabled by default to avoid endless callbacks with no actual code to run.

And thanks of the coords.
__________________
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 Oct 30, 2010, 01:36 PM   #80
Baldyr
"Hit It"
 
Baldyr's Avatar
 
Join Date: Dec 2009
Location: Sweden
Posts: 5,530
This is what the tile settings look like in the code:
Code:
iBritainTL = Map.plotNum(0, 40)
iBritainBR = Map.plotNum(10, 51)
Easy enough to edit, eh?
__________________
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 > Civ4 - SDK/Python > [BTS] Requesting following features

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 05:07 PM.


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