My index finger hurts

Got a problem with OpenTTD? Find some help here.

Moderator: OpenTTD Developers

Post Reply
Lemike
Engineer
Engineer
Posts: 12
Joined: 13 Sep 2013 15:10

My index finger hurts

Post by Lemike »

Hello

First of all, thanks a lot for developing this game, it reaches quite some level of awesomeness. I did play it for quite some time and it never crashed or lost any save games, well done guys!

Back to topic, I'm having a rather small game with only around 350 electric trains which have in average 7 waggons each. I wanted to convert those to MagLev, so I sent all of them to the depot.
If I had to buy the replacement trains by hand I had to click two times for the engine, n+1 times for the wagons, one time to copy orders and one time to send out the finished train so the next one gets the waggons attached automatically. That would sum up to 4200 clicks for my tiny little network even without counting the addional clicks for building and connecting the new depots.

Questions:
Is there a way to do such an operation without the acute danger of a tenosynovitis?
Since I didn't find any of those actions (buy engine/waggons, copy orders without clicking) in the hotkeys.cfg, is there a way to add hotkeys to existing buttons? This would help also for setting up orders, I have to click to open the "orders" window.
In general, is there a scripting interface(like in Lua or Python, I'm afraid of pointers :wink: ) so one could write his own macros to speed up such repetitive things and populate the overview lists with more information?

Regards Lemike
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: My index finger hurts

Post by planetmaker »

Does vehicle cloning help you?
Do shared orders help you?
Does group management help you?
http://wiki.openttd.org/Hidden_features
http://wiki.openttd.org/Shared_orders#Shared_orders

You could also look at using the 'universal railtype' and then use autoreplace even.
Lemike
Engineer
Engineer
Posts: 12
Joined: 13 Sep 2013 15:10

Re: My index finger hurts

Post by Lemike »

Thanks for the quick response, I appreciate it :)
planetmaker wrote:Does vehicle cloning help you?
Yes, I love that function, especially with ctrl so it also takes the shared orders as well. On my current problem replacing with MagLev trains it doesn't really help since the trains are spread across multiple random depots. I put all the ore trains in one group, not a group for each station.
planetmaker wrote:Do shared orders help you?
It certainly does, especially when I move(didn't find a move function so I had to delete it and build a new one) a waypoint or station.
planetmaker wrote:Does group management help you?
It helps to replace engines but I'm missing some more columns there i.e. a column for each destination, also the ability to sort those like first sort by 2nd column, then 3rd as we know it from LibreOffice.
I'm going to write those in the suggestion section on the forum. Shall I necro a similar thread or make a new one?
planetmaker wrote:You could also look at using the 'universal railtype' and then use autoreplace even.
I guess need an "Addon" for that. But this universal rail feature woudn't be available on online games, right?
If that's the case I'm going to make a suggestion post to make all the depots universal so we only had to replace the tracks in future.

Regards Lemike
User avatar
ChillCore
Tycoon
Tycoon
Posts: 2857
Joined: 04 Oct 2008 23:05
Location: Lost in spaces

Re: My index finger hurts

Post by ChillCore »

Lemike wrote: Since I didn't find any of those actions (buy engine/waggons, copy orders without clicking) in the hotkeys.cfg, is there a way to add hotkeys to existing buttons?
Yes, by modifying the source and linking default keys to the commands hidden behind the buttons that trigger the specified behaviour.
In general, is there a scripting interface(like in Lua or Python, I'm afraid of pointers :wink: ) so one could write his own macros to speed up such repetitive things and populate the overview lists with more information?
you could link multiple actions in the same command I think, never tried it but I do not see why not.
There is squirrel for writing AIs and Scripts; NML can be used to write NewGRF, but those can not be used for adding hotkeys to the base game.
OpenTTD is written in C++.
If you can compile yourself you could have a look at the source and pretty much copypaste code from other hotkeys.
Shall I necro a similar thread or make a new one?
Necro is fine if you stay on topic and have something new to add, otherwise a new thread is prefered.
I guess need an "Addon" for that. But this universal rail feature woudn't be available on online games, right?
Clients can not join servers if the NewGRF do not match exactly so that problem is already being taken care of.
You can either start your own server with the NewGRF you desire or join one that has the ones you want.
Note that when a server uses Bananas content only you will be given the option to download the missing ones ingame, read: if you start the server with that content only you do not have to make sure that the people joining you have the missing content. (this option includes content that is in the meantime replaced with new content and can no longer be seen from the normal ingame download window.

ps:
We call addons NewGRF here with stands for New Graphics Replacement File; although the name never changed they can do much more then that by now.
Last edited by ChillCore on 13 Sep 2013 19:04, edited 1 time in total.
-- .- -.-- / - .... . / ..-. --- .-. -.-. . / -... . / .-- .. - .... / -.-- --- ..- .-.-.-
--- .... / -.-- . .- .... --..-- / .- -. -.. / .--. .-. .- .. ... . / - .... . / .-.. --- .-. -.. / ..-. --- .-. / .... . / --. .- ...- . / ..- ... / -.-. .... --- --- -.-. .... --- --- ... .-.-.- / ---... .--.

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.
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: My index finger hurts

Post by planetmaker »

ChillCore wrote:We call addons NewGRF here with stands for New Graphics Replacement File; although the name never changed they can do much more then that by now.
NewGRF = New Game Resource File ;-)
User avatar
ChillCore
Tycoon
Tycoon
Posts: 2857
Joined: 04 Oct 2008 23:05
Location: Lost in spaces

Re: My index finger hurts

Post by ChillCore »

planetmaker wrote:
ChillCore wrote: We call addons NewGRF here with stands for New Graphics Replacement File; although the name never changed they can do much more then that by now.
NewGRF = New Game Resource File ;-)
We do do we?
Thank you for correcting me. ;)
-- .- -.-- / - .... . / ..-. --- .-. -.-. . / -... . / .-- .. - .... / -.-- --- ..- .-.-.-
--- .... / -.-- . .- .... --..-- / .- -. -.. / .--. .-. .- .. ... . / - .... . / .-.. --- .-. -.. / ..-. --- .-. / .... . / --. .- ...- . / ..- ... / -.-. .... --- --- -.-. .... --- --- ... .-.-.- / ---... .--.

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.
Lemike
Engineer
Engineer
Posts: 12
Joined: 13 Sep 2013 15:10

Re: My index finger hurts

Post by Lemike »

Thanks for that very usefull informations, I guess I have to dip my toe a bit into C++ and Squirrel ;)

Have a nice day

Lemike
3298
Traffic Manager
Traffic Manager
Posts: 143
Joined: 02 Apr 2011 12:55

Re: My index finger hurts

Post by 3298 »

ChillCore wrote:you could link multiple actions in the same command I think, never tried it but I do not see why not.
If your "command" is a hotkey, then no, not in trunk. I wrote a patch for that, though. It is on the bug tracker, it never got any comments there, only an earlier version in my transparency patch thread got some coding style comments. Currently it needs a tiny bit of manual merging, but anyone with a little bit of C++ experience should be able to fix that.

Back on topic: My own solution for railtype switching would be to build one train for each order list, copy its orders from a train of the old railtype, then CTRL+clone it from the vehicle window. Then I take the depot window and click on the small red symbol in front of the first train, wait until the train has left the depot, click without moving the mouse to release the next train, and so on. Total clicks (for a set of trains with shared orders): as many clicks as required to build one train, plus two clicks per additional train sharing the order list.
The timetables need an adjustment anyway because the trains on the new railtype are usually faster than the previous ones, but that's a task for later.
User avatar
ChillCore
Tycoon
Tycoon
Posts: 2857
Joined: 04 Oct 2008 23:05
Location: Lost in spaces

Re: My index finger hurts

Post by ChillCore »

Lemike did ask for a way to write macros. ;)

I do not want to confuse Lemike too much, neither do I want to take away the pleasure of the mental exercise ...

Anyway in short,
With comand I meant the console-command that is called when pressing the hotkey.
You can indeed not chain console-commands in the same place as where the hotkey behaviour is specified.
Simply replacing this 'command-call 'with a proper function call will do the trick.

I have done so in a patch that is not yet released nor did I talk about it besides hinting to it, too soon too early for the kind of revolution I am planning. ;)

Can you please provide a link to the flyspray entry?
Just curious what our approach is exactly. ;)
-- .- -.-- / - .... . / ..-. --- .-. -.-. . / -... . / .-- .. - .... / -.-- --- ..- .-.-.-
--- .... / -.-- . .- .... --..-- / .- -. -.. / .--. .-. .- .. ... . / - .... . / .-.. --- .-. -.. / ..-. --- .-. / .... . / --. .- ...- . / ..- ... / -.-. .... --- --- -.-. .... --- --- ... .-.-.- / ---... .--.

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.
Alberth
OpenTTD Developer
OpenTTD Developer
Posts: 4765
Joined: 09 Sep 2007 05:03
Location: home

Re: My index finger hurts

Post by Alberth »

Macros to assist the player in doing things for him will quickly tilt the playing field at competitive MP games.

It would become easy to automate advertising, buy new engines every two years, lay complicated junctions, etc etc etc.
As such, it would stop being a game of playing skill, and instead a game of being able to copy macros.

If you want to automate play, write an AI.
Eddi
Tycoon
Tycoon
Posts: 8289
Joined: 17 Jan 2007 00:14

Re: My index finger hurts

Post by Eddi »

Note that, when the squirrel interface was introduced for AIs, the ability to have a script to aid the human player was deliberately disabled, for the reasons that Alberth said. (and it would only need a few small changes to allow. it was, however, never specified which changes they are)
User avatar
ChillCore
Tycoon
Tycoon
Posts: 2857
Joined: 04 Oct 2008 23:05
Location: Lost in spaces

Re: My index finger hurts

Post by ChillCore »

Ah yes ... the cheaty bit ... forgot about that for a sec.

My patch I refered to does nothing of that kind, it is not used in gameplay at all and would need to be comited too before becoming usable at all. ;)
-- .- -.-- / - .... . / ..-. --- .-. -.-. . / -... . / .-- .. - .... / -.-- --- ..- .-.-.-
--- .... / -.-- . .- .... --..-- / .- -. -.. / .--. .-. .- .. ... . / - .... . / .-.. --- .-. -.. / ..-. --- .-. / .... . / --. .- ...- . / ..- ... / -.-. .... --- --- -.-. .... --- --- ... .-.-.- / ---... .--.

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.
3298
Traffic Manager
Traffic Manager
Posts: 143
Joined: 02 Apr 2011 12:55

Re: My index finger hurts

Post by 3298 »

ChillCore wrote:Can you please provide a link to the flyspray entry?
Just curious what our approach is exactly. ;)
Sure, it's this one.
Its only purpose is to allow a user to launch multiple hotkey actions with a single keypress. No new hotkeys are defined, no defaults are changed. Thinking about it, the latter is an issue because there are some sets of hotkey actions on the same key in trunk that don't really belong together: D skips an order in the order window, and GLOBAL+D activates the dynamite in the landscaping toolbar; F deletes an order, focuses the sign list filter box and it also does break_string in the AI/GS debug window (don't know what that does, I'm not an AI/GS developer), the number keys activate building tools in the various infrastructure toolbars and switch to AI companies in the debug window; C does match_case in the debug window and centers the viewport on the cursor; RETURN continues a paused AI/GS and opens the chat.
If you are interested in the discussion about the patch, read this post and the three posts after that.

That patch does assist the player a bit, but because there are no new hotkeys I don't consider it a cheating tool. It can only do some simple things like hiding houses when pressing the hotkey for the bus station. It wouldn't be of much help when converting trains to a new railtype unless someone adds new hotkeys to OpenTTD.
Lemike
Engineer
Engineer
Posts: 12
Joined: 13 Sep 2013 15:10

Re: My index finger hurts

Post by Lemike »

Thanks for those answers.

I guess the best solution to the too-many-clicks-required problem will be the modification of the game itself to add more hotkeys. In the other hand, I think adding an ingame menu for customizing woudn't be the worst idea since any game I can think of has such a thing. Also adding the hotkey to the tooltip woudn't be the worst idea. Don't excpect too much that soon since I'm a novice in coding and I only know a few things about C++. If you want me to I'll start with the graphics of the menu first.

Regards Lemike
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: My index finger hurts

Post by Zuu »

3298 wrote:it also does break_string in the AI/GS debug window (don't know what that does, I'm not an AI/GS developer)
The f-key does focus the edit box for pausing a script when a log message matches a filter string in AI/GS debug window. However, only if that window is open and only if you have the gui.ai_developer_tools setting enabled. The same goes for several other of the AI/GS hotkeys that you have mentioned.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
3298
Traffic Manager
Traffic Manager
Posts: 143
Joined: 02 Apr 2011 12:55

Re: My index finger hurts

Post by 3298 »

Zuu wrote:only if that window is open
Yes, of course, just like with all the other non-global hotkeys.
Zuu wrote:and only if you have the gui.ai_developer_tools setting enabled. The same goes for several other of the AI/GS hotkeys that you have mentioned.
That makes these a lower priority, but the fact that these conflicts exist at all is an issue. The hotkey conflicts a normal user would encounter are D and F - there is even a bugtracker entryabout D. Anyway, I just wanted to give a complete list of conflicting hotkeys. (Note to myself: Copy that list to my entry on the bugtracker so it doesn't get lost in an unrelated forum thread.)
DNK
Engineer
Engineer
Posts: 3
Joined: 14 Oct 2014 22:58

buttons [ ] \ ' ; / .

Post by DNK »

Having a real great wish to adjust those keys mentioned.
They are not present in hotkeys.cpp
The question: is there a possibility to use those keys in game.
Not being coder, but wish to try this key setup ^so much^, that can try to do some scripting work by myself, if only you tell me it have some chances to be realised in general.
(due to hotkeys.cpp I can see - there are standart rules for the letters and special keys like del, backquote etc directing to what the key should answer but not sure I understand the whole idea of how it works).
One more thing: those marvelous ctrl+clicking functions, can be changed to (for example) alt+click?
Thanks in advance.
Post Reply

Return to “OpenTTD Problems”

Who is online

Users browsing this forum: No registered users and 13 guests