Skip to content
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

Vehicles console commands #1060

Closed
DorpsGek opened this issue Jul 20, 2007 · 10 comments
Closed

Vehicles console commands #1060

DorpsGek opened this issue Jul 20, 2007 · 10 comments
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) patch from FlySpray This issue is in fact a Patch, but imported from FlySrpay

Comments

@DorpsGek
Copy link
Member

bilbo opened the ticket and wrote:

I have created a patch that will add train (and also plane, ship and road vehicles) console commands.

These commands allow mass-manipulations with vehicles that would be tedious to do with the gui (for example "send all planes with max. speed <500 km/h to depot" or "sell two wagons for all trains with more than 12 wagons")

It adds command "train" in console, with several subcommands for trains, similarly "road" for road vehicles, "plane" or "aircraft" for aircrafts and "ship" for ships. Also command "vehicle" that will do the command on all appropriate vehicles of any type

For full manual to all commands, see the wiki page I have created for this: http://wiki.openttd.org/index.php/Vehicle_console_commands

I think it is enough stable to be candidate for inclusion in trunk.

Patch does not break savegame or multiplayer compatibility.

Attached is the patch for 10634.

Link to forum thread: http://www.tt-forums.net/viewtopic.php?f=33&t=32964

Attachments

Reported version: trunk
Operating system: All


This issue was imported from FlySpray: https://bugs.openttd.org/task/1060
@DorpsGek
Copy link
Member Author

TrueBrain wrote:

How ever much I LOVE what you did, I have one minor disappointment for you: we are currently considering removing the current console and replacing it with one based on Squirrel, a light-weighted script language. Squirrel is already used for the NoAI branch and providing a way for people to make AIs in a simple way. Based on our experience there we know for sure it would make the console much much easier. So, currently we put this patch on hold, till the time Squirrel is added to trunk, and we can convert the console to it. I am sure we can port your patch by then relatively easy.

But, for all clearness, I want to underline that I love the idea of your patch. Maybe it should in fact be a nice GUI... ;)


This comment was imported from FlySpray: https://bugs.openttd.org/task/1060#comment1663

@DorpsGek
Copy link
Member Author

bilbo wrote:

Well, from my personal view, I prefer console for entering such automated tasks. Although the way things are done it would be possible to slightly modify the thing so that it will allow to write some additional gui which will then call something like InternalVehicleConsoleCommand(VEH_TRAIN, MATCH_LENGTH, MATCH_NOT_EQUAL, 3, TRAIN_SELL_WAGON, 3, 5) - soliciting all the parameters via some sort of comboboxes or such ....

Well, I'll look at it once squirrel arrives to trunk...


This comment was imported from FlySpray: https://bugs.openttd.org/task/1060#comment1667

@DorpsGek
Copy link
Member Author

Chris wrote:

Just a little note, it should be strtoul not strtoull :) Great patch anyways!


This comment was imported from FlySpray: https://bugs.openttd.org/task/1060#comment1733

@DorpsGek
Copy link
Member Author

bilbo wrote:

strtoul will convert to long (which may be 32 bit on 32bit architecture and 64bit on 64bits)
strtoull will convert to long long (which is always 64bits)

Money is 64bits.

So I think strtoull is correct.


This comment was imported from FlySpray: https://bugs.openttd.org/task/1060#comment1737

@DorpsGek
Copy link
Member Author

Chris wrote:

Hmmm sounds logic, but the problem was that strtoull doesn't compile with MSVC while strtoul does :) if it works with GCC everything's fine.


This comment was imported from FlySpray: https://bugs.openttd.org/task/1060#comment1747

@DorpsGek
Copy link
Member Author

bilbo wrote:

strtoul can't handle ints over 32bits, which may be quite problem with money, as money ovger 2G is quite common.

I found this:

http://msdn2.microsoft.com/en-us/library/85zk715d(VS.80).aspx

seems _strtoui64 does the same as strtoull, so perhaps add in some header something like this:

# ifdef MSVC
# define strtoull _strtoui64
# endif

Unfortunately, I have no MSVC (only GCC), so I can't try it.


This comment was imported from FlySpray: https://bugs.openttd.org/task/1060#comment1756

@DorpsGek
Copy link
Member Author

Chris wrote:

the # define does the trick, although I couldn't figure out the identifier for Visual Studio. MSVC doesn't work and MSVC as it's stated on several websites doesn't work either.


This comment was imported from FlySpray: https://bugs.openttd.org/task/1060#comment1757

@DorpsGek
Copy link
Member Author

DorpsGek commented Sep 1, 2007

Chris wrote:

# ifdef _MSC_VER
# define strtoull _strtoui64 ///< required for MSVC
# endif

Is the correct way to do it :)


This comment was imported from FlySpray: https://bugs.openttd.org/task/1060#comment2023

@DorpsGek
Copy link
Member Author

DorpsGek commented Nov 4, 2007

TrueBrain wrote:

As said before, we won't add such big changes in console, mostly because console is not stable, or meant for such things. Patch rejected.


This comment was imported from FlySpray: https://bugs.openttd.org/task/1060#comment2598

@DorpsGek
Copy link
Member Author

DorpsGek commented Nov 4, 2007

TrueBrain closed the ticket.

Reason for closing: Won't implement

Patch Rejected.


This comment was imported from FlySpray: https://bugs.openttd.org/task/1060

@DorpsGek DorpsGek closed this as completed Nov 4, 2007
@DorpsGek DorpsGek added Core flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) patch from FlySpray This issue is in fact a Patch, but imported from FlySrpay labels Apr 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) patch from FlySpray This issue is in fact a Patch, but imported from FlySrpay
Projects
None yet
Development

No branches or pull requests

1 participant