Patch: Vehicle+town+industry console commands v20 for r19627

Forum for technical discussions regarding development. If you have a general suggestion, problem or comment, please use one of the other forums.

Moderator: OpenTTD Developers

User avatar
Bilbo
Tycoon
Tycoon
Posts: 1710
Joined: 06 Jun 2007 21:07
Location: Czech Republic

Re: Patch: Vehicles console commands v15 for r15892

Post by Bilbo »

Xanobia wrote:one question is there a way to combine identifiers?

like show all aircrafts from group this that are broken?
Well, that would be somewhat complicated, as you will have to recognize

But it would be useful, so I think I'll add some "pseudocommand" AND (and maybe OR too), that will look for next match and next command:

Code: Select all

plane group=x and broken <some_command>
I think this will be especially useful for town commands I am planning (for example asking for town where I don't have airport and the noise limits allows me to build one)
If you need something, do it yourself or it will be never done.

My patches: Extra large maps (1048576 high, 1048576 wide) (FS#1059), Vehicle + Town + Industry console commands (FS#1060), few minor patches (FS#2820, FS#1521, FS#2837, FS#2843), AI debugging facility

Other: Very large ships NewGRF, Bilbo's multiplayer patch pack v5 (for OpenTTD 0.7.3)
User avatar
Bilbo
Tycoon
Tycoon
Posts: 1710
Joined: 06 Jun 2007 21:07
Location: Czech Republic

Re: Patch: Vehicles console commands v15 for r15892

Post by Bilbo »

audigex wrote:Any chance of re-name and add-to-/remove-from-group options?
Adding or removing to/from group would be possible and quite easy, but considering renaming, the name of the vehicle have to be unique. That would somehow limit the usability of renaming - any idea how to solve it? In what way do you want to use the rename command?
If you need something, do it yourself or it will be never done.

My patches: Extra large maps (1048576 high, 1048576 wide) (FS#1059), Vehicle + Town + Industry console commands (FS#1060), few minor patches (FS#2820, FS#1521, FS#2837, FS#2843), AI debugging facility

Other: Very large ships NewGRF, Bilbo's multiplayer patch pack v5 (for OpenTTD 0.7.3)
Iguanna
Engineer
Engineer
Posts: 100
Joined: 21 Nov 2007 00:06

Re: Patch: Vehicles console commands v15 for r15892

Post by Iguanna »

Thanks for the patch Bilbo, I used it the other day to clone like 1200 trains to test something, and it was awesome. :)

If you enhanced it so we could set the production of many/all industries quickly as well, I would definitely use that too. Actually I've been wondering if (hoping) there was a way to do exactly that.

In regards to the town commands, would this mean someone could run a script to do things like buy/keep exclusive transport rights? IMHO it would be best if a players effectiveness in multilayer was not influenced by what scripts he/she had ready to use. There was another game, Spring where you could run lua scripts to modify the GUI and do almost anything, and there was a huge disadvantage to new players using the standard interface vs anyone who had got hold of some of the scripts to make it easier. I would not like to see OpenTTD become like that, but I guess as long as it that functionality was disabled by default, there would be no problem, and it could be handy, like for testing or whatever. That's my 2c anyway, maybe something to consider.
User avatar
Bilbo
Tycoon
Tycoon
Posts: 1710
Joined: 06 Jun 2007 21:07
Location: Czech Republic

Re: Patch: Vehicles console commands v15 for r15892

Post by Bilbo »

IguannaB wrote:Thanks for the patch Bilbo, I used it the other day to clone like 1200 trains to test something, and it was awesome. :)

If you enhanced it so we could set the production of many/all industries quickly as well, I would definitely use that too. Actually I've been wondering if (hoping) there was a way to do exactly that.
Some time ago I needed to maximize production of all industries on map in one scenario, so I wrote some hackish patch to add console command for that. Now I decided to add some more general industry manipulation/query functions to console.
IguannaB wrote: In regards to the town commands, would this mean someone could run a script to do things like buy/keep exclusive transport rights?
Well, yes, they can do that (IF they have enough money). These commands won't do that automatically, but they can manually construct command "buy exclusive right where I don't have it" and run it from console repetitively (console have history, so it's easy). But on many servers, buying exclusive rights is disabled anyway.
IguannaB wrote: IMHO it would be best if a players effectiveness in multilayer was not influenced by what scripts he/she had ready to use. There was another game, Spring where you could run lua scripts to modify the GUI and do almost anything, and there was a huge disadvantage to new players using the standard interface vs anyone who had got hold of some of the scripts to make it easier. I would not like to see OpenTTD become like that, but I guess as long as it that functionality was disabled by default, there would be no problem, and it could be handy, like for testing or whatever. That's my 2c anyway, maybe something to consider.
I don't know how you can "disable" such functionality - you are free not to use the console commands if you do not want to. But no script or GUI improvement will think for you, they can just make realization of your ideas easier, or they can help you with collecting necessary information :)

There are many other patches that give you advantage in multiplayer - many GUI patches, that allow you to do some things more effectively, or to see important information better (like ability to filter industry list to see only industries you want), copy & paste patch that allow you to construct your railway system faster, the vehicle console patch that allows you to easier management of your vehicles once you have too manmy of them. And now the planned town/industry console commands. Well, my primary personal interest are the querying functions (pick towns where I can build certain airport, query for good industries, then also semi-automatical town management: build statues, fund buildings and run advertising campaigns periodically in the cities where it would be useful, etc ...)

There is no way to run these commands automatically every month or every X days or something like that - that would need some "cron" function (hmm .... I think I have idea for another patch :)

The only big advantage that will affect your performance greatly from the planned features is the "automatic" rebuying of exclusive rights. But once both side have these console commands - the side with more money wins :)

But as the exlusive rights are mostly used not to give you advantage but rather to harm competition, these are disabled on many (I think most) servers and so I don't consider this a major issue.

I offered this patch to trunk - http://bugs.openttd.org/task/1060 - so all players can use these commands, but it was rejected because devs planned to replace the console with system based on squirrel (well, if that is what I think, anybody can launch any piece of code taken from some AI and that could give players with clever script quite a lot of advantage)

Devs also suggested having some nice "Mass vehicle commans" GUI for these features, but as I do not understand much the openttd gui system, I've not made it (yet) - but I could consider doing that in some future.
If you need something, do it yourself or it will be never done.

My patches: Extra large maps (1048576 high, 1048576 wide) (FS#1059), Vehicle + Town + Industry console commands (FS#1060), few minor patches (FS#2820, FS#1521, FS#2837, FS#2843), AI debugging facility

Other: Very large ships NewGRF, Bilbo's multiplayer patch pack v5 (for OpenTTD 0.7.3)
Iguanna
Engineer
Engineer
Posts: 100
Joined: 21 Nov 2007 00:06

Re: Patch: Vehicles console commands v15 for r15892

Post by Iguanna »

Bilbo wrote: I don't know how you can "disable" such functionality - you are free not to use the console commands if you do not want to...
To disable it, I had in mind a patch option, maybe something like 'Enable town action commands from console' or something, off by default so the behavior is unchanged. Just thinking this might help it get to trunk, if this was a concern.

The way I look at it, the town actions are a bit different to vehicle management actions like buying trains etc because the town actions tend to effect the other players more, and it may be worth having a way to prevent people from being able to automate this stuff, like advertising, buying rights etc. I remember one game where I had this exclusive rights war with someone for goods from a factory, and a large part of my time was spent making sure I had the rights to that town. When I saw what you had planed here, I kind of imagined that, but with them (or me maybe) having the rights bought automatically somehow (like running the last command in console to re-buy rights if required), which would have been a big advantage in that scenario. (I won the war btw and they went bankrupt. Serves em right for trying to steal my goods. :D )

I'm all for anything that reduces micro, or adds some functionality, but it would be a shame IMHO to see OpenTTD become like Spring, where players with scripts (or using console commands) got a significant advantage over those who don't, so maybe it might be worth having the option to disable to disable the town console commands in multilayer. I know you can compile with patches etc that give you an advantage anyway, but I guess there's not much we can do about that, and at least it's a bit of a hassle to do.

Yeah, I read the flyspray notes about this before and saw it got rejected. Actually I was wondering if this had changed, as it appeared that squirrel is used now (or there is a squirrel folder with source files anyway). Would be sweet if it could go into trunk because I'm finding it really handy for managing a lot of vehicles. A GUI would be nice, but even as it is, it is really useful.
User avatar
Bilbo
Tycoon
Tycoon
Posts: 1710
Joined: 06 Jun 2007 21:07
Location: Czech Republic

Re: Patch: Vehicles console commands v15 for r15892

Post by Bilbo »

IguannaB wrote:
Bilbo wrote: I don't know how you can "disable" such functionality - you are free not to use the console commands if you do not want to...
To disable it, I had in mind a patch option, maybe something like 'Enable town action commands from console' or something, off by default so the behavior is unchanged. Just thinking this might help it get to trunk, if this was a concern.
Well, that won't work. Since the vehicle commands are completely client-side, same versions with and without the patch are fully compatible. Anybody can just enable that option or remove that check from the patch ....
IguannaB wrote:The way I look at it, the town actions are a bit different to vehicle management actions like buying trains etc because the town actions tend to effect the other players more, and it may be worth having a way to prevent people from being able to automate this stuff, like advertising, buying rights etc. I remember one game where I had this exclusive rights war with someone for goods from a factory, and a large part of my time was spent making sure I had the rights to that town. When I saw what you had planed here, I kind of imagined that, but with them (or me maybe) having the rights bought automatically somehow (like running the last command in console to re-buy rights if required), which would have been a big advantage in that scenario. (I won the war btw and they went bankrupt. Serves em right for trying to steal my goods. :D )
I know ... it's pretty annoying to have 8 windows opened and watch the red dot in them ... recently there was added feature that will display a news message when someone buys the rights, so at least now you know someone is trying to screw you. If both players would have this automation, the one with more money wins ....

Best thing is to disable exclusive rights, I send patch for that to devs about 5000 revisions ago and they put that in trunk.
IguannaB wrote:Yeah, I read the flyspray notes about this before and saw it got rejected. Actually I was wondering if this had changed, as it appeared that squirrel is used now (or there is a squirrel folder with source files anyway). Would be sweet if it could go into trunk because I'm finding it really handy for managing a lot of vehicles. A GUI would be nice, but even as it is, it is really useful.
Squirrel is used only for AI's, not for user scripts. The console is still the same as it was before adding squirrel and noai to trunk.
If you need something, do it yourself or it will be never done.

My patches: Extra large maps (1048576 high, 1048576 wide) (FS#1059), Vehicle + Town + Industry console commands (FS#1060), few minor patches (FS#2820, FS#1521, FS#2837, FS#2843), AI debugging facility

Other: Very large ships NewGRF, Bilbo's multiplayer patch pack v5 (for OpenTTD 0.7.3)
User avatar
Bilbo
Tycoon
Tycoon
Posts: 1710
Joined: 06 Jun 2007 21:07
Location: Czech Republic

Re: Patch: Vehicle+town+industry console commands v16 for r15962

Post by Bilbo »

I have uploaded v16 of the patch

Now there are first few town and industry commands! There are not much of them (yet), so consider this as a preview of incoming new features.

What to expect in near future:

* more types of matches for towns and industries
* more actions for towns and industries
* documentation to town and industry commands on wiki (type "town" or "industry" without parameters to see help)
If you need something, do it yourself or it will be never done.

My patches: Extra large maps (1048576 high, 1048576 wide) (FS#1059), Vehicle + Town + Industry console commands (FS#1060), few minor patches (FS#2820, FS#1521, FS#2837, FS#2843), AI debugging facility

Other: Very large ships NewGRF, Bilbo's multiplayer patch pack v5 (for OpenTTD 0.7.3)
User avatar
Bilbo
Tycoon
Tycoon
Posts: 1710
Joined: 06 Jun 2007 21:07
Location: Czech Republic

Re: Patch: Vehicle+town+industry console commands v17 for r16003

Post by Bilbo »

I have uploaded version 17 of the patch. There are many new town and industry commands added, I have also set up documentation for them on the wiki.

Get new version of patch from the first post.
If you need something, do it yourself or it will be never done.

My patches: Extra large maps (1048576 high, 1048576 wide) (FS#1059), Vehicle + Town + Industry console commands (FS#1060), few minor patches (FS#2820, FS#1521, FS#2837, FS#2843), AI debugging facility

Other: Very large ships NewGRF, Bilbo's multiplayer patch pack v5 (for OpenTTD 0.7.3)
User avatar
Bilbo
Tycoon
Tycoon
Posts: 1710
Joined: 06 Jun 2007 21:07
Location: Czech Republic

Re: Patch: Vehicle+town+industry console commands v18 for r16028

Post by Bilbo »

I have uploaded version 18 of the patch. Added features:

You can specify "and" operator to use multiple matches to fine-grain selection of command targets.

You can perform town authority actions (like automatically build statues, run ad campaigns or rebuy back exclusive rights)

In scenario editor you can delete or expand cities (for example, to grow all cities beyond 5000 people, run "town pop<5000 expand" repetitively)
If you need something, do it yourself or it will be never done.

My patches: Extra large maps (1048576 high, 1048576 wide) (FS#1059), Vehicle + Town + Industry console commands (FS#1060), few minor patches (FS#2820, FS#1521, FS#2837, FS#2843), AI debugging facility

Other: Very large ships NewGRF, Bilbo's multiplayer patch pack v5 (for OpenTTD 0.7.3)
User avatar
Bilbo
Tycoon
Tycoon
Posts: 1710
Joined: 06 Jun 2007 21:07
Location: Czech Republic

Re: Patch: Vehicle+town+industry console commands v19 for r16086

Post by Bilbo »

I have uploaded version 19 of the patch. Fixed is the industry command, where it mistakenly required sometimes two extra parameters and it sometimes crashed due to division by zero.

Get the patch in first post.
If you need something, do it yourself or it will be never done.

My patches: Extra large maps (1048576 high, 1048576 wide) (FS#1059), Vehicle + Town + Industry console commands (FS#1060), few minor patches (FS#2820, FS#1521, FS#2837, FS#2843), AI debugging facility

Other: Very large ships NewGRF, Bilbo's multiplayer patch pack v5 (for OpenTTD 0.7.3)
User avatar
Bilbo
Tycoon
Tycoon
Posts: 1710
Joined: 06 Jun 2007 21:07
Location: Czech Republic

Re: Patch: Vehicle+town+industry console commands v20 for r17064

Post by Bilbo »

I have updated patch to version 20 (only two minor bugfixes)

Note that due to differences between current trunk code and code of 0.7.2, I have posted patch for both (current trunk and stable 0.7.2)

Get the patch in the first post.
If you need something, do it yourself or it will be never done.

My patches: Extra large maps (1048576 high, 1048576 wide) (FS#1059), Vehicle + Town + Industry console commands (FS#1060), few minor patches (FS#2820, FS#1521, FS#2837, FS#2843), AI debugging facility

Other: Very large ships NewGRF, Bilbo's multiplayer patch pack v5 (for OpenTTD 0.7.3)
User avatar
Bilbo
Tycoon
Tycoon
Posts: 1710
Joined: 06 Jun 2007 21:07
Location: Czech Republic

Re: Patch: Vehicle+town+industry console commands v20 for r17064

Post by Bilbo »

I have posted patches updated to both last stable version (1.0.0) and latest trunk (r19627).

Get the updated patches from first post.
If you need something, do it yourself or it will be never done.

My patches: Extra large maps (1048576 high, 1048576 wide) (FS#1059), Vehicle + Town + Industry console commands (FS#1060), few minor patches (FS#2820, FS#1521, FS#2837, FS#2843), AI debugging facility

Other: Very large ships NewGRF, Bilbo's multiplayer patch pack v5 (for OpenTTD 0.7.3)
Miranda
Engineer
Engineer
Posts: 11
Joined: 16 Sep 2006 21:23

Re: Patch: Vehicle+town+industry console commands v20 for r1

Post by Miranda »

Can someone explain to me why patches like this one never made it into the live build?

Also, if it had, would that mean that the actual coders of openttd (and sorry if you are one Bilbo, I'd only assume that you aren't, since you couldn't just put it into the release) would have to take care of this code aswell, on patches? Is that why it wasn't introduced?

Sorry for the necropost, but I was wondering, and would have though this addition would be very handy.
Terkhen
OpenTTD Developer
OpenTTD Developer
Posts: 1034
Joined: 11 Sep 2008 07:32
Location: Spain

Re: Patch: Vehicle+town+industry console commands v20 for r1

Post by Terkhen »

As my personal opinion: it gives players that are familiar with console commands of any kind an unfair advantage over other players less handy with commands (or completely ignorant of their existence).
fabca2
Transport Coordinator
Transport Coordinator
Posts: 312
Joined: 14 Apr 2004 15:18
Location: Fr

Re: Patch: Vehicle+town+industry console commands v20 for r1

Post by fabca2 »

Terkhen wrote:As my personal opinion: it gives players that are familiar with console commands of any kind an unfair advantage over other players less handy with commands (or completely ignorant of their existence).
maybe, it's would be an idea that this feature is disabled in network game ? as it is for money cheat for example ?
no ?
User avatar
Bilbo
Tycoon
Tycoon
Posts: 1710
Joined: 06 Jun 2007 21:07
Location: Czech Republic

Re: Patch: Vehicle+town+industry console commands v20 for r1

Post by Bilbo »

This one won't get into main build partly because some commands work a bit "hackish" and in some cases (like doing several actions on 5000 vehicles at once) it may congest the server a bit (though in newer releases there is some rate-limiting system against that).

As for the "it could be cheating" - there are several patches that modify the GUI or the way you interact with server.

Some of them will just change the GUI slightly - like adding extra filters to list of factories, allowing you to spot the "ideal ones" faster, or by slightly modifying the GUI (smallmap zoom, various keyboard shortcut enhancements, colored town ratings, etc ....) ...
Some of them will help quite a lot - like copy & paste patch (build repetitive track elements faster), or some idea to run a helper AI to help you with your constructions (I am not aware of any existing patch for that, though this was discussed on these forums already in the past). Or this patch, if you know how to use it ....

None of them can do anything that you could not do, though some of them can do it faster than any human could ...

What is and is not considered a cheating thus quite depends on point of view ...
If you need something, do it yourself or it will be never done.

My patches: Extra large maps (1048576 high, 1048576 wide) (FS#1059), Vehicle + Town + Industry console commands (FS#1060), few minor patches (FS#2820, FS#1521, FS#2837, FS#2843), AI debugging facility

Other: Very large ships NewGRF, Bilbo's multiplayer patch pack v5 (for OpenTTD 0.7.3)
User avatar
kamnet
Moderator
Moderator
Posts: 8589
Joined: 28 Sep 2009 17:15
Location: Eastern KY
Contact:

Re: Patch: Vehicle+town+industry console commands v20 for r1

Post by kamnet »

This is a worthy dig. Would love to see patch pack builders include this one. :-)
fede86
Engineer
Engineer
Posts: 12
Joined: 14 Feb 2010 20:40

Re: Patch: Vehicle+town+industry console commands v20 for r1

Post by fede86 »

Congratulations for you very good work!
I think the town command are very useful in scenario editing too (e.g. expand all the cities)
I'm sad they have not been included in the official code!
They implement what a console is for :)
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 43 guests