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
Code: Select all
begin CharGen_ring_keley
;picking up this ring shows you magic menu
short state
short OnPCAdd
if ( CharGenState == -1 )
return
endif
if ( menumode == 1 )
return
endif
if ( state == 30 )
return
endif
if ( OnPCAdd == 1 )
if ( State == 0 )
EnableMagicMenu
MessageBox "You now have a Magic Menu, where you can see all your powers, spells, and magic items." "Ok"
set state to 5
return
endif
endif
if ( state == 5 )
if ( GetButtonPressed != -1 )
set state to 10
endif
endif
if ( state == 10 )
if ( Xbox == 0 )
MessageBox "Like all menus, right click to use your new menu. Click the spell or magic item you want to make your Active Magic." "Ok"
else
MessageBox "Like all menus, press B to use your new menu. The triggers cycle between menus. Press B again to exit your menus." "Ok"
endif
set state to 20
return
endif
if ( state == 20 )
if ( Xbox == 0 )
MessageBox "Press ^ActionReadyMagic to ready your Active Magic, then click to cast." "Ok"
else
MessageBox "Press Y to ready your Active Magic, then the RIGHT TRIGGER to cast." "Ok"
endif
set state to 30
endif
end
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.