-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
enable the pioneer to build a "road" to the selected point. #427
Comments
Adding the "good first issue" label since this is fairly easy to do and may serve as an intro to WTP modding. |
@ErikSandbraaten I have spent tons of hours thrown into the deep end of clinking lists and headless nodes trying to resolve this issue; but all I have come up with is the simple changes that causes a pioneer to build the 'route to' as a basic road only, and never any of the other road types. Any clues on where I might not be looking? |
Trying to remember what I had in mind, it's been a while... Here's one possible way to do it: add a new mission (e.g. MISSION_ROUTE_TO_ROAD) and a new property which indicates the road to build to CIV4MissionInfos. |
@ErikSandbraaten , @Ramstormp |
@Ramstormp Then we others could take a look and suggest improvements. You do not necessarily need to do it all alone if you run out of ideas. |
@ErikSandbraaten, @raystuttgart, The Westward Ho mod has a 3-way 'road to' system which I started copying over, but ran out of motivation to finish at the time. I am not completely sure the implementation there is the nicest one though - some of it looked a little clumsy, but at least it works.. I think. So after I had copied it over I was hoping to polish it once I completely understood how it ought be done. The graphics also needs to be different, since it was build trail/road/railroad to images in Westward Ho. So we would need one for country road and one for plastered country road. |
Graphics are no problem, I can always easily create new better buttons. |
While debugging I stumbled upon a more generic way to accomplish this. Rather than cluttering the UI with additional buttons we could add actions to the right click menu. |
do you propose to "hang" the construction of three types of roads on one button (when you press the button, three more buttons will appear)? Or use right click? |
…e-the-People-civ4col-mod#427) [2 - use files made by Schmiddie, still crashing]
…427) [2 - use files made by Schmiddie, still crashing]
…e-the-People-civ4col-mod#427) [3 - revert special char changes in CvGameTextMgr.cpp]
…427) [3 - revert special char changes in CvGameTextMgr.cpp]
I am stuck with a crash I cannot locate due to lack of a working debugging environment. If someone wants to have a look at what I did, it is in the "route_to" branch. Otherwise I think I'm giving up on this. |
… point (We-the-People-civ4col-mod#427) [3 - revert special char changes in CvGameTextMgr.cpp]" This reverts commit 5b93de7.
… point (We-the-People-civ4col-mod#427) [2 - use files made by Schmiddie, still crashing]" This reverts commit b55d16e.
… point (We-the-People-civ4col-mod#427) [1] - still crashes!" This reverts commit 659e7fa.
… point (We-the-People-civ4col-mod#427) [1] - still crashes!" This reverts commit 6c7a66e.
…e-the-People-civ4col-mod#427) [2 - use files made by Schmiddie, still crashing]
…e-the-People-civ4col-mod#427) [3 - revert special char changes in CvGameTextMgr.cpp]
… point (We-the-People-civ4col-mod#427) [3 - revert special char changes in CvGameTextMgr.cpp]" This reverts commit 5b93de7.
… point (We-the-People-civ4col-mod#427) [2 - use files made by Schmiddie, still crashing]" This reverts commit b55d16e.
…e-the-People-civ4col-mod#427) [2 - use files made by Schmiddie, still crashing]
…e-the-People-civ4col-mod#427) [3 - revert special char changes in CvGameTextMgr.cpp]
… point (We-the-People-civ4col-mod#427) [3 - revert special char changes in CvGameTextMgr.cpp]" This reverts commit 5b93de7.
… point (We-the-People-civ4col-mod#427) [2 - use files made by Schmiddie, still crashing]" This reverts commit b55d16e.
… point (We-the-People-civ4col-mod#427) [1] - still crashes!" This reverts commit 659e7fa.
… point (We-the-People-civ4col-mod#427) [1] - still crashes!" This reverts commit 6c7a66e.
* Implement: enable the pioneer to build a road to the selected point (#427) [1] - still crashes! * Revert "Implement: enable the pioneer to build a road to the selected point (#427) [1] - still crashes!" This reverts commit 0bc491f. * Implement: enable the pioneer to build a road to the selected point (#427) [1] - still crashes! * Implement: enable the pioneer to build a road to the selected point (#427) [2 - use files made by Schmiddie, still crashing] * Implement: enable the pioneer to build a road to the selected point (#427) [3 - revert special char changes in CvGameTextMgr.cpp] * Implement: enable the pioneer to build a road to the selected point (#427) [4] * Implement: enable the pioneer to build a road to the selected point (#427) [5] * Implement: enable the pioneer to build a road to the selected point (#427) [6] * Implement: enable the pioneer to build a road to the selected point (#427) [7]
Done :) |
…col-mod#427) (We-the-People-civ4col-mod#820) * Implement: enable the pioneer to build a road to the selected point (We-the-People-civ4col-mod#427) [1] - still crashes! * Revert "Implement: enable the pioneer to build a road to the selected point (We-the-People-civ4col-mod#427) [1] - still crashes!" This reverts commit 0bc491f. * Implement: enable the pioneer to build a road to the selected point (We-the-People-civ4col-mod#427) [1] - still crashes! * Implement: enable the pioneer to build a road to the selected point (We-the-People-civ4col-mod#427) [2 - use files made by Schmiddie, still crashing] * Implement: enable the pioneer to build a road to the selected point (We-the-People-civ4col-mod#427) [3 - revert special char changes in CvGameTextMgr.cpp] * Implement: enable the pioneer to build a road to the selected point (We-the-People-civ4col-mod#427) [4] * Implement: enable the pioneer to build a road to the selected point (We-the-People-civ4col-mod#427) [5] * Implement: enable the pioneer to build a road to the selected point (We-the-People-civ4col-mod#427) [6] * Implement: enable the pioneer to build a road to the selected point (We-the-People-civ4col-mod#427) [7]
… point (We-the-People-civ4col-mod#427) [2 - use files made by Schmiddie, still crashing]" This reverts commit b55d16e.
jo-oe wrote in #823: (Unfortunately I'm unable to do this myself as I cannot debug Windows applications on my system.)"_ can someone help him complete this task? |
@MrZorG33 We could add a context menu like (probably triggered by a right-click): Which would allow the player to select the road type |
Even better if we can trigger it after pressing the button I suppose :P |
Ok, I did actually (and unexpectedly) find a bit of time today for looking into this again: Stupid pioneers did not give the game that information though when they were asked "are you finished" on the last plot. That is why the last plot always had the simple road. It was not easy to find this, and to find the game logic telling the game about the different road types and them depending on the simple road. It was actually hardcoded in CvPlot::canBuild ... and probably not exactly doing what was intended, as the three levels were not each based on the lower but 0->1, then 1->2 or 1->3. Well, now it mostly works, only the pioneers will not build the road on the target plot anymore. Maybe they are disappointed that their marketing offers are rejected and stop fulfilling the contract. Evil capitalists! tl,dr: I'm still working on it. Give me a little more time. But I don't know when I will find this time, as I'm going on night shift again now ... |
It should be working now. Sometimes pioneers are probably victims of the routing problems in "new movement system" if that is enabled. Country road (level 2) is not as reliably built as the level 1 and level 3 (sometimes missing on the last plot) |
I have no idea about the displaying of required turns, which is wrong anyways as those are the turns required for moving, not for building the road. Anyways, I have now spent around 10 hours of work on this feature @MrZorG33 asked me to implement. I think it works sufficiently well to be used. I even managed to sort the buttons. And now I have no further motivation at all to work on it, neither on the optical aspects nor on the question of a menu. |
I also adjusted it a bit now. It is definitely possible to build now, Roads, Country Roads and Plastered Roads to a plot. Still I think it is done. |
…ds" as "PLASTERED_ROADS". (Will at some point also correct referencing of "Plastered Roads" as "Railroads".)
hotkey, for example, Ctrl + R.
in the early stages of the game, this will be in demand.
now he can only build a "plastered road".
The text was updated successfully, but these errors were encountered: