Help required: Figuring out Gamepad Mode button labels in text/dialogue

Anything related to PR, release planning and any other non-technical idea how to move the project forward should be discussed here.
Post Reply
User avatar
Greendogo
Posts: 1282
Joined: 26 Aug 2011, 02:04

Help required: Figuring out Gamepad Mode button labels in text/dialogue

Post by Greendogo » 06 Aug 2017, 23:01

So in the game there are a few place where the currently set key's name is available to insert into text via a breakout sequence such as "^ActionReadyMagic" which will return the string for the currently assigned ready magic key. However, while researching the implementation of the Gamepad GUI mode, I looked at the char gen scripts where several of these breakout sequences are used to see how it referred to Joysticks or gamepad buttons, assuming that it had a similar breakout sequence. Nope.

Here's the code for the Script: "CharGen_ring_keley":
Spoiler: Show
When the game is supposed to check if it's running on an XBOX (and so should be using a gamepad), the boolean "Xbox" is set to 1, else it's set to 0.

As you can see in that script, if Xbox==1, it would deliver a line that specifically names Xbox controller buttons by name instead of using a breakout variable that we can change. This precludes us from easily inserting the name of a gamepad/joystick element, for example if the player wanted to use a Dualshock controller, or was using a controller that didn't correctly map a button to either the "Y" or "B" gamepad button events.

This needs feedback before I can continue researching the subject.

Chris
Posts: 1285
Joined: 04 Sep 2011, 08:33

Re: Help required: Figuring out Gamepad Mode button labels in text/dialogue

Post by Chris » 07 Aug 2017, 00:59

It should be possible for "^ActionReadyMagic" to be substituted with gamepad button names if the active control scheme is a gamepad (the Xbox check would always be false, since it's not on an XBox). The bigger issue will be actions that don't have custom strings, like "click to cast" (it assumes you have Attack set to a mouse button), or "right click to use your new menu" (it assumes the menu button is RMB). The engine would probably need to have additional string substitutions for those other actions, and a mod to use them in the appropriate places.

Another thing to consider is that most games these days use graphics to display button prompts, which helps for things like the Playstation controllers that use colored shapes instead of letters. I don't know if there's any kind of standard for gamepads or gamepad drivers to map graphics to buttons, or if it's supposed to be all custom done in the engine.

User avatar
Greendogo
Posts: 1282
Joined: 26 Aug 2011, 02:04

Re: Help required: Figuring out Gamepad Mode button labels in text/dialogue

Post by Greendogo » 07 Aug 2017, 23:32

For the most part, the button names would be used in text like this:

Xbox:
MessageBox "Press Y to ready your Active Magic, then the RIGHT TRIGGER to cast." "Ok"
PlayStation:
MessageBox "Press TRIANGLE to ready your Active Magic, then the RIGHT TRIGGER to cast." "Ok"

Icons would be used for everywhere else. I'm writing a feature Issue tree for Gamepad GUI Mode for the tracker, but this problem with the text strings for the buttons is the only thing holding up my progress.

I could just ignore it and have the Xbox string OR the keyboard/PC strings be used (XBOX == 1 or XBOX ==0, respectively) and it wouldn't really matter as long as the player understood that the mappings in the text strings don't correspond to what they'll actually be using. It's definitely not an optimal solution, but Morrowind just wasn't designed for using other Gamepads than the Xbox's. I'll continue my design of the tracker issues with the idea that we'd probably just keep the keyboard text strings and only change the GUI and icons.

Chris
Posts: 1285
Joined: 04 Sep 2011, 08:33

Re: Help required: Figuring out Gamepad Mode button labels in text/dialogue

Post by Chris » 08 Aug 2017, 05:21

Greendogo wrote:
07 Aug 2017, 23:32
I could just ignore it and have the Xbox string OR the keyboard/PC strings be used (XBOX == 1 or XBOX ==0, respectively) and it wouldn't really matter as long as the player understood that the mappings in the text strings don't correspond to what they'll actually be using. It's definitely not an optimal solution, but Morrowind just wasn't designed for using other Gamepads than the Xbox's.
As I said, it should be possible to substitute the ^Action strings for the gamepad button names if the gamepad is the active control scheme, so it'll at least give the textual string as the system knows it (and thus will match other apps). This also has the benefit of following remaps of the controller buttons (something the original didn't allow, and the XBOX strings certainly don't handle). The only remaining issue is what I mentioned, that some action binds were hardcoded in the script message. This is a problem even when using mouse and keyboard -- remap the cast/attack key to CTRL, for example, and it'll still tell you to "click to cast", or remap inventory to TAB, and it'll still tell you to right click for it. It won't be a controller-specific problem.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests