SDK changes

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.
 
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.
 
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!
 
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.
 
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.
 
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.
 
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:

Code:
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:

Code:
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.

Code:
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))):
					[COLOR="Red"]if (not pUnit.isAutomated() and pUnit.canDoCommand(CommandTypes.COMMAND_SAIL_TO_EUROPE, UnitTravelStates.UNIT_TRAVEL_STATE_TO_EUROPE, -1, false)):[/COLOR]
						popupInfo = CyPopupInfo()
						popupInfo.setButtonPopupType(ButtonPopupTypes.BUTTONPOPUP_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())
 
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?
 
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.
 

Attachments

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.
 
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.
 
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 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.
 
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?

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.
 
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.
 
Back
Top Bottom