Routing Restriction (Programmable waypoint) / Virtual group
Moderator: OpenTTD Developers
Re: Routing Restriction (Programmable waypoint) / Virtual group
nycom, would it be a lot of work to make a version compatible with tracksharing ?
(ie : all trains should follow rules for a waypoint, not only the waypoint owner's trains)
(ie : all trains should follow rules for a waypoint, not only the waypoint owner's trains)
Re: Routing Restriction (Programmable waypoint) / Virtual group
Is this patch still in development?
It is a really useful patch. It would be a pitty if it will be really outdated in some weeks...
It is a really useful patch. It would be a pitty if it will be really outdated in some weeks...
Re: Routing Restriction (Programmable waypoint) / Virtual group
I found a bug. When you click on the waypoint gui window and miss any widget the game terminates:
There is a simple fix: comment that line 83 in waypoint_gui.cpp.
Code: Select all
Error: NOT_REACHED triggered at line 83 of /usr/local/src/games/openttd/openttd-svn-routing-restriction/src/waypoint_gui.cpp
- planetmaker
- OpenTTD Developer
- Posts: 9432
- Joined: 07 Nov 2007 22:44
- Location: Sol d
Re: Routing Restriction (Programmable waypoint) / Virtual group
That certainly is no fix, but a dirty hack. The lines which contain "NOT_REACHED" are parts of case or switch statements where all possibilities are handled before - and something went wrong, if they're reached. Basically commenting out this line is a fixing the symptoms rather than the cause.MacJariel wrote:I found a bug. When you click on the waypoint gui window and miss any widget the game terminates:There is a simple fix: comment that line 83 in waypoint_gui.cpp.Code: Select all
Error: NOT_REACHED triggered at line 83 of /usr/local/src/games/openttd/openttd-svn-routing-restriction/src/waypoint_gui.cpp
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
Re: Routing Restriction (Programmable waypoint) / Virtual group
Ah... commenting out. The "I dont understand it, and cannot debug it, so hide it and maybe it will go away." approach.
OTTD NewGRF_ports. Add an airport design via newgrf.Superceded by Yexo's NewGrf Airports 2
Want to organise your trains? Try Routemarkers.
--- ==== --- === --- === ---
Firework Photography
Want to organise your trains? Try Routemarkers.
--- ==== --- === --- === ---
Firework Photography
Re: Routing Restriction (Programmable waypoint) / Virtual group
Actually in this case, i'd say it is the right fix.
The author didn't handle all the widgets in the switchcase, only those that do something special. Thus the rest (like, background panel) gets handled by "default:", and thus, it shouldn't have NOT_REACHED().
Now the other way would be adding all missing widgets, with just a break; and then leave the NOT_REACHED() for default.
But why not let default handle all other widgets, for which nothing should happen?
The author didn't handle all the widgets in the switchcase, only those that do something special. Thus the rest (like, background panel) gets handled by "default:", and thus, it shouldn't have NOT_REACHED().
Now the other way would be adding all missing widgets, with just a break; and then leave the NOT_REACHED() for default.
But why not let default handle all other widgets, for which nothing should happen?
Re: Routing Restriction (Programmable waypoint) / Virtual group
Hi.
That's quite easy to answer: If you add a widget and forget handling it you get the error message on testing your modifications and you know where to add the code.
Kind regards
Zombie
That's quite easy to answer: If you add a widget and forget handling it you get the error message on testing your modifications and you know where to add the code.
Kind regards
Zombie
OpenTTD: OpenTTD-Wiki
OpenTTDCoop: Blog, Wiki
My favorite patches: cargo destinations, shared infrastructure
OpenTTDCoop: Blog, Wiki
My favorite patches: cargo destinations, shared infrastructure
Re: Routing Restriction (Programmable waypoint) / Virtual group
Updated to r13310, I have removed the default: NOT_REACHED(); to match the style of other OnClick() functions in the game.
I haven't done extensive testing, but it seems to work.
EDIT: Scrap that I forgot to include the extra files in the patch will upload a fixed version later.
I haven't done extensive testing, but it seems to work.
EDIT: Scrap that I forgot to include the extra files in the patch will upload a fixed version later.
Re: Routing Restriction (Programmable waypoint) / Virtual group
Patch updated (cf first post)
Re: Routing Restriction (Programmable waypoint) / Virtual group
Would it be possible to implement programmable signals ? having signals that turn red if the oncoming trains doesn't match the conditions. I didn't looked into your code but the principle of programmable waypoints makes me think of the TTDP feature: programmable signals.
Re: Routing Restriction (Programmable waypoint) / Virtual group
Uhmm.. yeah, makes sense.zombie wrote:Hi.
That's quite easy to answer: If you add a widget and forget handling it you get the error message on testing your modifications and you know where to add the code.
Kind regards
Zombie
Still kind of arkward imo adding special cases for all the widgets only to tell it to do nothing with them.
In the long run you're right though..
Re: Routing Restriction (Programmable waypoint) / Virtual group
I've found a bug, when you try to save multiline rules in multiplayer the game gets stuck in an infinite loop on a DoCommandP in rule_gui.cpp it seems to be the following lines
It gets stuck on the fist DoCommandP. This seems to be because the Command is queued, but can't ever execute because the while loop is still running.
Code: Select all
while (rs->GetNumCriteria() < this->num_criteria)
DoCommandP(0, rs->index, 0, NULL, CMD_ADD_CRITERIA | CMD_MSG(STR_RULE_CAN_T_ADD_CRITERIA));
while (rs->GetNumCriteria() > this->num_criteria)
DoCommandP(0, rs->index, rs->GetNumCriteria() - 1, NULL, CMD_DELETE_CRITERIA | CMD_MSG(STR_RULE_CAN_T_DELETE_CRITERIA));
-
- Engineer
- Posts: 22
- Joined: 26 Jul 2008 03:09
Re: Routing Restriction (Programmable waypoint) / Virtual group
Any chance you or somebody closely related is going to extend the rule options to other forms of transport? This patch is extremely useful and time saving, but would be ultra useful for quickly grouping road vehicles. Excellent work!
Who is online
Users browsing this forum: No registered users and 1 guest