Patch: Partial refit
Moderator: OpenTTD Developers
Re: Patch: Partial refit
One situation where this could be useful is different liveries. E.g the DBSetXL can refit closed wagons to "Goods (piece goods)" and "Goods (beer)" with different liveries but otherwise same cargo, which might create some aesthetically interesting sets, instead of monotonous boring trains.
Re: Patch: Partial refit
Patch updated; the bug reported by Kogut is now fixed and the code is more clean now. You can find the updated diff and win32 binary at the first post.
Spanish translation of OpenTTD
Extended heightmaps
Have fun, don't quarrel too much and add as many advanced settings as you can.
Extended heightmaps
Have fun, don't quarrel too much and add as many advanced settings as you can.
- andythenorth
- Tycoon
- Posts: 5658
- Joined: 31 Mar 2007 14:23
- Location: Lost in Music
Re: Patch: Partial refit
to me that just emphasises the need for rv-wagonsTerkhen wrote:No, because in some cases it is impossible to display all the cargos at once. For example, check the refit window for the Ishizuchi Industrial Tram (HEQS) running with FIRS
FIRS Industry Replacement Set (released) | HEQS Heavy Equipment Set (trucks, industrial trams and more) (finished)
Unsinkable Sam (ships) (preview released) | CHIPS Has Improved Players' Stations (finished)
Iron Horse ((trains) (released) | Termite (tracks for Iron Horse) (released) | Busy Bee (game script) (released)
Road Hog (road vehicles and trams) (released)
Unsinkable Sam (ships) (preview released) | CHIPS Has Improved Players' Stations (finished)
Iron Horse ((trains) (released) | Termite (tracks for Iron Horse) (released) | Busy Bee (game script) (released)
Road Hog (road vehicles and trams) (released)
Re: Patch: Partial refit
New update!
The selection code has been completely revamped: it now works correctly under RTL languages and also allows to select vehicles in any direction. The code has also been cleaned up. I still have to test if there are any problems with refittable dual headed engines. The link to the patches and an updated win32 binary can be found at the first post.
I still have the sensation that this patch might fail under some conditions (maybe with some NewGRFs). Any feedback (even mentioning under which NewGRFs it has been tested successfully) will be helpful.
The selection code has been completely revamped: it now works correctly under RTL languages and also allows to select vehicles in any direction. The code has also been cleaned up. I still have to test if there are any problems with refittable dual headed engines. The link to the patches and an updated win32 binary can be found at the first post.
I still have the sensation that this patch might fail under some conditions (maybe with some NewGRFs). Any feedback (even mentioning under which NewGRFs it has been tested successfully) will be helpful.
Spanish translation of OpenTTD
Extended heightmaps
Have fun, don't quarrel too much and add as many advanced settings as you can.
Extended heightmaps
Have fun, don't quarrel too much and add as many advanced settings as you can.
-
- Tycoon
- Posts: 1828
- Joined: 10 Jul 2006 00:43
- Location: Spain
Re: Patch: Partial refit
Nice patch!
It's awesome if You want a train with different liveries.
It's awesome if You want a train with different liveries.
- Attachments
-
- Screenshot.
- reffit_better.png (18.38 KiB) Viewed 2089 times
Sorry if my english is too poor, I want learn it, but it isn't too easy.
- [list][*]Why use PNG screenshots in 8 bpp games.
[*]Caravan site New Industry. · Spain set. · Some spanish trains for locomotion[*]Favourites:GRVTS · ECS · FIRS
Re: Patch: Partial refit
Do you think that the refit window should stay opened after doing a partial refit? IMO it makes sense to suppose that the user is going to do more refits after that one.
Did anyone find problems while doing partial refit of articulated engines?
Did anyone find problems while doing partial refit of articulated engines?
Spanish translation of OpenTTD
Extended heightmaps
Have fun, don't quarrel too much and add as many advanced settings as you can.
Extended heightmaps
Have fun, don't quarrel too much and add as many advanced settings as you can.
Re: Patch: Partial refit
Is this trains only? Or are articulated road vehicles also supported?
Re: Patch: Partial refit
It does now, although it has not been tested much. Diffs and binary updated in the first post.
I'll have to look at some nice way of unduplicating the road vehicle/train code, but for now further testing should be nice.
I'll have to look at some nice way of unduplicating the road vehicle/train code, but for now further testing should be nice.
Spanish translation of OpenTTD
Extended heightmaps
Have fun, don't quarrel too much and add as many advanced settings as you can.
Extended heightmaps
Have fun, don't quarrel too much and add as many advanced settings as you can.
Re: Patch: Partial refit
Just tried a simple case. Seems to be working, even nicer than I thought. NARS2 has several 'wood' wagons, and I could switch between them without loosing the loaded cargo.
- After opening the window, the bottom panel displays a refit cargo + price without having anything selected.
- Perhaps select everything instead of nothing? It makes it more clear the refit is for the whole train.
- Clicking right of the train disables selected vehicles, while clicking left of the train selects the first vehicle
- Perhaps add an explicit way to disable a selection? (clicking right of the train is typically not the first thing you'd try). It is also not mentioned in the tool tip.
- The tooltip at the refits is imcomplete. It says 'click to select a cargo' which I did after selecting a vehicle. Nothing was refit.
- You could enable the refit button only after selecting a refit.
- Closing the window after a refit is annoying. Possibly also because I didn't find the drag feature at first, so I needed to refit the same train several times.
- If you don't close the window automatically, perhaps a 'close' button might be useful??
- Being able to drag is nice, but I am not sure it is good here. I expected to drag the vehicle to another position at first. Perhaps clicking at a wagon could toggle its selection instead.
- After opening the window, the bottom panel displays a refit cargo + price without having anything selected.
- Perhaps select everything instead of nothing? It makes it more clear the refit is for the whole train.
- Clicking right of the train disables selected vehicles, while clicking left of the train selects the first vehicle
- Perhaps add an explicit way to disable a selection? (clicking right of the train is typically not the first thing you'd try). It is also not mentioned in the tool tip.
- The tooltip at the refits is imcomplete. It says 'click to select a cargo' which I did after selecting a vehicle. Nothing was refit.
- You could enable the refit button only after selecting a refit.
- Closing the window after a refit is annoying. Possibly also because I didn't find the drag feature at first, so I needed to refit the same train several times.
- If you don't close the window automatically, perhaps a 'close' button might be useful??
- Being able to drag is nice, but I am not sure it is good here. I expected to drag the vehicle to another position at first. Perhaps clicking at a wagon could toggle its selection instead.
Re: Patch: Partial refit
There are problems with HEQS trams - I finally menaged to refit to 26 en supplies and 234k l of oil, but:
- selecting parts is a bit strange in best case (probably caused that code wise there are many invisible parts)
- rubbish on screen on moving window with longest tram
- selecting parts is a bit strange in best case (probably caused that code wise there are many invisible parts)
- rubbish on screen on moving window with longest tram
- Attachments
-
- Przechwytywanie.PNG (32.08 KiB) Viewed 1999 times
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
AIAI - AI for OpenTTD
Re: Patch: Partial refit
IMO it should stay open if the user selected some vehicles.Terkhen wrote:Do you think that the refit window should stay opened after doing a partial refit? IMO it makes sense to suppose that the user is going to do more refits after that one.
If the user selected no vehicles to refit the whole consist it may close.
However, in that case refitting the whole consist by selecting no vehicles vs. all vehicles behaves different. I am not sure whether that is useful or confusing
I tried with FIRS tip and Japanese Trains v2.1a. It contains an articulated refittable wagon (SHIKI 810 heavyweigt carrier).Did anyone find problems while doing partial refit of articulated engines?
With the patch you can refit single parts of it, which was not possible before (as you cannot drag single articulated parts to other trains).
I also remember some articulated car transporter in some set, though I cannot remember the sets name.
Some sets (e.g. the CSD set) also use articulated parts to create longer-looking wagons. Selecting articulated parts looks weird there.
As sets are likely to change the look of the wagons on refitting (though neither of the mentioned ones do), I think it should not be possible to refit individual articulated parts. They are a single vehicle and need to be refitted consistently.
In result that also means that road vehicles cannot be refitted in parts (unless with Andy's pony).
⢇⡸⢸⠢⡇⡇⢎⡁⢎⡱⢸⡱⢸⣭⠀⢸⢜⢸⢸⣀⢸⣀⢸⣭⢸⡱⠀⢰⠭⡆⣫⠰⣉⢸⢸⠀⢰⠭⡆⡯⡆⢹⠁⠀⢐⠰⡁
Re: Patch: Partial refit
Even with special console command ended with Big Red Box Warning? (Maybe I will be able to merge that patch with Chill patchpack, in that case it wouldnt be needed for me).frosch wrote:In result that also means that road vehicles cannot be refitted in parts (unless with Andy's pony).
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
AIAI - AI for OpenTTD
Re: Patch: Partial refit
I agree with previous posters ... Refit gui should stay open until closed by player.
Some (quick) testing with latest available diff (r21322):
- The qlitches metioned by Kogut do not occur when refitting trains. If wagons overflow the gui scrollbar kicks in. This does not seem to happen with road vehicles or maybe it does not overflow enough for the scrollbar to kick in. I have not yet tested changing the code so that the gui default size is smaller on opening.
- HEQS r308 -> trams.
-- Attachment 1: Capacity is one long line. maye better to insert a break? The (x tons in x wagons) showing is IMO something that should be fixed in HEQS after patch goes to trunk?
-- Attachment 2: Kreuzberg industrial tram -> first possible selection is not a vehicle. Last wagon can not be selected.
-- Attachment 3: When selecting wagons on the Henningsdorf Industrial tram to refit them selectionbox size does not correspond to the actual wagons. Also last wagon can not be selected.
Both trams are available in 1950.
Some (quick) testing with latest available diff (r21322):
- The qlitches metioned by Kogut do not occur when refitting trains. If wagons overflow the gui scrollbar kicks in. This does not seem to happen with road vehicles or maybe it does not overflow enough for the scrollbar to kick in. I have not yet tested changing the code so that the gui default size is smaller on opening.
- HEQS r308 -> trams.
-- Attachment 1: Capacity is one long line. maye better to insert a break? The (x tons in x wagons) showing is IMO something that should be fixed in HEQS after patch goes to trunk?
-- Attachment 2: Kreuzberg industrial tram -> first possible selection is not a vehicle. Last wagon can not be selected.
-- Attachment 3: When selecting wagons on the Henningsdorf Industrial tram to refit them selectionbox size does not correspond to the actual wagons. Also last wagon can not be selected.
Both trams are available in 1950.
- Attachments
-
- Drinfingpool Transport, 13th Oct 1950.png (25.52 KiB) Viewed 1955 times
-
- Drinfingpool Transport, 22nd Jun 1967.png (3.81 KiB) Viewed 1955 times
-
- Drinfingpool Transport, 8th Jan 1950.png (2.96 KiB) Viewed 1955 times
-- .- -.-- / - .... . / ..-. --- .-. -.-. . / -... . / .-- .. - .... / -.-- --- ..- .-.-.-
--- .... / -.-- . .- .... --..-- / .- -. -.. / .--. .-. .- .. ... . / - .... . / .-.. --- .-. -.. / ..-. --- .-. / .... . / --. .- ...- . / ..- ... / -.-. .... --- --- -.-. .... --- --- ... .-.-.- / ---... .--.
Playing with my patchpack? Ask questions on usage and report bugs in the correct thread first, please.
All included patches have been modified and are no longer 100% original.
--- .... / -.-- . .- .... --..-- / .- -. -.. / .--. .-. .- .. ... . / - .... . / .-.. --- .-. -.. / ..-. --- .-. / .... . / --. .- ...- . / ..- ... / -.-. .... --- --- -.-. .... --- --- ... .-.-.- / ---... .--.
Playing with my patchpack? Ask questions on usage and report bugs in the correct thread first, please.
All included patches have been modified and are no longer 100% original.
Re: Patch: Partial refit
Wow, a lot of feedback
Chillcore: Thank you for the tests. The fixes that you describe should be in this patch, but since I'm going to remove support for refitting articulated parts independently, these issues will not be present anymore. I guess that you will have to wait until someone codes wagons for road vehicles.
Good point. I guess that the best solution is to have the complete train selected at first (and display it as such). Clicking on any part of the vehicle widget that is not part of the vehicle itself should disable the selection (selecting the whole train again). Since there is not always empty space at that widget, there should be another way of clearing the current selection. Any ideas for this?Alberth wrote:- After opening the window, the bottom panel displays a refit cargo + price without having anything selected.
- Perhaps select everything instead of nothing? It makes it more clear the refit is for the whole train.
- Clicking right of the train disables selected vehicles, while clicking left of the train selects the first vehicle
- Perhaps add an explicit way to disable a selection? (clicking right of the train is typically not the first thing you'd try). It is also not mentioned in the tool tip.
At the different refit options I get 'Select type of cargo for train to carry' as tooltip. I can't find any reference to clicking in the tooltips of that window.Alberth wrote:- The tooltip at the refits is imcomplete. It says 'click to select a cargo' which I did after selecting a vehicle. Nothing was refit.
I like that ideaAlberth wrote:- You could enable the refit button only after selecting a refit.
Agreed.Alberth wrote:- Closing the window after a refit is annoying. Possibly also because I didn't find the drag feature at first, so I needed to refit the same train several times.
- If you don't close the window automatically, perhaps a 'close' button might be useful??
The refit command itself is only able to refit adjacent vehicles. Therefore, the window needs a way of quickly selecting adyacent vehicles for refitting. In my opinion dragging is suited for this. Allowing to refit non adjacent parts of a vehicle would require to store all sets of adjacent vehicles and to perform the refit command for each set. I ruled it out as too complicated.Alberth wrote:- Being able to drag is nice, but I am not sure it is good here. I expected to drag the vehicle to another position at first. Perhaps clicking at a wagon could toggle its selection instead.
Your point makes sense. This means that I will remove the shortlived option to partially refit road vehicles. I'll have to think about how to handle articulated vehicles, as they can be in different parts of a train but they need to be refitted at the same time. Maybe it should automatically draw the articulated parts of all selected vehicles as selected too, and follow the links to the different articulated parts when the command is actually performed. This is a problematic issuefrosch wrote:I think it should not be possible to refit individual articulated parts. They are a single vehicle and need to be refitted consistently.
In result that also means that road vehicles cannot be refitted in parts (unless with Andy's pony).
Thank you for the report. I don't know if this will be affected by the removal of partial refit for road vehicles. I will check the bug once that is removed.Kogut wrote:There are problems with HEQS trams - I finally menaged to refit to 26 en supplies and 234k l of oil, but:
- selecting parts is a bit strange in best case (probably caused that code wise there are many invisible parts)
- rubbish on screen on moving window with longest tram
Chillcore: Thank you for the tests. The fixes that you describe should be in this patch, but since I'm going to remove support for refitting articulated parts independently, these issues will not be present anymore. I guess that you will have to wait until someone codes wagons for road vehicles.
Spanish translation of OpenTTD
Extended heightmaps
Have fun, don't quarrel too much and add as many advanced settings as you can.
Extended heightmaps
Have fun, don't quarrel too much and add as many advanced settings as you can.
Re: Patch: Partial refit
A 'select all' button left of the scrollbar (or even just 'all')?Terkhen wrote:Good point. I guess that the best solution is to have the complete train selected at first (and display it as such). Clicking on any part of the vehicle widget that is not part of the vehicle itself should disable the selection (selecting the whole train again). Since there is not always empty space at that widget, there should be another way of clearing the current selection. Any ideas for this?
You are quite correct, sorry for the confusion.Terkhen wrote:At the different refit options I get 'Select type of cargo for train to carry' as tooltip. I can't find any reference to clicking in the tooltips of that window.Alberth wrote:- The tooltip at the refits is imcomplete. It says 'click to select a cargo' which I did after selecting a vehicle. Nothing was refit.
My point was/is that after selecting a part of the the train, I clicked at a cargo to refit to, and it just got selected, nothing more. It took a while before I realized I should also click the 'refit' button at the bottom, or double click the cargo.
You could mention the latter in the tooltip, but otherwise I guess it is a case of SUE: Stupid User Error
Sounds reasonable. I'd say keep dragging.Terkhen wrote:The refit command itself is only able to refit adjacent vehicles. Therefore, the window needs a way of quickly selecting adyacent vehicles for refitting. In my opinion dragging is suited for this. Allowing to refit non adjacent parts of a vehicle would require to store all sets of adjacent vehicles and to perform the refit command for each set. I ruled it out as too complicated.Alberth wrote:- Being able to drag is nice, but I am not sure it is good here. I expected to drag the vehicle to another position at first. Perhaps clicking at a wagon could toggle its selection instead.
As for the refit command, is refitting of the vehicles in-between the selections to their current cargo a possibility? If you can do that for free, it seems like a way to keep a single refit command without much effort. (Perhaps this is a way to solve the problem mentioned by frosch?)
-
- Tycoon
- Posts: 1828
- Joined: 10 Jul 2006 00:43
- Location: Spain
Re: Patch: Partial refit
I have tried this patch with an articulated locomotive (Crocodile), and It fails when I select two parts or three of the locomotive.
I have used a compiled version downloaded in Friday or Thursday.
I have used a compiled version downloaded in Friday or Thursday.
- Attachments
-
- SpainSet_1-28_Preview.zip
- Preview file. Is not finished. It is not compatible with previous versions of SpainSet or future versions.
- (544.76 KiB) Downloaded 45 times
-
- Screenshot when I select two first parts. The first passenger car changes their livery.
- fail_A.png (19.12 KiB) Viewed 1842 times
-
- Screenshot when I select three first parts. The two first passenger cars becomes in a "two colours" livery.
- fail_B.png (19.13 KiB) Viewed 1842 times
Sorry if my english is too poor, I want learn it, but it isn't too easy.
- [list][*]Why use PNG screenshots in 8 bpp games.
[*]Caravan site New Industry. · Spain set. · Some spanish trains for locomotion[*]Favourites:GRVTS · ECS · FIRS
Re: Patch: Partial refit
So maybe it should be impossible to select part of articulated engine/wagon?
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
AIAI - AI for OpenTTD
Re: Patch: Partial refit
After checking my last post it might not be obvious that I'm going to remove support for refitting different parts of the same articulated vehicle (although that's what I meant to say), as it has problems with many sets and might even break the NewGRF specs.
Spanish translation of OpenTTD
Extended heightmaps
Have fun, don't quarrel too much and add as many advanced settings as you can.
Extended heightmaps
Have fun, don't quarrel too much and add as many advanced settings as you can.
Re: Patch: Partial refit
This time we have a long list of changes (you can get the updated patch queue and binary at the first post).
- Long road vehicles / trams are not drawn outside of the window anymore.
- Remove support for refitting individual articulated / dual headed parts. Instead, whenever a part of an articulated or dual headed vehicle is selected, the whole vehicle is selected too. The same stands for refitting.
- As a result of the previous point, road vehicle support has been removed.
- Show the complete train as selected when there is no selection.
- Clicking at the empty space at the left of the vehicle now clears the selection correctly.
- Enable the refit button only after selecting a cargo to refit.
- Don't close the refit window after a refit, unless the selection was cleared.
Spanish translation of OpenTTD
Extended heightmaps
Have fun, don't quarrel too much and add as many advanced settings as you can.
Extended heightmaps
Have fun, don't quarrel too much and add as many advanced settings as you can.
- planetmaker
- OpenTTD Developer
- Posts: 9432
- Joined: 07 Nov 2007 22:44
- Location: Sol d
Re: Patch: Partial refit
What about double click on the vehicle working as 'select all'? It works in many applications in order to select the whole word / line /...Terkhen wrote: I have not implemented the "Select All" button, where do you think it should be placed?
I'd place the button left of the 'refit' button. Possibly smaller than that 1/3 for 'select all' to 2/3 for 'refit' of the window width.
OpenTTD: manual | online content | translations | Wanted contributions and patches
#openttdcoop: blog | wiki | public server | DevZone | NewGRF web translator
DevZone - home of the free NewGRFs: OpenSFX | OpenMSX | OpenGFX | Swedish Rails | OpenGFX+ Trains|RV|Industries|Airports|Landscape | NML
Who is online
Users browsing this forum: No registered users and 42 guests