Modders Guide to FfH2

Hello!
Can someone help me? I want to bind keys (ex. shift + x) for aiautoplay ex. for 5 turns. How can I do it? I'm totally noob on these things. :(
I don't know what to edit and where.
Thanks.
 
While scanning the CivicInfos XML file I came across this element (God King):
<CapitalCommerceModifiers>
<iCommerce>50</iCommerce>
<iCommerce>0</iCommerce>
<iCommerce>0</iCommerce>
</CapitalCommerceModifiers>

I figure the first iCommerce represents Gold since that is what God King is showing to modify. Is science second and culture third or vice-versa? Working on parsing these files and not familiar at all with the Python such that I could scan source to see how it is being used.

Thanks for the assistance and you will probably be hearing similar questions so any references you could provide would be helpful (like the first post in this thread).
 
Hello!
Can someone help me? I want to bind keys (ex. shift + x) for aiautoplay ex. for 5 turns. How can I do it? I'm totally noob on these things. :(
I don't know what to edit and where.
Thanks.

In the MODCOMP subform (subforum to Creation & Customization, not in the FfH area) you will find a thread for J-Dog5000's AI Autoplay. I am actually assuming you have already read this as your example is exactly the key he uses IIRC. He has a link somewhere in there to see a mod which is using his full AI AutoPlay. You want to import the Python portion of the code to have hotkey capability. FfH already uses his DLL portion, but for whatever reason decided not to bother with the Python part.

While scanning the CivicInfos XML file I came across this element (God King):
<CapitalCommerceModifiers>
<iCommerce>50</iCommerce>
<iCommerce>0</iCommerce>
<iCommerce>0</iCommerce>
</CapitalCommerceModifiers>

I figure the first iCommerce represents Gold since that is what God King is showing to modify. Is science second and culture third or vice-versa? Working on parsing these files and not familiar at all with the Python such that I could scan source to see how it is being used.

Thanks for the assistance and you will probably be hearing similar questions so any references you could provide would be helpful (like the first post in this thread).

Already was answered, but I'd toss in that there is a 4th field actually which is Espionage. You do not actually have to list all 3, but you do have to list them in order (so if all you want to change is Gold, you can list just 1, but if you want to change Culture you need to list all 3 so that the one you modified was the third item to appear in the list).

The most interesting thing I would like to point out is that you can change the name of these fields to anything you want, since the actual name isn't used in the SDK. So instead of:
<iCommerce>50</iCommerce>
<iCommerce>0</iCommerce>
<iCommerce>0</iCommerce>

You could alter the Schema and use:
<iGold>50</iGold>
<iScience>0</iScience>
<iCulture>0</iCulture>


You just have to remember that even though they have names, they are still loaded by order alone, and you cannot change the order of the names. But as long as you do not modify your Schema again that is a moot point, because the XML loading from the Schema will enforce the order anyway.
 
You just have to remember that even though they have names, they are still loaded by order alone, and you cannot change the order of the names. But as long as you do not modify your Schema again that is a moot point, because the XML loading from the Schema will enforce the order anyway.

Thanks for the added info, though to be honest I figured most of that out after some thinking and looking at the building info files (should have done that first, sorry :blush:).

/showoff

Everything except the rename which, while it is true in this case, could possibly break the XML loading routine if the specific child name was referenced:

CapitalCommerceModifiers/iCommerce[#]

instead of

CapitalCommerceModifiers/child::*[#]

since both constructs result in the same child node being selected in this instance.

/end showoff

Anyway, I do appreciate the responses and will try to dig a little deeper next time before I impose myself on the forum.
 
Yeah, if the DLL relied on the name in any manner then it would be an issue. But for all Commerce and Yield statements it uses the same routine, which simply requests "NextChild" and not "if Child = <Specific Name>. So you could have it load up iBanana, bFrog & giaogbnoiabn for all the game cares.
 
Next Q:

Under Crusade there are a number of buildings that are unable to be built (market, moneychanger, etc...) yet I do not see in either the Civics or Buildings XML files how this is determined. Could someone describe to me the algorithm and variables in the buildings file (I assume it would have to be there) that determines this or is it hard-coded in Python?
 
It's in CvGameUtils.py, cannotConstruct.
 
Where are most of the diplomacy results and code located? I'm trying to add another rating (a bad boy rating for those who have played Paradox games), and keep track of it via a small display on the screen as well as being able to track it in the demographic charts.

I'd like to track one instance of each rating for each civilization in the game and use various variables to determine the rise or fall of the rating per turn.
 
I use the Nullsoft Install System (basically just to turn a zip file into an exe). Its very easy.
Kael, how did you get the shortcut to be on the desktop? I've tried and tried to figure this out, but I can't get any of the scripting to work at all, I haven't even been able to get it to grab my files... I've gotten it to install to the correct folder, and put the shortcut in the mod so someone can grab it and put it on their desktop (no scripting involved that way, it's pretty straighforward really), but I can't for the life of me figure out how to get it to just put the shortcut on the desktop in the first place.
 
Kael, how did you get the shortcut to be on the desktop?

I'm not Kael, but maybe I can help you as well. If you want it done by a Nullsoft installer script, it's as easy as this one-liner:

Code:
CreateShortCut "$DESKTOP\${NAME}.lnk" "$INSTDIR1\Civ4BeyondSword.exe" "mod=\${NAME}"

If you already have a working shortcut in your mod's directory and you don't want to do any scripting, just drag and drop it to your desktop.
 
Kael, how did you get the shortcut to be on the desktop? I've tried and tried to figure this out, but I can't get any of the scripting to work at all, I haven't even been able to get it to grab my files... I've gotten it to install to the correct folder, and put the shortcut in the mod so someone can grab it and put it on their desktop (no scripting involved that way, it's pretty straighforward really), but I can't for the life of me figure out how to get it to just put the shortcut on the desktop in the first place.

This is the custom Modern.nsh I wrote:

Code:
;Change this file to customize zip2exe generated installers with a modern interface

!include "MUI.nsh"
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_LANGUAGE "English"

; The name of the installer
Name "Fall from Heaven 2 033"

; The file to write
OutFile "FallfromHeaven2033.exe"

; Request application privileges for Windows Vista
RequestExecutionLevel admin

; The stuff to install
Section "Fall from Heaven (required)"
  SetOutPath $INSTDIR
;  CreateShortCut "$DESKTOP\Fall from Heaven 2 033.lnk" "$INSTDIR\..\Civ4BeyondSword.exe" "mod=\Fall from Heaven 2 033" "$INSTDIR\..\Civ4BeyondSword.exe" 0
SectionEnd

Function .onInit
  ReadRegStr $0 HKLM "SOFTWARE\Firaxis Games\Sid Meier's Civilization 4 - Beyond the Sword" "INSTALLDIR"
  StrCpy $INSTDIR "$0\Mods"
FunctionEnd
 
One Minute faster than Kael, yeah! :)

My NSIS script for the Culturally Linked Starts Installer is a bit more complicated than the one Kael is using for FfH, but that's the tradeoff for some more features. For example: It allows the user to decide, if he wants a shortcut or not.

In case you or someone else is interested in it, I've attached the script to this post.
 

Attachments

Thanks for the help. I still haven't gotten it though. If I follow that script (obviously changing the fall from heaven stuff to the mod I'm creating an installer for), It just gives me a blank installer.exe. How do I get it to use the mod, I'm trying to make an installer for? I can use the "Create from Zip" installer fine, it's pretty intuitive, but there is no way to create a desktop shortcut using that method. Then when I go to the script method, I can't get it to make an installer for my mod. Basically all the installer did using that script was make a PhunRev desktop shortcut, it never loaded the actual mod files into the installer. :dunno:
 
OK, Got it working now. Nice job John Elcard, that worked really well as a template. I'm not all that proficient with coding yet, so had to go on IRC and get some help. Snarko really helped me out there. Now I have a really nice script though, could work with any mod. Simply change all the Text that says MyModName and you'll have an installer that works for any mod (You'll need to put your mod in it's own uniquely named folder in c:\Program Files\...BtS\Mods):
 
FYI for map makers, if you want to update a map to version 34 you need to delete barbatos, should he be there, and change the line in each player's info block about art style from
ArtStyle=ARTSTYLE_GRECO_ROMAN (or whatever) to
ArtStyle=ARTSTYLE_KURIOTATES (or whatever)
(Although if it is a Fall Further map, you may not need to)

edit: and dang, something else I can't figure out...
 
FYI for map makers, if you want to update a map to version 34 you need to delete barbatos, should he be there, and change the line in each player's info block about art style from
ArtStyle=ARTSTYLE_GRECO_ROMAN (or whatever) to
ArtStyle=ARTSTYLE_KURIOTATES (or whatever)
(Although if it is a Fall Further map, you may not need to)

edit: and dang, something else I can't figure out...

I converted a few of the "Ice" scenarios from 0.33 to 0.34 without any problem. I cant think of anything outside of what you mentioned that could cause problems.

Also I've started adding new options to mapscripts in 0.34 such as the following:

Code:
BeginMap
	grid width=52
	grid height=52
	top latitude=90
	bottom latitude=-90
	wrap X=0
	wrap Y=0
	world size=WORLDSIZE_STANDARD
	climate=CLIMATE_TEMPERATE
	sealevel=SEALEVEL_LOW
	num plots written=2704
	num signs written=0
	Randomize Resources=true
[b]	Randomize Lairs=true
	Randomize Unique Improvements=false[/b]
EndMap

Randomize Lairs and Randomize Unique Improvements (if they are set to true) will cause those to set randomly when the scenario is started. I would recommend not placing any on your map if you want to use these optiosn and allowing the engine to place them for you. That way the game will automatically adjust to added/removed improvements and your mapscript will still work, and the randomization may increase replayability.
 
The 0.34 source code is in the first post.
 
Back
Top Bottom