Feature request: Would it be possible to show the length of the train in the template-creation window?
A really nice patch, I've been wanting something like this for a while. Thanks for making it!

Moderator: OpenTTD Developers
Seems like something outside of my patch from the first glance.FooBar wrote:Tried building again, after trowing out my local source copy and checking out a new one. Clean OpenTTD worked. After applying the 0.1b patch I get this warning:7>d:ttdopenttdtrunk.hgsrcvehicle.cpp(814): warning C4800: 'OrderDepotActionFlags' : forcing value to bool 'true' or 'false' (performance warning)
This is bad. From the first look of it, it seems like the linker errors are concerned with all the entry points to functions provided by the patch.And more worryingly these errors:7>Link:
7> Creating library D:TTDOpenTTDtrunk.hgprojects..objsWin32Debugopenttd.lib and object D:TTDOpenTTDtrunk.hgprojects..objsWin32Debugopenttd.exp
7>vehicle.obj : error LNK2019: unresolved external symbol "struct TemplateReplacement * __fastcall GetTemplateReplacementByGroupID(unsigned short)" (?GetTemplateReplacementByGroupID@@YIPAUTemplateReplacement@@G@Z) referenced in function "void __fastcall VehicleEnteredDepotThisTick(struct Vehicle *)" (?VehicleEnteredDepotThisTick@@YIXPAUVehicle@@@Z)
7>vehicle.obj : error LNK2019: unresolved external symbol "class CommandCost __fastcall CmdTemplateReplaceVehicle(struct Train *,bool,enum DoCommandFlag)" (?CmdTemplateReplaceVehicle@@YI?AVCommandCost@@PAUTrain@@_NW4DoCommandFlag@@@Z) referenced in function "void __fastcall CallVehicleTicks(void)" (?CallVehicleTicks@@YIXXZ)
7>vehicle.obj : error LNK2019: unresolved external symbol "class CommandCost __fastcall TestBuyAllTemplateVehiclesInChain(struct Train *)" (?TestBuyAllTemplateVehiclesInChain@@YI?AVCommandCost@@PAUTrain@@@Z) referenced in function "void __fastcall CallVehicleTicks(void)" (?CallVehicleTicks@@YIXXZ)
7>group_gui.obj : error LNK2019: unresolved external symbol "void __fastcall ShowTemplateReplaceWindow(unsigned short,unsigned int,struct VehicleListIdentifier,class GUIList<struct Vehicle const *,char const *> *,unsigned char,int)" (?ShowTemplateReplaceWindow@@YIXGIUVehicleListIdentifier@@PAV?$GUIList@PBUVehicle@@PBD@@EH@Z) referenced in function "public: virtual void __thiscall VehicleGroupWindow::OnDropdownSelect(int,int)" (?OnDropdownSelect@VehicleGroupWindow@@UAEXHH@Z)
7>group_cmd.obj : error LNK2019: unresolved external symbol "short __fastcall deleteIllegalTemplateReplacements(unsigned short)" (?deleteIllegalTemplateReplacements@@YIFG@Z) referenced in function "class CommandCost __fastcall CmdDeleteGroup(unsigned int,enum DoCommandFlag,unsigned int,unsigned int,char const *)" (?CmdDeleteGroup@@YI?AVCommandCost@@IW4DoCommandFlag@@IIPBD@Z)
7>afterload.obj : error LNK2019: unresolved external symbol "void __fastcall AfterLoadTemplateVehicles(void)" (?AfterLoadTemplateVehicles@@YIXXZ) referenced in function "bool __fastcall AfterLoadGame(void)" (?AfterLoadGame@@YI_NXZ)
7>saveload.obj : error LNK2001: unresolved external symbol "struct ChunkHandler const * const _template_vehicle_chunk_handlers" (?_template_vehicle_chunk_handlers@@3QBUChunkHandler@@B)
7>saveload.obj : error LNK2001: unresolved external symbol "struct ChunkHandler const * const _template_replacement_chunk_handlers" (?_template_replacement_chunk_handlers@@3QBUChunkHandler@@B)
7>saveload.obj : error LNK2001: unresolved external symbol "struct Pool<struct TemplateVehicle,unsigned short,512,65536,1,0,1> _template_pool" (?_template_pool@@3U?$Pool@UTemplateVehicle@@G$0CAA@$0BAAAA@$00$0A@$00@@A)
7>D:TTDOpenTTDtrunk.hgprojects..objsWin32Debugopenttd.exe : fatal error LNK1120: 9 unresolved externals
7>
7>Build FAILED.
Yes, this was in my mind as well, I'll put it in the list.FLHerne wrote:I've been playing with it and some other patches for a while, and haven't found any obvious problems.
Feature request: Would it be possible to show the length of the train in the template-creation window?
Code: Select all
extern const ChunkHandler _template_replacement_chunk_handlers[] = {
{'TMPL_RPLS', Save_TMPL_RPLS, Load_TMPL_RPLS, NULL, NULL, CH_ARRAY | CH_LAST},
};
Code: Select all
extern const ChunkHandler _template_vehicle_chunk_handlers[] = {
{'TMPLS', Save_TMPLS, Load_TMPLS, Ptrs_TMPLS, NULL, CH_ARRAY | CH_LAST},
};
Code: Select all
GUITemplateList::SortFunction *template_sorter_funcs[];
Code: Select all
GUITemplateList::SortFunction **template_sorter_funcs;
Did you forgot to re-generate the project files before compiling?FooBar wrote:Tried building again, after trowing out my local source copy and checking out a new one. Clean OpenTTD worked. After applying the 0.1b patch I get this warning:And more worryingly these errors:7>d:ttdopenttdtrunk.hgsrcvehicle.cpp(814): warning C4800: 'OrderDepotActionFlags' : forcing value to bool 'true' or 'false' (performance warning)7>Link:
7> Creating library D:TTDOpenTTDtrunk.hgprojects..objsWin32Debugopenttd.lib and object D:TTDOpenTTDtrunk.hgprojects..objsWin32Debugopenttd.exp
...
7>D:TTDOpenTTDtrunk.hgprojects..objsWin32Debugopenttd.exe : fatal error LNK1120: 9 unresolved externals
7>
7>Build FAILED.
Shouldn't there be compilation errors before it even gets to link anything when it was missing source files ?Zuu wrote:Did you forgot to re-generate the project files before compiling?FooBar wrote:Tried building again, after trowing out my local source copy and checking out a new one. Clean OpenTTD worked. After applying the 0.1b patch I get this warning:And more worryingly these errors:7>d:ttdopenttdtrunk.hgsrcvehicle.cpp(814): warning C4800: 'OrderDepotActionFlags' : forcing value to bool 'true' or 'false' (performance warning)7>Link:
7> Creating library D:TTDOpenTTDtrunk.hgprojects..objsWin32Debugopenttd.lib and object D:TTDOpenTTDtrunk.hgprojects..objsWin32Debugopenttd.exp
...
7>D:TTDOpenTTDtrunk.hgprojects..objsWin32Debugopenttd.exe : fatal error LNK1120: 9 unresolved externals
7>
7>Build FAILED.
Run projectsgenerate.vbs to re-generate all the Visual Studio project files so that the new source files get included in the project.
What do you mean with autorenew ? The replacement as it is done by the patch right now or the autorenew feature where the game just replaces a vehicle by a newer one of the same type ?Wowanxm wrote:ffpp, thank you for your undertaking!
Another feature request: would it be possible to order template based autorenew for current train/group of trains at the specific depot?
Not necessarily. When you include .h files that aren't in the project, the compiler will not complain as long as the file exist. The .h file will give all information needed to compile some source file that call methods or use types that are declared in the .h file. However as the corresponding .cpp file is not included in the project, the implementation of those methods are never compiled and the linker will thus not find them when trying to connect the different code blocks.ffpp wrote:Shouldn't there be compilation errors before it even gets to link anything when it was missing source files ?
No, you didn't. If somebody offended it's probably me.Ottomobeale wrote:Sorry if I offended.
Did I say this ?Ottomobeale wrote:Sorry if I offended.
It would just be nice to have the ability to define this in road vehicles like the OP describes in this thread:
If cargo = type x, type y, type z then replacement vehicle = vehicle xx and refit accordingly.
If cargo = type a, type b, type c then replacement vehicle = vehicle yy and refit accordingly.
Yes, I mean autoreplacement exactly as it is done.ffpp wrote:What do you mean with autorenew ? The replacement as it is done by the patch right now or the autorenew feature where the game just replaces a vehicle by a newer one of the same type ?Wowanxm wrote:Another feature request: would it be possible to order template based autorenew for current train/group of trains at the specific depot?
[/quote]It would be great to let the player choose in what depot ro to replace train.ffpp wrote:My guess would be the former, and it should be very well doable to replace all trains only in a specific depot. But it sounds more like a bit of more advanced feature and would be further down the list for now.
Users browsing this forum: Baidu [Spider] and 22 guests