Jump to content

Hotkey for building


Recommended Posts

I made some changes, so now Hotkeys can be used to select buildings to build. F.e. if pressed "Z" (the default-setting) and a Unit is selected, now a House (because its the first element in buildings-panel) is selected and can now be placed to build by this Unit. If "Z" is pressed when a Building is selected, then still the first Unit will be build, like before.

Would that be of any interest for 0 A.D. 0.23 Vanilla? @elexis

  • Like 1
Link to comment
Share on other sites

Something like this would be a bit frustrating with how the current unit panels are designed. There are a lot of buildings which can be constructed, so a lot of keys as well.

However, if the construction panel were to be split into categories like AoE it would be a different story. And would be more simple to use as well.

For example, to build the first building in the millitary category, you can just press “m” and then “z”.

Its also worth mentioning that with the current layout, there is a kinda low maximum limit of buildings that can be available to a faction. And some mods have already ran into the issue of not having enough space. IIRC, yours as well.

Edited by Guest
Link to comment
Share on other sites

For that reason i used the hotkeys for Units (Z,X,...N,M,Comma), so only the 8 most common buildings can be selected that way, more than that will be  a mess, very true, and the placement problem i I got rid of by making the Icons a bit smaller, So now i have 32 buildings slots and not 24 like before. But what should be done is that Females and Soldier have the same 8 most common Buildings in their Builder- Entities List, otherwise it will be confusing.

Link to comment
Share on other sites

Depends on the implementation. As (-_-) mentioned it's very weird if you have the same hotkey configuration but it equates to a different unit or building for each civ.

It should be something like B for blacksmith for all civs.

But since all civs have different civ templates, one can't use the template name as an identifier. It would either have to be an Identity class - or what I came to conclude - a hotkey identifier in the template names, such as "hotkey.building.tower" or "hotkey.building.gate_ishtar". (It's what I intended to code after the hotkey editor which I coded in 2017 but never released.)

This way one could control have the game with keypresses.

  • Like 1
Link to comment
Share on other sites

My solution is only to use the 8 most common building (the first row), and if we write in the templates template_unit_support_female_citizen.xml and template_unit_infantry.xml the same first 8 builder Entities, then the fist row in buildings panel will never change, as far as i tested. That would be, even without hotkeys, a good idea. And to use the same hotkeys as for Units is the best solution, cause it is the simplest solution.  @elexis

Link to comment
Share on other sites

Btw. to make Hotkeys for special buildings or a fortress, would be too complicated to implement and for the players to remember and to understand. And  these building will only be build , most of the time,  only once in a game.

Link to comment
Share on other sites

Yes, but as a player, i would never uses this, too complicated too remember and also for most player too many Keys to press. It would be faster and less frustrating to only use the mouse then. Maybe I don't like to play Zero-K just because of this implementation.

Link to comment
Share on other sites

1 hour ago, Nescio said:

And what if you currently have both structures and units selected? Would B then mean unit:build or structure:train5thunit? Or both?

If the same key is assigned to multiple hotkeys, all of the hotkeys are triggered when the key is pressed. Whether the hotkey does something is up to the code assigned to it. Building hotkeys for instance should only be triggered once the GUI is in "building placement mode" after pressing that hotkey; i.e. B for build, H for house. So this particular example would unlikely occur unless the user configured it particularly weirdly. But in many places of the current code that's already the case and also the reason why there's the "shiftlag" issue.

Link to comment
Share on other sites

Thx fpre, didnt know about that ticket. But my solution to go over the Hotkeys for Units is preferable, in my opinion. No lag, no overhead, easy to adopt by players, and easier to understand, unlimited hotkeys, until know the first 15 buildings are all the same for all civs. But later I maybe implement the formation/stances-hotkey, which are pretty nice.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...