To allow for easier spread and ensure players of all time zones can attend one, the Melody rift will be delayed by 12 hours
Sign in to follow this  
Romen

mod idea - Auto keybinding based on active tool?

Recommended Posts

I had another interesting mod idea if someone is up for the challenge. I suspect there is probably a function one could hook that is called whenever a tool is activated. If so, then perhaps it could be possible to then automatically set up some keybinds for that tool. For example, if a shovel is activated then you might want to have binds for dig, level, and flatten. Or if a pickaxe is activated, then tunnel, mine, etc. I haven't looked at any of the code, but perhaps there is a function that could be used to trigger some configurable keybinds.

 

Yes I know about binding some keys to exec a file with keybinds, but I think it would be much more user friendly if just activating an appropriate tool would automatically do the binds for you. Anyone up for the challenge? (Or perhaps it's not possible, in which case your feedback is still appreciated.)

Share this post


Link to post
Share on other sites

I remember a dev post about this being added someday? Or was there a reason it was not going to be added?

Share this post


Link to post
Share on other sites

I want to do something like one of my old suggestions....

 

standard action and repeat last action in one keybind.

 

When a tool is made active the most common action is set to standard action. There will be a config file so you can change what action is default. The key would also be a repeat last action key so if you don't want the selection, say dig for shovel, you'd use the menu once and the key will now be whatever you selected.

Share this post


Link to post
Share on other sites

there are the SELECT_BUTTON_X keybinds for the action bar.

 

So for example with the pickaxe on a cave wall the actions are 1: examine, 2: track, 3: mine, 4: mine down, 5: mine up, 6: prospect

 

Share this post


Link to post
Share on other sites

Yes, I know about those but they can change for some things as the available options change. For example, a sickle might have an option for cut grass or not, and the forage and bottanize slots will move depending on that.

Share this post


Link to post
Share on other sites

Then instead fix that SELECT_BUTTON issue, simply gray out an unavailable option such as cut grass rather than moving the other buttons around.  This is already on the keybind UI in the HUD section, and it does not require any console scripts.

 

It certainly is annoying that it does move the list around though, hotbars are about remembering which keys actions are on without having to watch the hotbar move them around.  

 

No need to make a new system when that system does it mostly right.  Even if you cannot figure out how to gray out the unuseable option and just leave it listed as available action, the game already handles the case where you try to do something that does not need doing like cutting grass when there is none to cut.

 

If someone can also fix it so the select keybinds work with mouse hover rather than mouse select so they are consistent with the other keybinds that would be great.  Mouse select is only needed if they want to use the mouse on the hotbar.

 

Most people are unaware of this system, WU devs defaulting it to assign the select bar to the number row where most games put the hotbar would make a big difference in default useability.  It just needs some of its bad implementation issues fixed up - lack of mouse hover, rearranging the tools action list, and not defaulted to num row.

Edited by yarnevk

Share this post


Link to post
Share on other sites

The selected bar works based on the position that selections would show up in the r-click menu. It binds keys to execute menu positions, effectively. The problem is that the order which things show up in the menu changes. This results in a selected bar keybind not always doing the same action. Further, sense the selected bar is essentially a different way to display a r-click menu it has to fetch available commands from the server. The fetching process is why the thing lags and doesn't work with simple mouse over. 

 

imo, it's better to do something over and do it right then to try and make something that is flawed in concept work. For the most part players not familiar with Wurm expect something like default action. This is how it works in every other game out there. It's simply stupid to make someone activate a rake and choose farm on a field when farm is the only thing you could do. You active the rake and use it on the field. The game should just assume you want to farm.

Heck, some games take it even a step further and as long as you got the tools in inventory you don't even have to select them. I'm not sure if this would work in Wurm because we do sometimes have multiple tools and game may not know which we wanted to use.

Share this post


Link to post
Share on other sites

The only reason I have seen it change is because an action is unavailable, the other actions just shift up to fill it's place.  It is not random order anymore.

 

Surely the server code is checking what actions are currently available out of a larger list of possible actions, so it is just a matter of modifying it to return the master action list for that tool and skip the action availability check.  

 

Find the check that says this tool is capable of cutting flowers and remove the check that asks are there flowers to cut, because if you try to cut the flowers that are not there the game will tell you there are no flowers.

 

If that means the popupmenu also changes to also show unavailable actions, not a big deal because the tool already has code to handle the case of doing unavailable actions because of the regular keybinds letting you spam forage on unforagable tiles.  Greying them out is a nicer UI but not necessary for functionality.

 

If you do not like the default action being examine tile, then reorder the list to make that last on the list.   The list is otherwise a sensible order with the most preferred action being first.

 

Wurm is different than other games because it is not streamlined that each tool only has one action, and each action only has one tool.  Many ways to do something due to the breadth and depth of tool actions.  So just like complex paint programs hotbar palettes associated with pop-menus are a necessary design, it is just bad UI design to be shifting the list to hide things you cannot do because it prohibits memorizing the command position.

 

There was nothing wrong with the select bar design in concept, it was just badly implemented.   It does not need to be redesigned, it just needs fixed up

 

The client/server tool/action authentication is one of the few bits of cheat security Rolf left in WU so why would you want to remove it. lag is a necessary evil in multiplayer games, if the client did everything it becomes too easy for people to cheat.   Even if the client was in charge of the action list, it is going to lag anyways performing the action that is modifying the server database so you have not actually improved the lag experience.  The game even lags just walking thru doors and gates (not sure if new permission system made that better or worse!)

Edited by yarnevk

Share this post


Link to post
Share on other sites

eh, maybe somebody will fix it. Although, it won't be me. Standard action-repeat last action is my path forward.

Share this post


Link to post
Share on other sites

And that does not fit the design of Wurm, standard action only works if there is only one tool for each action and one action for each tool because the UI has to otherwise become more cumbersome to do alternate tool actions. You can chop a tree down with a shovel if you want to (and on Wurm Online there was a reason to do so because of timer based skilling, in WU maybe you lost your hatchet).   The existing list already puts the preferred actions up front it just stupidly lists it third because of a bad implementation that puts actions you would rarely do standardized on first and second.   

 

Streamlining the UI to remove available actions is bad design because then you decide what I can be done with a tool rather than a player.  The entire game is built around the noun-verb tool-action methods giving player flexibility.

Edited by yarnevk

Share this post


Link to post
Share on other sites

Standard action works fine. I already made something that kinda implaments it and have been using it for months in WO. http://forum.wurmonline.com/index.php?/topic/98171-keybind-simplification-tool/

 

Yes, some tools have multiple actions. And is why I said the tool would need a alternate function of repeat last action.

 

I've already had this discussion in the suggestions forum long ago. I'm going to do standard action regardless what you (or anyone else) says. If you want to fix selected bar then I suggest you start working on it.

Share this post


Link to post
Share on other sites

This was not your mod thread, the OP's idea can be done by fixing the existing system, find the server code that is removing the unavailable actions from the servers action list.  Now every action will stay on its button for that tool, which is the fix the OP wants for the existing system.  It makes it work like every other game or paint tool with a context sensitive hotbar, which is how it should have been implemented to begin with.

 

 

Edited by yarnevk

Share this post


Link to post
Share on other sites
19 hours ago, yarnevk said:

This was not your mod thread, the OP's idea can be done by fixing the existing system, find the server code that is removing the unavailable actions from the servers action list.  Now every action will stay on its button for that tool, which is the fix the OP wants for the existing system.  It makes it work like every other game or paint tool with a context sensitive hotbar, which is how it should have been implemented to begin with.

 

 

I never said it was my mod thread. The OP asked how to solve a problem and I have one possible answer (a solution that I intend to do). If you have a different solution then by all means go for it.

 

In case you haven't noticed, I'll just keep repeating myself here (third time now I've said, "cool dude, you do what you want and I'll do what I want") if you continue to try to tell me my path is wrong.

Share this post


Link to post
Share on other sites

Then open your own mod thread for your idea and I will happy to tell you what is wrong with it, because I had proposed the same idea as your mod years ago and realized from the forum feedback why it was not the right way to go.

 

What you are posting is not what the OP asked for, which is a context sensitiive keybind for all the tools actions, if the existing select bar did not delete unavailable commands it does what is asked for.

 

Share this post


Link to post
Share on other sites
1 hour ago, yarnevk said:

Then open your own mod thread for your idea and I will happy to tell you what is wrong with it, because I had proposed the same idea as your mod years ago and realized from the forum feedback why it was not the right way to go.

 

What you are posting is not what the OP asked for, which is a context sensitiive keybind for all the tools actions, if the existing select bar did not delete unavailable commands it does what is asked for.

 

This is a request thread where the OP asked for possible solutions. Auto keybind based on active tool is exactly what describes standard action-repeat last action.

 

Fourth time I"ve repeated myself, if you think you have a better solution then by all means make it.

 

The beauty of mods is there is no one right path. The final product is completely optional and the only person's time whose wasted making the mod is the modders ( which is my own time in the case of standard action-repeat last action).

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this