Trade Route Screens, Tutorials, Questions, etc.

Ok, I did that. I have noticed another couple bugs I am addressing at the moment so I'll be posting another update soon. When Nightinggale updated the CIVICOPTIONS_INVENTIONS it revealed a couple or so bugs I had, so now I can fix them. Thanks Nightinggale :goodjob:

Also, I am adding code so that if the player does not have an active trade route prices want adjust. This was the rule before but it needed updated with the new Trade Screen system.

So, now the code will check every route possible. If it is not an bAIRoute and it bRequiresTech then it checks to see if that route is discovered yet. If no routes are discovered then prices want start to adjust.

Also, I made it so when you discover a Trade Screen the button appears on that turn instead of the next.

Edit: Ok, the files are Pushed to git
 
Ok so it looks like I have messed something up somewhere...

I followed the tutorial, but when I loaaded the game I had no interface! :D

So I have probably screwed up something in the python, ah wait, maybe python exceptions are not on for Col. let's go check that....

Ok, here is what to do. Attempt to follow the tutorial and add a new Trade Screen to a current M:C. If you are not successful post me your Python and XML files and I will check them myself. I have to head to work so want be back till later on, but I can still check these forums from my phone so I'll be in touch.
 
Ok so I got the python error fixed, I had a couple of lines that i copy pasted without changing them... whoops!

Now I have this assert, it is probably once again my fault but I am not yet sure how :D SO!

Assert Failed
File: CvGlobals.cpp
Line: 3769
Expression: strcmp(szType, "NONE")==0 || strcmp(szType, "")==0
Message: info type EUROPE_WEST not found, Current XML file is: xml\Units/CIV4FormationInfos.xml

There was a 'ship' travel button appeared in the top right corner of the game screen, so obviously me being a curious monkey I clicked it!
 
Ok so I got the python error fixed, I had a couple of lines that i copy pasted without changing them... whoops!

Now I have this assert, it is probably once again my fault but I am not yet sure how :D SO!

Assert Failed
File: CvGlobals.cpp
Line: 3769
Expression: strcmp(szType, "NONE")==0 || strcmp(szType, "")==0
Message: info type EUROPE_WEST not found, Current XML file is: xml\Units/CIV4FormationInfos.xml

There was a 'ship' travel button appeared in the top right corner of the game screen, so obviously me being a curious monkey I clicked it!

EUROPE_WEST is no longer a valid value in M:C so you must have an old reference to it in your files, your new Trade Screen perhaps. Do a search for EUROPE_WEST.
 
what files are new on the git version, I am assuming it is a new .dll, that one is easy. is there any python or other updates taht I need to grab, I am still not up to scratch with git so I am crap at identifying new changes and such!

Assets\CvGameCoreDLL.dll
DLL_Sources\CvPlayer.cpp
DLL_Sources\CvPlayer.h
DLL_Sources\CvPlot.cpp
DLL_Sources\JustInTimeArray.h
Assets\XML\GameInfo\CIV4EuropeInfo.xml

These are the lastest changed files. I Changed some today and Nightinggale had changed some recently as well.

I just now realized I left out a part of the tutorial. You will also need to edit your new Copy of the Trade Screen. Say you copied CvSpiceRouteScreen.py, you will need to go to the line below and change it to your newlly added EuropeType from the CIV4EuropeInfos. If you just add your new EuropeType and replace the part in red it may work.

Code:
#TradeScreen Code
		self.TRADE_SCREEN_SPICE_ROUTE_MARKET = CvUtil.findInfoTypeNum('[COLOR="Red"]TRADE_SCREEN_SPICE_ROUTE_MARKET[/COLOR]')

Edit: Also, I haven't worked with the old CVEuropeScreen much lately so it may be best to use CvSpiceRouteScreen instead. The two screens function similar but it may be easier to mod the spice route.
 
yeah I have obviously screwed up some part of the merge with the master from the git...

I tried to fix it but I broke it even more :D I think Iknow sort of what broke it, but not really waht is the right combination to fix it.

I think at this point I will just wait for you to release the new non git version and download everything clean, then I know for definate that everything is right before I start messing with it, and I haven't half merged something...

It'll be much easier for my poor head I think! (which is not feeling very file savvy at the minute...)

Then I can redo the tutorial and bask in the glory of a new trade screen :D

Especially if you are still tweaking the git version.

The tutorial does seem to be working fine though, I just have something that I screwed up in the files that is throwing it out of whack, I could add the new travel tiles and send someone there. It was just the screen that went all out of whack!

Anyway I shall patiently wait for the next full release before I start hammering again! Unless my brain improves, but the developments are all very exciting, and I do have a slightly better understanding of things now! :D

Edit:
Yes I think I did both of those things, and I think I worked from the spice route.

I may try again to do it if my brain feels more up to the task of keeping track of what I am doing!

I got pretty close to a new functioning trade screen! :D

I think my problem lies in mismerging the git stuff with the other bits of needed assets from the full version, and over riding something new with something old.

So I am gonna stop and then come back at it again from scratch another day when I have reworked up the umph to start from the beginning, or jsut wait fro the new git version to be released as the next Full Release.
 
I think at this point I will just wait for you to release the new non git version and download everything clean, then I know for definate that everything is right before I start messing with it, and I haven't half merged something...

Well, you can do like I do sometimes. Just delete your current git M:C version and repull a new one :)

Did you notice my edit of my previous post where I had forgot to add a part to the Tutorial. I'll fix up the tutorial when I get the chance I need to add in more details about the trade screen itself, like how to change up the graphics and such. If you can reinstall the git version and attempt the tutorial that would be very helpful. If it doesn't work you can summit your files and I'll look them over.
 
Yes I did, I found the 'missed' step, through python exceptions and fixed that (I think), I am fairly certain that the tutorial does work, I have just worn myself out for today :D

Yeah I plan to pretty much delete my current go and start all over again from scratch, that just takes umph! Especially since you just did that update :D

Probably Sunday or Monday I will give it another go and be able to report back!
 
Success! Sort of...

My report:

1. It doesn't explode!

2. You need that last 'missing step' for the new tradescreen.xml (but you is all over that)

3. Cosmetics: it would be helpful to have either a tutorial about how to change the cosmetics of the screen, or a link at the end of the tutorial to another tutorial for this if it already exists. I know it requires the changing of widgets and such, but as yet I don't know how all that works together and how I would go about changing it. Currently I do not know whether my new screen is just a 'shortcut' to the spice route screen, or simply an exact clone of the spice route screen...

4. There may be some interface issues that are getting tangled up some how.
Example, in my new screen (that looks exactly like spice route) it has the 'switch to trade screens' buttons at the top, but when I use these it takes me to the next trade screen (Immigration or Silk) but then the 'switch to' buttons are no longer at the top of the screen, so i go to one and then cannot switch back to another.
Also I can't remember if you are supposed to be able to access the silk road screen before it is discovered, this might be part of the glitch..

So in summary I have successfully added a new screen, but it has a number of glitches about it and looks exactly like the spice route, so it is essentially an unfinished new trade route! :D

but it is exciting!
 
Oh no :D I haven't modded a thing :D Well not quite..

I have just been learning to add a new trade screen through Kail's new tutorial, that uses his new dll changes to make adding a new trade screen a purely python/xml job. The report is simply the results of that tutorial, and what is currently missing from making a completely successful new screen.

It is only displaying my complete lack of Col modding knowledge :D

I still can't use git :D trying to learn it just makes my head hurt!

This work is just successfully replicating that which has already been done. i.e. add another trade screen and make it unique.

So far I haven't made it unique! (I need to learn how to do that next :D)
 
Another thing I have noticed with using the spice route as the base for the code, that the 'leave port' button doesn't let my peddler leave the trade screen, so I am thinking that it is only 'meant' for ships, which is then causing problems for getting my land guys back.

Would it be possible to create a route that allows both land and sea?

haha! I successfully changed the colour of the screen, so it is definately pointing to my new one. The 'jump to' buttons I still have to understand, and find where the screen name is handled to get it to say something other than Spice Route..
 
Success! Sort of...

My report:

1. It doesn't explode!

No, but mine did!! Ha, ha, jk:p
3. Cosmetics: it would be helpful to have either a tutorial about how to change the cosmetics of the screen, or a link at the end of the tutorial to another tutorial for this if it already exists. I know it requires the changing of widgets and such, but as yet I don't know how all that works together and how I would go about changing it. Currently I do not know whether my new screen is just a 'shortcut' to the spice route screen, or simply an exact clone of the spice route screen...

Yep, all over that first chance I get. Cosmetics are quite easy actually compared to just getting the screen working.
4. There may be some interface issues that are getting tangled up some how.
Example, in my new screen (that looks exactly like spice route) it has the 'switch to trade screens' buttons at the top, but when I use these it takes me to the next trade screen (Immigration or Silk) but then the 'switch to' buttons are no longer at the top of the screen, so i go to one and then cannot switch back to another.
Also I can't remember if you are supposed to be able to access the silk road screen before it is discovered, this might be part of the glitch..

Right, I'll have to explain the "switch to trade screen" buttons. They are coded into each Python Trade Screen separately but can be easily modded. However, I think I can build a generic code that uses XML settings to place those buttons as well as Trade Screen button placement on the main menu. We would probably need to dedicate an area of the screen to Trade Screens alone. Right now they are at the end of the other buttons and room is limited, so maybe we can move them to another area, think on that while you test.

Another thing I have noticed with using the spice route as the base for the code, that the 'leave port' button doesn't let my peddler leave the trade screen, so I am thinking that it is only 'meant' for ships, which is then causing problems for getting my land guys back.

Would it be possible to create a route that allows both land and sea?

This is actual a limitation of Units inability to move on specific land types. As, Peddlers can not walk on water. Right now TradeScreen plots are assigned to either land or water but not both. I'll have to look into adding this as an option so that they can get assigned to Land and Water, that's a good idea and I believe it will be an easy addition.

Thanks so much for your help in pointing out these issues.
 
I figured you were working on it :D

Yes a land and sea setting would be very helpful for my plans, as I plan to make trade centres accesible by both.

I could probably work out the cosmetics stuff with enough time and headaches, but KNOWING how to do it would be much nicer for me :D

I am always in favour of Xml code :D I find it much harder to break and much easier to fix :D

I have been trying to think in my head about what a 'full' MC screen looks like, with everything unlocked and censures active and such, for space... maybe down the right hand side, in one or two columns, that would give space for probably at least 20 trade screens, can't see anyone needing anymore than that!! :D
It also shouldn't get in the way of any other displays or info... perhaps even a little box could be made to hold them all, that could be changed with a bg pic, to allow it to be customised for whatever HUD style the mod requires. That would probably only be good for mods with a lot of trade screens though so probably scratch that last statement!
 
I am always in favour of Xml code :D I find it much harder to break and much easier to fix :D
Me too. Once code is written and tested, it should just stay working if nobody touches it. Having a design to minimize the need to modify code (python or C++) is preferable from a code stability point of view. I also suspect that it is the best choice in terms of man hours invested in each feature.
 
Well, I managed set it up so you can configure the Domain type of the Route. You now have to select what Domain your route will be or use both Land and Sea. In my initial tests I was able to send both a Kogge and a Peddler on the Spice Route:goodjob:

If I get the chance tomorrow I'll fix it up so the quick Trade Screen links auto appear. Also, what I think I will do next actually is fix the Vikings so they can be played. I have been watching the History Channel's Viking series and it has me fired up about them:D

Ragnar is the main character in the show and at the beginning he answers to an "Earl" and must give most of the treasure he finds to him. So, if their version of history is correct a "Viking King" would make sense. I can thus make the Vikings play out much like vanilla with the King requests, at least till I mod something different. That way we can have Leaders that have a "Europe" to sale to right from the start. This should help the 2071 mod also.

Hmm, actually I think all you would have to do for 2071 now is remove the tech requirements for the Spice Route and it will appear right from the start and work the same as the old Europe screen, then just mode the cosmetics. Anyway, I still need to adjust the Vikings so they are playable.

You can watch all 9 episodes of the Viking series on the History channel now until Feb 27. After that I think they take it off because the new season starts.
 
Yeah vikings was awesome, I have it on lovefilm instant and it was great :D I think a king would work just fine with the vikings, as you say they have to pay tributes etc. to their Jarls, and Jarls pay the king. So you would essentially play a Jarl and yo would have to pay your tribue to the King for everything you earn. Some kind of raiding mechanic would be good for the vikings, like evey unit they kill they get money or something, that would be fun :D

In regard to the routes, yes you can just remove the tech need and it is instantly available, this is what happened with my new route, I still need to add a tech requirement, but at medi times my zone would already be open probably.

I am really looking forward to multiple zones appearing in 2071, I just started playing it, and it talks about all these price fluctuations in the various 'earth' zones, but you can only access one. So the ability to go to each to get the best prices on particular goods would be a great addition I think! Even perhaps giving the rare oppurtunity to make a little extra cash doing some inter-earth trading :D.

Were you able to get both your kogge and peddler back to the game map? That is where it broke for me. If you did manage to solve that then Yippee! I look forward to getting my grubby monkey paws on it!
 
but at medi times my zone would already be open probably.

That's the thing about trade routes, like the silk road was open for thousands of years but few Medieval Europeans actually new about it, thus it needs to be discovered by them.

Were you able to get both your kogge and peddler back to the game map? That is where it broke for me. If you did manage to solve that then Yippee! I look forward to getting my grubby monkey paws on it!

Yep, they both made it back just fine:cool:
 
Yes, I do love the discoverable switch for the trade zones, it makes them really cool! Eventually I will be having lots of fun with them :D

Hooray the intrepid kogge and peddler! This will be an very needed feature for my mod cheers!

I was wondering, do you have any design documents that show the order of your techs?
When I looked at them in the code I don't think they were in a step by step order, I think they might have been a bit muddled?

I am thinking my next job will be putting your techs into the tech tree, like in 2071 (I think I am right in saying MC does not have one yet? Only the code to do it)

I need to do it so I can see what techs there are so I can start designing forwards and backwards from it to create the stone and bronze age and the colonial and industrial ages..

I will need a tech tree so I can keep it all organised!! :D
 
Top Bottom