Pretty much as the title says.
Right now on a joypad with xbox layout the button 'A' is [use]. Is there any way to change this to 'B' ?
- It doesn't need to work everywhere, only for activating NPCs on the map. In fact, I don't care if it breaks menus or battles.
- I'm quite willing to mess with scancode.hsi if need be.
All the best,
Daniel
Remap Joypad Action Key
Moderators: marionline, SDHawk
Re: Remap Joypad Action Key
Builtin features to remap gamepad and keyboard keys are in the pipeline, and sorely needed. I wanted to finish that pretty soon, not sure when. But until then you need to script it.
Do you want A to stop acting as 'Use', or do you not care? It's possible to disable a builtin key by calling "suspend player" and waiting until the key is up:
To make B act as Use you can use a script to watch for joy:B and if so use an NPC. I adapted https://rpg.hamsterrepublic.com/ohrrpgc ... _a_use_key
Do you want A to stop acting as 'Use', or do you not care? It's possible to disable a builtin key by calling "suspend player" and waiting until the key is up:
Code: Select all
while (key is pressed(joy:A)) do(
suspend player
wait
resume player
)
Code: Select all
plotscript, use npc on keypress, begin
if (player is suspended || hero is walking(me)) then (exit script)
if (keypress(joy:B)) then, begin
variable (x, y, npc)
x := hero x(me)
y := hero y(me)
# Find the tile in front of the hero
switch (hero direction(me)) do, begin
case (up) y -= 1
case (down) y += 1
case (left) x -= 1
case (right) x += 1
end
npc := npc at spot(x, y)
if (npc) then (use npc(npc))
end
end
Re: Remap Joypad Action Key
Thank you TMC, that was fast