View Full Version : SDK changes
Kailric Aug 23, 2009, 10:22 AM Here are the lastest changes to the SDK and XML:
DOWNLOAD (http://forums.civfanatics.com/attachment.php?attachmentid=249114&stc=1&d=1270921841)
-Added route "trails"
-Added "route to" commands for trail, road, and railroad
-Added Take Train command. If two or more cities are connected by railroad and have a train station the unit can select the city to move to. You can also move Cargo this way and it will be auto unload being added to the arriving towns warehouse. Only one unit can be transported this way per town.
-Added the railstation art and adjusted the City Management screen to show the train station. Needs better art though in City Management
Just make sure everything works right and I encluded all the files.
First post:
I started working on the changes needed in the SDK. To make the President give you a Wagon Train instead of a ship if you lose your only Wagon Train it would be helpful to make the Wagon Train purchaseable from the "Europe" screen. I'll make the code check for the cheapest land based cargo unit, which should be the wagon train. It will check if the player can afford to purchase one if he can then the President want offer any help.
TC01 Aug 23, 2009, 11:29 AM Units that can be purchased is all handled via XML.
I'll remove the ability to purchase naval units and add the ability to purchase land transport units, while making sure to make the cheapest land unit the Wagon Train.
Kailric Aug 23, 2009, 11:35 AM K, it didn't take long. The ole prez will give you a Wagon Train now instead of a ship. I had to make the Wagon Train cost something in Europe though or you get a CTD. Also the locomotive only moves on rail roads now. The directions are messed up though. It always faces opposite the direction it is going so it moves backward?
To set a unit as a "locomotive" and only run on rail roads you just make sure it has cargo space, DOMAIN_LAND, and bMechanized is true. If bMechanized is set to false it will be the same as a Wagon Train and can move any where.
I also set the "Value" of the railroad in CIV4RouteInfos to 2. For locomotives the code checks the value of a route, if its greater than 1 then it knows its a railroad.
All I need is a working version of the Homecities on the map to finish up this part...
Here is a question, should routes have a build hierarchy? Say you have to build roads first then railroad, like in CIV4? If so those changes may have to be made in SDK as well.
TC01 Aug 23, 2009, 12:03 PM All I need is a working version of the Homecities on the map to finish up this part...
Working on this. I made the switch to starting with a Wagon Train instead of a Caravel, but now I'm making sure that all of your starting units appear in your home city. Koma had it coded it so it just dropped your first starting unit in the home city (since the Caravel had the other two loaded into it) but now I need to do that for all three units.
Then I need to place Mexican civs in the Desert region of the map and American civs in the Mississippi river area.
Here is a question, should routes have a build hierarchy? Say you have to build roads first then railroad, like in CIV4? If so those changes may have to be made in SDK as well.
Probably a good idea. It provides a better way to restrict Railroads then, say, making the build command take tools out of a city as you suggested.
If you use the "Value" tag, you could make routes with a value of 2 require a route of value 1 on the plot to be built.
Kailric Aug 23, 2009, 12:13 PM Probably a good idea. It provides a better way to restrict Railroads then, say, making the build command take tools out of a city as you suggested.
If you use the "Value" tag, you could make routes with a value of 2 require a route of value 1 on the plot to be built.
K, That will be easy to add in. We need a "Build RailRoad" button too, I can fix this up. Also, I'll make the button greyed out if there isn't a road present already, much like found city is when you are too close to another city.
TC01 Aug 23, 2009, 12:52 PM For the record, we have a button. I stole it from Civ 4 and added it in one of the three patches for v0.2.
But yeah, graying it out if you aren't on a road would be good.
TC01 Aug 23, 2009, 01:51 PM Okay. In order to get HCOM working on WH, you need to do this:
-Unzip HCOM to a temporary directory.
-Copy over/merge the DLL.
-Copy over the art.
-Copy over every XML file except: CIV4CivilizationInfos.xml and CIV4GameText_Colonization_Objects.xml (Westward Ho uses both of these files)
-Copy over every PY file except: CvEventManager.py
-"Copy CvUtil.py and sdToolKit.py from MN into Assets/python" (sdToolKit goes into Assets/Python/Screens)
-Copy the zipped CvEventManager.py into Assets/Python at the bottom of the post.
-In CIV4CivilizationInfos.xml, replace the Caravel as a starting unit for colonial civs with the Wagon Train, and set <bWaterStart> to 0. (You can also allow the Wagon Train to carry all Land units in CIV4UnitInfos.xml).
This should let it work on the WildWest script.
Kailric Aug 23, 2009, 06:49 PM K, here is my frist upload. I made a few more changes than mentioned based on what was need as explained below.
Changes that need to be tested are:
-Locomotives should only move on railroads and cities
-Land units can load into Wagons from anywhere, was only in Cities
-Build Railroad only appears if there is a road present
-President wont ask you if you are sure about founding a city inland
-President wont send help unless you lose your last Wagon Train and can't afford a new one. Then he sends a new one.
-Wagon Trains and Locomotives can "sail to Europe"
-Pioneers will unload from a Wagon before trying to build. So if you move the wagon they want go with it :p
XML changes:
-CIV4Civilizations: changed so that Civs wont start on water and start with a wagon
-CIV4RouteInfos: set Railroad value to 2
-CIV4GlobalDefines: added a define int "ROUTE_RAILROAD_VALUE" for railroads. This number should always be the "Value" of the railroad set in CIV4RouteInfos
-CIV4Unit: only edited Wagons to carry land units. And set Locomotives as a Mechanized unit
I found one error while building railroads in the attached picture. The red blob should be a railroad but its not. Something to do with the direction of other railroads around that plot, you can see which plots have raid roads in the pic.
Lots of the graphics need to be adjusted of course and the changes that koma mentioned need to be addressed as well.
There will probably be lots of SDK stuff that needs to be adjusted like the ones I mentioned above as well. Just let me know the things you come across. I put this together rather fast so lookout for CTD as well :crazyeye:
TC01 Aug 23, 2009, 08:08 PM Well, I know that the Colonization road has nearly double the amount of route models then the Civ 4 one (and the Civ 4 railroad). This probably has something to do with the problem.
-Locomotives should only move on railroads and cities
Check. It works, and they can't enter native cities either. Thanks.
-Land units can load into Wagons from anywhere, was only in Cities
Check.
-Build Railroad only appears if there is a road present
Check. And I completely forgot that Colonization build buttons and Civ 4 build buttons are completely different, when I tried to use the Civ 4 button. Could you please "clone" that button into a Col-ish circle and shape? It's in "Art\Interface\Buttons\Builds\buildrailroad.dds" of WestwardHo.
-President wont ask you if you are sure about founding a city inland
Check.
-Wagon Trains and Locomotives can "sail to Europe"
Check. However, when returning from Europe, if you exited from a city, you get the "Do you want to trade with this city?" Blocking that message on return from Europe (can I do it via python?) would be good.
-Pioneers will unload from a Wagon before trying to build. So if you move the wagon they want go with it
Check.
Everything appears to work based on brief playtesting. I did have another idea, though. I don't know how much work this would be to implement, but Beyond the Sword has a "NewConceptInfos" XML file. Colonization doesn't. I was thinking that a "Westward Ho Concepts" pedia page might be helpful.
I'm not suggesting creating a new file, but it might be a lot easier to make a tag (or GlobalDefine of some sort?) "<bNewConcept>" in CIV4BasicInfos.xml. Then in the python screen for this pedia page I can get anything with a NewConcept and put it in the new concept article.
Is this doable?
Kailric Aug 23, 2009, 08:32 PM Everything appears to work based on brief playtesting. I did have another idea, though. I don't know how much work this would be to implement, but Beyond the Sword has a "NewConceptInfos" XML file. Colonization doesn't. I was thinking that a "Westward Ho Concepts" pedia page might be helpful.
I'm not suggesting creating a new file, but it might be a lot easier to make a tag (or GlobalDefine of some sort?) "<bNewConcept>" in CIV4BasicInfos.xml. Then in the python screen for this pedia page I can get anything with a NewConcept and put it in the new concept article.
Is this doable?
K, I'll work up a button, actually I done that already but wasn't quite happy with it. I am not sure what causes the Trade with City to pop up, if its SDK that will be easy to fix though. I didn't actually put code in for not entering a Native Village... at the moment it just checks for a "FriendlyCity" so maybe the friendly city code checks for natives. I use existing code when ever possible but it don't always do what you want it to. So I'll recheck the code to make sure its doing what we want there.
I haven't ever added a seperate Pedia page yet but its definately doable of course, just learning how. But in my Privateers mod I added new concepts to the existing concepts page and its really simple. You can use that mod for an example on that.
I'll make another upload tomorrow after work. If there is anything pretty simple that can be fixed let me know and maybe I can get it in.
Kailric Aug 24, 2009, 04:36 PM Here are a couple buttons for Railroading. I looked into the code about the "Do you want to trade with this city?" and the code for makeing the popup work is there but not the code for making it appear...
I just found the below code in CvAdvisorUtils.py.
I guess it just needs a check for isEurope() don't popup.
if (player.shouldDisplayFeatPopup(FeatTypes.FEAT_TALK _NATIVES)):
if (pUnit.canSpeakWithChief(pUnit.plot()) or pUnit.canLearn() or pUnit.canTradeYield(pUnit.plot()) or pUnit.canEstablishMission()):
if pUnit.getID() not in g_listUnitNags:
popupInfo = CyPopupInfo()
popupInfo.setButtonPopupType(ButtonPopupTypes.BUTT ONPOPUP_TALK_NATIVES)
popupInfo.setData1(pUnit.getID())
popupInfo.addPopup(pUnit.getOwner())
g_listUnitNags.append(pUnit.getID())
TC01 Aug 24, 2009, 08:39 PM I went with the high_res button, but I liked both of them.
Adding a "if not (pUnit.plot()).isEurope():" check to that code worked fine.
I could of course just add things to the main concepts page, but I felt that since at this point I don't actually know how much new stuff this mod will have (it already replaces the focus on water and ships with the focus on your home city, railroads, and land) it would be a lot easier to get people to notice the information in a new page.
It doesn't look like there are any other issues, from my testing.
Kailric Aug 24, 2009, 10:10 PM I went with the high_res button, but I liked both of them.
Adding a "if not (pUnit.plot()).isEurope():" check to that code worked fine.
I could of course just add things to the main concepts page, but I felt that since at this point I don't actually know how much new stuff this mod will have (it already replaces the focus on water and ships with the focus on your home city, railroads, and land) it would be a lot easier to get people to notice the information in a new page.
It doesn't look like there are any other issues, from my testing.
Oh yeah, I forgot to mention that one button is ment for the "Build Railroad To" command, much like the "Route To" command. That's why it has arrows on it. I figure it would be useful to add that command at some point. Should be easy to do.
TC01 Aug 27, 2009, 02:22 PM Sorry for delay in responding, I've been busy and working on updating my other mods (however I did just finished the native civs for v0.3).
A Railroad Route To button might be useful, but how would it work? Would the pioneer build roads then railroads on the plot? If so it should be made a lot more expensive.
I guess Route To commands are done via SDK? That would be another command (along with the train ones) that need to be added.
Kailric Aug 27, 2009, 10:54 PM Sorry for delay in responding, I've been busy and working on updating my other mods (however I did just finished the native civs for v0.3).
A Railroad Route To button might be useful, but how would it work? Would the pioneer build roads then railroads on the plot? If so it should be made a lot more expensive.
I guess Route To commands are done via SDK? That would be another command (along with the train ones) that need to be added.
Yeah, it would have to build Roads then RailRoads. I been working on a ModComp myself but just got done with the first release today. So I'll look into those other commands over the next few days.
Kailric Aug 30, 2009, 08:29 AM I am going to work on this today. I haven't delved into the trade routes so I am not sure what I'll have to do to get the train commands working. If I have to write a bunch of new functions it may take me a long while but I'll get back to you on my progess...
Kailric Aug 30, 2009, 09:59 AM Ok, I have questions..
1. When you say the "Change the name of your Civilization on Revolution" where is this name going to be displayed? Right now the Civs name doesn't appear very much in the game actually, I only see it listed once in the Victory Conditions/Settings Screen. Plus the Civs name has three names actually in the XML. ... The "Description", "ShortDescription", and "Adjective". The Civ Adjective, and ShortDescription appear sometimes when the King talks to you, but other than that I don't see where it appears much during the game.
I just figured out how this is done and it would be an easy thing to do. I didn't know you can go into Options/Your Details and change all the Titles that appear so you can edit them yourself. It would be an easy thing to do this automatically on revolution though. I just need the Names and adjectives you would like to change them to so they can be added to the Text.XML. But Like I mentioned the Civ name isn't used enough really to make such a change even noticeable, that I can tell. We could change the Player's name to "Player, President of the State of Deseret" or something like that.
What was your thoughts on this and how was it going to function?
2. Looking into the trade routes and just thinking on how to add in Passenger pickup commands. Its really going to take some fancy coding to get it to work seamlessly. But I wonder though how useful these commands will be? Like when I suggested this I was thinking if you had cities spaced out long ways apart this would be a neat command to move units about but how far apart does the player place his cities... not very I would think. I try to keep mine close together. That being so even with roads it would normally take no more than two turns to move a Colonists from one city to the next. Thats probably faster than actually "Waiting on the Train". So I am thinking unless some game mechanics are changed these commands wont be used often.
Some ideas or suggestions:
-There could be hazards for trying to "trek across country" by foot. This would be very historically correct as well. Indians, Starvation, getting lost, or bad weather, where some of the major events that could happen to travelers. There could be some kind of random check for each plot a Colonists has to travel across. If say the Colonists encounters bad weather he could become immobile for a turn. Or you could charge Health points for each plot a Colonist crosses on foot. Just a couple ideas off the top of my head. But something like that would make "waiting for the train" a more viable option.
-Instead of having the train pickup a Colonist there could be an automatic transport feature. Much like Civ4 is, once you have railroads movement is basically free right? So maybe something like if you had a railroad between two cities Colonist could move between those two points in one turn. A feature such as that would be more useful.
I haven't been keeping up with all the threads so I don't know if much has been mentioned on this but maybe we could take up a general census on these ideas and see what players would think the most viable solution would be.
What are your thoughts?
TC01 Aug 30, 2009, 01:07 PM 1. When you say the "Change the name of your Civilization on Revolution" where is this name going to be displayed? Right now the Civs name doesn't appear very much in the game actually, I only see it listed once in the Victory Conditions/Settings Screen. Plus the Civs name has three names actually in the XML. ... The "Description", "ShortDescription", and "Adjective". The Civ Adjective, and ShortDescription appear sometimes when the King talks to you, but other than that I don't see where it appears much during the game.
I just figured out how this is done and it would be an easy thing to do. I didn't know you can go into Options/Your Details and change all the Titles that appear so you can edit them yourself. It would be an easy thing to do this automatically on revolution though. I just need the Names and adjectives you would like to change them to so they can be added to the Text.XML. But Like I mentioned the Civ name isn't used enough really to make such a change even noticeable, that I can tell. We could change the Player's name to "Player, President of the State of Deseret" or something like that.
What was your thoughts on this and how was it going to function?
I was thinking ideally of adding text strings such as "RevolutionDescription", "RevolutionShortDescription", "RevolutionAdjective", etc to CivilizationInfos.xml rather then referencing specific strings in the SDK for this, allowing me or others to change them directly.
The idea was that since we had an argument over Deseret versus Utah, Cascadia versus Oregon, etc., this would be a compromise. Possibly, on revolution we can have a popup (or at least something appearing in the event log) saying "The Utah Territory is now known as the State of Deseret", along with the existing revolution messages (constitution, etc). Maybe also, in the pedia page for each colony, there could be a line "Revolution Name: State of Deseret" as well. (Though I could do this in the XML text for the civilization instead).
-There could be hazards for trying to "trek across country" by foot. This would be very historically correct as well. Indians, Starvation, getting lost, or bad weather, where some of the major events that could happen to travelers. There could be some kind of random check for each plot a Colonists has to travel across. If say the Colonists encounters bad weather he could become immobile for a turn. Or you could charge Health points for each plot a Colonist crosses on foot. Just a couple ideas off the top of my head. But something like that would make "waiting for the train" a more viable option.
Several people have suggested making rivers an actual feature, which you can send ships across. The suggestion I liked best was making rivers a feature that took up most of a plot (whereas the current rivers are minor rivers and streams), that have an incredibly high movement cost for non-water units. Then you could build bridges as an improvement across them and railroads and roads over the bridges. I kind of liked the idea.
Chibiabos also suggested that we could make Canyons impassable features found along rivers... this might also work.
We could add blizzards (like in the FFH Age of Ice scenario) to frequent the Rocky Mountains area, thus making travel near there dangerous. Once the west coast section is added to the mapscript this will become more meaningful.
We could also make random events that cause colonists to become ill, or suffer bad weather like you said. They would only trigger outside of your borders. Perhaps promotions like "Woodsman" and "Mountaineer" could also decrease the likelyhood of such events occuring.
-Instead of having the train pickup a Colonist there could be an automatic transport feature. Much like Civ4 is, once you have railroads movement is basically free right? So maybe something like if you had a railroad between two cities Colonist could move between those two points in one turn. A feature such as that would be more useful.
I don't know how much of a graphical challenge it would be to design, but perhaps we could make this work like it does in Planetfall? In that mod for Civ 4, your land units can cross ocean tiles as long as they are inside your territory. When this happens, your unit looks like it is "attached" to a transport ship.
Perhaps when you move a non-train onto a railroad, we could make it look like there's a Locomotive or other train unit in front of it, as if it is "riding the train"?
I will open up a thread on this to discuss it.
Kailric Aug 31, 2009, 10:38 AM Change Name on Revolution files.
Here is an upload to test. I tested it once and it worked seemingly. You will see in the CivilizationInfos.xml 3 new tags for Revolution names. I just copied all of Texas's Descriptions for each one for testing. I played as Oregon and after Revolution I was refered to as Texas names. So I believe it works. Test it for me though and I'll be back this afternoon.
TC01 Aug 31, 2009, 03:20 PM One thing before I test/merge (I edited CivilizationInfos.xml since v0.23): I notice in CIV4CivilizationInfos.xml it looks like this:
<Adjective>TXT_KEY_CIV_DESERET_ADJECTIVE</Adjective>
<RevolutionDescription>TXT_KEY_CIV_TEXAS_DESC</RevolutionDescription>
<RevolutionShortDescription>TXT_KEY_CIV_TEXAS_SHORT_DESC</RevolutionShortDescription>
<RevolutionAdjective>TXT_KEY_CIV_TEXAS_ADJECTIVE</RevolutionAdjective>
<Civilopedia>TXT_KEY_CIV_DESERET_PEDIA</Civilopedia>
Shouldn't it look like this?
<Adjective>TXT_KEY_CIV_TEXAS_ADJECTIVE</Adjective>
<RevolutionDescription>TXT_KEY_CIV_TEXAS_DESC</RevolutionDescription>
<RevolutionShortDescription>TXT_KEY_CIV_TEXAS_SHORT_DESC</RevolutionShortDescription>
<RevolutionAdjective>TXT_KEY_CIV_TEXAS_ADJECTIVE</RevolutionAdjective>
<Civilopedia>TXT_KEY_CIV_TEXAS_PEDIA</Civilopedia>
Kailric Aug 31, 2009, 03:45 PM You mean the spacing? I think our editing programs must conflict with each other and don't display the text the same cause when I load up a file you have edited it tells me there is a discrepancy and asks me if I want to do something to the file, can't remember what it is. But I'll make note next time. I use Visual Web Developer 2008 Express Edition. But if the spacing is off It wasn't my doing on purpose.
TC01 Aug 31, 2009, 04:16 PM Ah. I use a text editor, Notepad++.
I've seen this problem before when I tried to edit some python files (mapscripts made by the community)- using tabs and spaces interchangeably causes issues.
TC01 Aug 31, 2009, 05:42 PM In my test, I noticed that while your name does indeed change in the "Your Details" screen, it does not change when you mouseover your name in the list of civilizations (where it displays your traits, name, civ name, etc).
Otherwise, it works great!
Kailric Aug 31, 2009, 08:16 PM K, attached a fix for the error you mentioned. Two files, just replace them and see how it goes.
TC01 Sep 06, 2009, 09:18 AM It works, thanks. Now all I have to do is add in the founding fathers (well, rename the existing Founding Fathers, anyway) and I'll release v0.3.
TC01 Sep 13, 2009, 05:27 PM I downloaded this yesterday and have played a few times from the beginning, and I keep getting a crash when I send a wagon train to my home city. It doesn't happen every time, but it's happened at least four times out of the ten or so that I've played. I also had an issue with my home city not showing up on one occasion. Looks good, though.
A few bug reports. I have no idea if they are SDK related or not, but that's usually what causes CTDs. Python usually gives exceptions instead. (At least, that's been my experience...)
Another thing I just thought of: you might want to release your source code somewhere. I probably won't use it, but other people might.
Kailric Sep 13, 2009, 07:26 PM A few bug reports. I have no idea if they are SDK related or not, but that's usually what causes CTDs. Python usually gives exceptions instead. (At least, that's been my experience...)
Another thing I just thought of: you might want to release your source code somewhere. I probably won't use it, but other people might.
k, I been waiting to see if there was no bugs before I released the source code.
Crashing when sent to homecity? Hmmm... not sure about this one. Can you get the poster to send us a saved game just before a crash happens and let us know what unit it was. We need to know at what point the crash happens. Like was in enroute, or after it arrived at the city.
TC01 Sep 14, 2009, 06:49 AM I've posted asking for a save game. However, in my attempts to replicate the error, I may have found the same one/another one. It may be a python error only, but I'm posting it here anyway. And, it specifically says that I'm getting "C++ Exceptions", so...
To test this, I sent my Wagon Train from Laredo (home city) to "Europe". It returned fine.
I then moved one plot next to Laredo and sent it to "Europe" again. It returned fine, no issues yet.
Then, I moved one plot outside of Laredo's cultural borders and got this python exception:
Traceback (most recent call last):
File "CvEventInterface", line 23, in onEvent
File "CvEventManager", line 185, in handleEvent
File "CvEventManager", line 511, in onUnitMove
File "CvAdvisorUtils", line 32, in unitMoveFeats
RuntimeError: unidentifiable C++ exception
ERR: Python function onEvent failed, module CvEventInterface
followed by quite a lot of these:
Traceback (most recent call last):
File "CvScreensInterface", line 556, in forceScreenRedraw
File "CvMainInterface", line 1120, in redraw
File "CvMainInterface", line 1756, in updateSelectionButtons
RuntimeError: unidentifiable C++ exception
ERR: Python function forceScreenRedraw failed, module CvScreensInterface
The function in CvAdvisorUtils that this references is the function that controls when code should popup to send you to Europe. It may have been edited in Home Cities on Map. The line that throws the exception is highlighted below.
def unitMoveFeats(pUnit, pPlot, pOldPlot):
if not pPlot.isNone():
player = gc.getPlayer(pUnit.getOwner())
if (player.shouldDisplayFeatPopup(FeatTypes.FEAT_GOTO _EUROPE)):
pGroup = pUnit.getGroup()
if (not pGroup.isNone() and pGroup.getLengthMissionQueue() == 1):
if (pGroup.getMissionType(0) == MissionTypes.MISSION_MOVE_TO and pGroup.at(pGroup.getMissionData1(0), pGroup.getMissionData2(0))):
if (not pUnit.isAutomated() and pUnit.canDoCommand(CommandTypes.COMMAND_SAIL_TO_EU ROPE, UnitTravelStates.UNIT_TRAVEL_STATE_TO_EUROPE, -1, false)):
popupInfo = CyPopupInfo()
popupInfo.setButtonPopupType(ButtonPopupTypes.BUTT ONPOPUP_FEAT)
popupInfo.setData1(FeatTypes.FEAT_GOTO_EUROPE)
popupInfo.setData2(pUnit.getID())
popupInfo.setText(localText.getText("TXT_KEY_GOTO_EUROPE_POPUP", ()))
popupInfo.setOnClickedPythonCallback("featAccomplishedOnClickedCallback")
popupInfo.setOnFocusPythonCallback("featAccomplishedOnFocusCallback")
popupInfo.addPythonButton(localText.getText("TXT_KEY_GOTO_EUROPE_POPUP_YES", ()), "")
popupInfo.addPythonButton(localText.getText("TXT_KEY_GOTO_EUROPE_POPUP_NO", ()), "")
popupInfo.addPythonButton(localText.getText("TXT_KEY_GOTO_EUROPE_POPUP_NEVER_AGAIN", ()), "")
popupInfo.addPopup(pUnit.getOwner())
Kailric Sep 14, 2009, 04:11 PM Should this function in python just be removed as it was only used when you moved your ship onto a Europe plot. Sense in WH you can send your unit to Europe from any plot this code isn't necessary and may eliminate some of the conflicts.
TC01 Sep 14, 2009, 06:48 PM Eliminating said function fixed the first python exception. However, I am still getting quite a lot of the other error, in CvMainInterface.py. That function (updateSelectionButtons) is the one that updates the buttons that appear on a unit's control panel. I've used it to make python action buttons for Civilization IV mods. So possibly the problem is related to the Wagon Train loosing the Sail to Europe command button after leaving the Home City area?
Kailric Sep 14, 2009, 07:22 PM k, Ill check the code and get back with you...
Kailric Sep 22, 2009, 10:10 AM Ok, I got some time today and I worked on this and made a few changes.
- Renamed "Sail to Europe" commands to "Travel to Home City"
- added new "Travel to Home City" and "Sail to New World" buttons
- Renamed "Europe" screen to "Home City" (You can change that to what ever it was just annoying me at the time :)
- fixed the wagon train icon in the Europe Screen, it doesn't appear huge anymore
- Your starting Colonist/Homesteaders are autoloaded into your wagon so when you first start the game you are all set to go explore the new territory
Also, I looked into the bug report you mentioned. I only made one change I think may be causing this. The Home cities mod had made some changes and when the code checked if the Unit can travel to Europe for the Command_Sail_to_Europe it checked the plot to see if it was owned by the King, but it did not add a check to see if the plot was even owned at all so sometimes the Owner could be NULL and may have been causing the crash. I don't know didly about Python errors so you will have to test this for me.
KK, let me know how goes. If no errors are reported from this last update I'll release the source code.
PS I think thats all my changes if I remember anymore or left out some files let me know.
TC01 Sep 22, 2009, 07:21 PM Everything seems to be working- the bug no longer appears either. Thanks, Kailric! :goodjob: I'll release 0.31 if no other major issues appear... I just need to hunt down a missing image for the Europe screen's "travel to New World" box.
TC01 Oct 11, 2009, 09:50 AM Well, no new bugs have been reported for v0.31. Unless there are any other issues, there won't really be any SDK stuff needed until v0.40 (which probably won't come for a while). v0.32 is going to contain some native civ expansion stuff, from drjest2000's COL Gold Mod, but if you post the source code I'll add that as well.
Kailric Oct 27, 2009, 11:01 AM Whoops, wrong code. Here is the corrected version.
TC01 Nov 19, 2009, 05:17 PM So far there are two SDK things to be done for v0.4. One is adding another new route. Androrc the Orc created a Trail Pathway (http://forums.civfanatics.com/showthread.php?t=324119) mod, and I wanted to merge it in. However, I wanted to make it work like the Railroads and Roads work- a Trail is needed for a Road, a Road is needed for a Railroad.
The second is adding new tradable yields. So far, the only new one is Gold, but there probably will be more in the future.
Kailric Dec 28, 2009, 12:08 PM Posted the wrong source code files... here is what I got http://forums.civfanatics.com/attachment.php?attachmentid=238594&d=1262023657
TC01 Dec 28, 2009, 12:36 PM Posted the wrong source code files... here is what I got http://forums.civfanatics.com/attachment.php?attachmentid=238594&d=1262023657
Thanks Kailric. I'm guessing it goes along with the five HCOM source files (CvPlayer.cpp, CvPlayerAI.cpp, CvPlot.cpp, CvUnit.cpp, and CvUnitAI.ccp) in the HCOM download here (http://forums.civfanatics.com/showthread.php?t=316165)?
Kailric Dec 28, 2009, 02:28 PM Thanks Kailric. I'm guessing it goes along with the five HCOM source files (CvPlayer.cpp, CvPlayerAI.cpp, CvPlot.cpp, CvUnit.cpp, and CvUnitAI.ccp) in the HCOM download here (http://forums.civfanatics.com/showthread.php?t=316165)?
Right, its been so long sense we worked on this I cant remember what all we changed but these new files have the only changes I have made to the SDK for this mod. I may have edited some of the HCOM changes but can't remmeber.
TC01 Dec 29, 2009, 10:22 AM Right, its been so long sense we worked on this I cant remember what all we changed but these new files have the only changes I have made to the SDK for this mod. I may have edited some of the HCOM changes but can't remmeber.
Do you still have the Westward Ho SDK set up for compiling, then? Because there are a couple of things I would like to do that would require work in the SDK for the next version. For instance, I was going to add gold as a tradable good, like is done in Plantation Economy. And I also wanted to merge your Journeyman modcomp in.
Kailric Dec 29, 2009, 03:20 PM Do you still have the Westward Ho SDK set up for compiling, then? Because there are a couple of things I would like to do that would require work in the SDK for the next version. For instance, I was going to add gold as a tradable good, like is done in Plantation Economy. And I also wanted to merge your Journeyman modcomp in.
YEah, I have everything set up still. Both those additions you mentioned would be a simple thing to do really, so just let me know when you get close to releasing the next version and I'll work on that if I haven't got it done before hand, k. Keep up the fine work.
TC01 Jan 03, 2010, 02:55 PM Another thing: I remember you talked of adding a "Railroad Route To" mission. I think there's a need for it, or at least something like it, since I've added the Trail route and increased Railroad cost for 0.4.
Currently (since I've added the Trail) if you have a Pioneer route to a location, he will make a Trail, then a Road, and then a Railroad, all on the same plot, before moving on. So I was thinking of adding two additional Route To missions, "Route To (Trails Only)" and "Route To (Roads Only)". The first would only create trails, the second would only create trails and roads, and the third, the regular Route To mission, would create all three routes at once.
Is this doable?
Kailric Apr 01, 2010, 03:24 PM K, the next upload is linked on the main page
EDIT: well I forgot one thing I was going to find a sound file for an arriving train and have it play each time a unit arrives by train just for the coolness of it. I post this here so I don't forget in the nect update.
KJ Jansson Apr 02, 2010, 08:34 AM Well, I again returned back in the CivIVColonization world.
EDIT: well I forgot one thing I was going to find a sound file for an arriving train and have it play each time a unit arrives by train just for the coolness of it. I post this here so I don't forget in the nect update.
Here the links for the Arriving and Departing old-style Trains in mp3 format.
http://dl.dropbox.com/u/5816418/ArrivingTrain.mp3
http://dl.dropbox.com/u/5816418/DepartingTrain.mp3
TC01 Apr 10, 2010, 10:46 AM After merging the changes with my modified copy of 0.33, I'm getting a CTD when I try to start a new game... the game itself starts but using either "Custom Game" or "Play Now" causes a CTD. An instantaneous CTD- I don't see the loading screens or anything.
As I said, that is my modified version. So far, I haven't actually modified much, so I might as well start with a fresh copy of Westward Ho v0.33 and see if it works with that, if I can't figure out what's wrong.
Kailric Apr 10, 2010, 12:00 PM After merging the changes with my modified copy of 0.33, I'm getting a CTD when I try to start a new game... the game itself starts but using either "Custom Game" or "Play Now" causes a CTD. An instantaneous CTD- I don't see the loading screens or anything.
As I said, that is my modified version. So far, I haven't actually modified much, so I might as well start with a fresh copy of Westward Ho v0.33 and see if it works with that, if I can't figure out what's wrong.
Hmm, did you try just my changes alone? If that works then there is a conflict with your changes and mine somewhere. I'll check the download I posted to make sure its right.
Edit: Well I tried to install the files I uploaded but got CTD as you mentioned must not have something right..let me check it out more.
Kailric Apr 10, 2010, 12:53 PM Somethings left out of that previous download so I uploaded a new version. This is the Full verion v 0.33 I am working with except for the pak files and the maps.
TC01 Apr 13, 2010, 06:23 PM Okay, your changes are working now.
However I decided to start fresh anyway, with a clean copy of v0.33. I first installed KJ Jansson's graphics changes from this thread (http://forums.civfanatics.com/showthread.php?t=343512), then your SDK changes, and the, using a backup copy of CIV4RouteModelInfos.xml, fixed the railroad bug.
One thing, though-
I remember you said that the source files you had given me earlier (and that I distributed as part of Westward Ho 0.33) weren't actually the right source files. You then posted another set of source files that were the correct ones.
Those files, however, aren't included in what you posted. Should I just add the files from this post (http://forums.civfanatics.com/showpost.php?p=8763218&postcount=37) to the ones in the latest upload? It's CvInfos.cpp, CvInfos.h, and CvTeam.cpp, to be specific.
Kailric Apr 13, 2010, 09:43 PM Okay, your changes are working now.
However I decided to start fresh anyway, with a clean copy of v0.33. I first installed KJ Jansson's graphics changes from this thread (http://forums.civfanatics.com/showthread.php?t=343512), then your SDK changes, and the, using a backup copy of CIV4RouteModelInfos.xml, fixed the railroad bug.
One thing, though-
I remember you said that the source files you had given me earlier (and that I distributed as part of Westward Ho 0.33) weren't actually the right source files. You then posted another set of source files that were the correct ones.
Those files, however, aren't included in what you posted. Should I just add the files from this post (http://forums.civfanatics.com/showpost.php?p=8763218&postcount=37) to the ones in the latest upload? It's CvInfos.cpp, CvInfos.h, and CvTeam.cpp, to be specific.
Yeah thats fine, I looked and there are no knew changes in those files. I figured out what the problem was. For some reason I used the change tag "///tk Wild West" on those older changes. All new changes have the ///---------------Kailric WestwardHo Changes--------------/// tag on it. So, if you would just replace the Wild West with the WestwardHo notation so this want happen again.
TC01 Apr 14, 2010, 07:26 PM Okay, I've gotten a Westward Ho DLL compiled with my Betray Your Colony (http://forums.civfanatics.com/showthread.php?t=355126) mod included (I thought I might as well merge it in while I was at it, and save myself from having to create another Colonization working directory).
I just finished a merge of the Forts code, but I've found a problem. I guess you added an "isSpreadCultureControl" function (and variable for it) to CvImprovementInfo... however, your source code for the Forts mod does not contain a CvInfos.cpp or CvInfos.h.
I could add that tag myself, but I have a suspicion you added more tags than just that one in Forts. Could you please post those files?
Kailric Apr 14, 2010, 08:11 PM Here are the two files. When ever I gather up the SDK source files I changed I just do a search for my trade mark , usually "///TK" or something, and then copy all those files. Problem is like this time, I didn't make any changes to the Infos files so my mark wasn't there, but I was using someone else SDK changes so the files got over looked. Anyway, I added them to the Forts page and the link to the down load is here:
http://forums.civfanatics.com/attachment.php?attachmentid=249550&stc=1&d=1271293644
TC01 Apr 14, 2010, 08:30 PM Here are the two files. When ever I gather up the SDK source files I changed I just do a search for my trade mark , usually "///TK" or something, and then copy all those files. Problem is like this time, I didn't make any changes to the Infos files so my mark wasn't there, but I was using someone else SDK changes so the files got over looked. Anyway, I added them to the Forts page and the link to the down load is here:
http://forums.civfanatics.com/attachment.php?attachmentid=249550&stc=1&d=1271293644
Thanks for those... now I've gotten up to CvGlobals.cpp, where there are a couple more errors:
1>CvGlobals.cpp(147) : error C2614: 'CvGlobals' : illegal member initialization: 'm_plotGroupFinder' is not a base or member
1>CvGlobals.cpp(345) : error C2065: 'm_plotGroupFinder' : undeclared identifier
1>CvGlobals.cpp(481) : error C2039: 'getPlotGroupFinder' : is not a member of 'CvGlobals'
1> c:\My CIV4 Mods\SDK Stuff\DLL 2 Col\CvGameCoreDLL\CvGlobals.h(116) : see declaration of 'CvGlobals'
1>CvGlobals.cpp(483) : error C3861: 'm_plotGroupFinder': identifier not found, even with argument-dependent lookup
1>CvGlobals.cpp(2783) : error C2039: 'setPlotGroupFinder' : is not a member of 'CvGlobals'
1> c:\My CIV4 Mods\SDK Stuff\DLL 2 Col\CvGameCoreDLL\CvGlobals.h(116) : see declaration of 'CvGlobals'
1>CvGlobals.cpp(2783) : error C3861: 'm_plotGroupFinder': identifier not found, even with argument-dependent lookup
1>NMAKE : fatal error U1077: '"C:/Program Files/Microsoft Visual C++ Toolkit 2003/bin/cl.exe"' : return code '0x2'
This looks like you left out a CvGlobals.h file, based on the errors.
Kailric Apr 14, 2010, 08:51 PM Thanks for those... now I've gotten up to CvGlobals.cpp, where there are a couple more errors:
1>CvGlobals.cpp(147) : error C2614: 'CvGlobals' : illegal member initialization: 'm_plotGroupFinder' is not a base or member
1>CvGlobals.cpp(345) : error C2065: 'm_plotGroupFinder' : undeclared identifier
1>CvGlobals.cpp(481) : error C2039: 'getPlotGroupFinder' : is not a member of 'CvGlobals'
1> c:\My CIV4 Mods\SDK Stuff\DLL 2 Col\CvGameCoreDLL\CvGlobals.h(116) : see declaration of 'CvGlobals'
1>CvGlobals.cpp(483) : error C3861: 'm_plotGroupFinder': identifier not found, even with argument-dependent lookup
1>CvGlobals.cpp(2783) : error C2039: 'setPlotGroupFinder' : is not a member of 'CvGlobals'
1> c:\My CIV4 Mods\SDK Stuff\DLL 2 Col\CvGameCoreDLL\CvGlobals.h(116) : see declaration of 'CvGlobals'
1>CvGlobals.cpp(2783) : error C3861: 'm_plotGroupFinder': identifier not found, even with argument-dependent lookup
1>NMAKE : fatal error U1077: '"C:/Program Files/Microsoft Visual C++ Toolkit 2003/bin/cl.exe"' : return code '0x2'
This looks like you left out a CvGlobals.h file, based on the errors.
Not even gonna try to explain that one :) I reposted the file.. just keep telling me what I missed :)
http://forums.civfanatics.com/attachment.php?attachmentid=249555&stc=1&d=1271296199
TC01 Apr 15, 2010, 03:33 PM That would appear to be it. I now have a working (well, apparently working) build of Westward Ho with Forts (and aforesaid Betray your Colony).
I'll try to get Journeyman merged in today, and then if that works, I'll release a beta of 0.4 tomorrow. It won't have any of the new or replaced yields in it, but it will have nearly everything else.
EDIT: Okay, Journeyman appears to be working too.
Kailric Apr 15, 2010, 04:54 PM That would appear to be it. I now have a working (well, apparently working) build of Westward Ho with Forts (and aforesaid Betray your Colony).
I'll try to get Journeyman merged in today, and then if that works, I'll release a beta of 0.4 tomorrow. It won't have any of the new or replaced yields in it, but it will have nearly everything else.
K, I am working on figureing out how to add yieds... and wow there is just so much you have to add or edit.. let me make a list so I don't forget.
This will be my check list:
1. Add Yield to CvYieldInfos
2. Edit SDK for the New YIELD_TYPE
3. Add Bonus Yield to CvBonusInfos
4. Add Yield Unit to CvUnitInfos
5. Add YieldClass to CvUnitClassInfos
6. Add Yield to CvTerrainInfos
7. Add new Profession and Yield to CvProfessionInfo so it can be gathered or produced
If its worked in a building
8. Add Building to CvBuildingInfo
9. Add Special building to CvSpecialBuildingInfos
10. Add Building Class to CvBuildingClassInfos
Art:
11. Need Unit Icon Art if its transportable
12. Need City Mangement Art for loading on transports
13. Need nif 3d file if its transportable
14. Need to edit GameFont75 for small City Mangement Icon for Yield
15. Need to edit GameFont for larger Civiopedia Icon for Yield
16. Need Resource Icon for City Mangement
17. Need nif 3d file for Bonus resource on world map
18. Need font image for Bonus Resource
19. Need Highlighted Resource Icon for City Mangement
20. Need Button Art for Resource
21. Need Profession Art
If its produced or consumed in Special Building
22. all the Art for Building and its buttons
23. Art for Expert Unit and its buttons
Thats all I am writing for now :sad:
Androrc the Orc Apr 15, 2010, 08:08 PM K, I am working on figureing out how to add yieds... and wow there is just so much you have to add or edit.. let me make a list so I don't forget.
This will be my check list:
1. Add Yield to CvYieldInfos
2. Edit SDK for the New YIELD_TYPE
3. Add Bonus Yield to CvBonusInfos
4. Add Yield Unit to CvUnitInfos
5. Add YieldClass to CvUnitClassInfos
6. Add Yield to CvTerrainInfos
7. Add new Profession and Yield to CvProfessionInfo so it can be gathered or produced
If its worked in a building
8. Add Building to CvBuildingInfo
9. Add Special building to CvSpecialBuildingInfos
10. Add Building Class to CvBuildingClassInfos
Art:
11. Need Unit Icon Art if its transportable
12. Need City Mangement Art for loading on transports
13. Need nif 3d file if its transportable
14. Need to edit GameFont75 for small City Mangement Icon for Yield
15. Need to edit GameFont for larger Civiopedia Icon for Yield
16. Need Resource Icon for City Mangement
17. Need nif 3d file for Bonus resource on world map
18. Need font image for Bonus Resource
19. Need Highlighted Resource Icon for City Mangement
20. Need Button Art for Resource
21. Need Profession Art
If its produced or consumed in Special Building
22. all the Art for Building and its buttons
23. Art for Expert Unit and its buttons
Thats all I am writing for now :sad:
It's more a matter of getting used to it, the only step which will repeatedly be annoying is editing the gamefont alpha.
TC01 Apr 18, 2010, 12:51 PM Everything seems to be working. I was about to release 0.4 when I discovered a bug as a result of the merger with Forts:
The button for a unit to travel from one city to another is the same as the "Assign Resources to Produce" button that appears at a Fort. Likewise, the Upgrade Fort button appears to be the Support button, and the Support button appears to be the Assign Resources to Produce button.
What file would I have screwed up to cause this?
Kailric Apr 18, 2010, 01:16 PM Everything seems to be working. I was about to release 0.4 when I discovered a bug as a result of the merger with Forts:
The button for a unit to travel from one city to another is the same as the "Assign Resources to Produce" button that appears at a Fort. Likewise, the Upgrade Fort button appears to be the Support button, and the Support button appears to be the Assign Resources to Produce button.
What file would I have screwed up to cause this?
I know that Commands in the XML have to be the same order as they are in the Enums.cpp cause I have had this problem before. Check all the orders of the Commands, Missions, etc. to be sure they are the same as in the XML. If you can't figure it out just upload it and send me the link and let me look it over too.
TC01 Apr 18, 2010, 01:39 PM I know that Commands in the XML have to be the same order as they are in the Enums.cpp cause I have had this problem before. Check all the orders of the Commands, Missions, etc. to be sure they are the same as in the XML. If you can't figure it out just upload it and send me the link and let me look it over too.
Ah- since Forts are a module, their commands in the XML will be at the bottom of the list (below the Westward Ho train command). But I had them the other way in the Enum files.
That fixed it.
Kailric Apr 18, 2010, 02:20 PM Ah- since Forts are a module, their commands in the XML will be at the bottom of the list (below the Westward Ho train command). But I had them the other way in the Enum files.
That fixed it.
Ahh, yeah didn't think about that. What if there are two or more modules with new commands? How does the ordering go then you think. Alphabetically according to module maybe?
TC01 Apr 18, 2010, 03:11 PM Ahh, yeah didn't think about that. What if there are two or more modules with new commands? How does the ordering go then you think. Alphabetically according to module maybe?
I would guess so, assuming it loads modules alphabetically (and I don't know how else it would load them).
But I think for commands it might be better not to use modules, since if you remove the module you'll remove the command from the XML, but you can't remove the command from the DLL.
|
|