Hotkey question

If you are having problems finding or using cheats for an Emulator (particularly MAME/MESS) or have found a trick that you wish to share this is the place to do it. But please read the Cheat FAQ first.
Post Reply
User avatar
mU$!c
Posts: 17
Joined: Fri Sep 12, 2014 3:10 pm

Hotkey question

Post by mU$!c » Fri Jul 06, 2018 10:20 pm

[quote="crazyc"]Now you can set hotkeys similarly to how the input menu works. It doesn't let you set multiple mappings for one cheat (which wouldn't make much sense IMO) [strike]and doesn't currently give feedback when polling except the game freezes for a second[/strike]. Added a popmessage when to press the hotkey to set.[/quote]

Old, but awesome news! :) Which begs the question...how do I code a hotkey to for 2 different buttons to activate 2 different variable for the same cheat?

For Example:

https://i.imgur.com/qBv8lvb.png

https://i.imgur.com/QtSmSgi.png

This is the original cheat for mkla3:

<cheat desc="P1 Select Body Move Set">
<parameter>
<item value="0x00">Johnny Blade</item>
<item value="0x01">Kano</item>
<item value="0x02">Raiden</item>
<item value="0x03">Liu Kang</item>
<item value="0x04">Scorpion</item>
<item value="0x05">Sub-Zero</item>
<item value="0x06">Sonya Blade</item>
<item value="0x07">#Goro</item>
<item value="0x08">#Shang Tsung</item>
</parameter>
<script state="run">
<action>maincpu.pb@01014CF0=param</action>
<action>maincpu.pb@0101ABF0=param</action>
<action>maincpu.pb@0101D910=param</action>
<action>maincpu.pb@0101E030=param</action>
<action>maincpu.pb@0101E4F0=param</action>
<action>maincpu.pb@01020170=param</action>
<action>maincpu.pb@01021210=param</action>
<action>maincpu.pb@01022050=param</action>
</script>
</cheat>

I already tried creating a simplified version of the cheat and split it into 2 different Body Move Sets:

<cheat desc="P1 Reptile's Scorpion Body Move Set">
<parameter>
<item value="0x04">Scorpion</item>
</parameter>
<script state="run">
<action>maincpu.pb@0101E030=param</action>
</script>
</cheat>

<cheat desc="P1 Reptile's Sub-Zero Body Move Set">
<parameter>
<item value="0x05">Sub-Zero</item>
</parameter>
<script state="run">
<action>maincpu.pb@0101E4F0=param</action>
</script>
</cheat>

I assigned a different hotkey to each Body Move Set, but they don't activate in-game when i press the hotkeys. This was the only work-around I came up with. So, will have to come up with code to script to the mkla3_hotkeys.json file that will allow me to switch between 2 different Body Move Sets using hotkeys.

crazyc
Posts: 17
Joined: Sat Apr 30, 2016 4:49 pm

Re: cheat lua plugins

Post by crazyc » Sat Jul 07, 2018 8:09 pm

You might try instead

<cheat desc="P1 Reptile's Scorpion Body Move Set">
<script state="run">
<action>maincpu.pb@0101E030=4</action>
</script>
</cheat>

User avatar
mU$!c
Posts: 17
Joined: Fri Sep 12, 2014 3:10 pm

Re: cheat lua plugins

Post by mU$!c » Mon Jul 09, 2018 4:21 am

[quote="crazyc"]You might try instead

<cheat desc="P1 Reptile's Scorpion Body Move Set">
<script state="run">
<action>maincpu.pb@0101E030=4</action>
</script>
</cheat>[/quote]

Still can't switch between Body Move Sets. not working even when i activate one or the other in cheats
or both at once.

If I leave the cheats turned off, the hotkey won't turn the cheats on either. I need to write a script that will turn the each cheat on and off when the hotkey for the corresponding cheat is pressed. Even when I manually turn on the cheat, hotkey won't activate the cheat. The Body Move Sets won't change, won't switch on.

mkla3_hotkeys.json:

[{
"keys":"JOYCODE_1_BUTTON7",
"desc":"P1 Reptile's Scorpion Body Move Set"
},{
"keys":"JOYCODE_1_BUTTON8",
"desc":"P1 Reptile's Sub-Zero Body Move Set"
}]

User avatar
Pugsy
Posts: 3194
Joined: Fri Aug 17, 2001 12:59 am
Location: North Wales, UK.
Contact:

Re: cheat lua plugins

Post by Pugsy » Tue Jul 10, 2018 1:01 am

Something like this should work...I used to use a similar method for tetris shape cheats when hotkeys used to work.

Code: Select all

  <cheat desc="P1 Rotate Through Body Move Sets">
    <script state="run">
      <output format="Body Move Set Selected == %02X">
        <argument count="1">temp0</argument>
      </output>
    </script>
    <script state="on">
      <action>temp0=1 + maincpu.pb@01014CF0</action>
      <action condition="temp0==09">temp0=0</action>
      <action>maincpu.pb@01014CF0=temp0</action>
      <action>maincpu.pb@0101ABF0=temp0</action>
      <action>maincpu.pb@0101D910=temp0</action>
      <action>maincpu.pb@0101E030=temp0</action>
      <action>maincpu.pb@0101E4F0=temp0</action>
      <action>maincpu.pb@01020170=temp0</action>
      <action>maincpu.pb@01021210=temp0</action>
      <action>maincpu.pb@01022050=temp0</action>
    </script>
  </cheat>
Alternatively just try what crazyc mentioned but use "on" rather than "run" otherwise you will need to make sure you disable the previous cheat before enabling the next one. Eg press x to change to bodyset 1, press x again to turn it off and then press y to select bodyset 2
Pugsy

Servicing your cheating needs since 1985 ;-)

Grab the latest cheat collection:
MAME 0.200 XML cheat collection 12 AUGUST 2018) from http://www.mamecheat.co.uk or direct from:-
http://www.mediafire.com/file/39od7hvga ... at0200.zip (ZIP Archive 1894 KB)

User avatar
mU$!c
Posts: 17
Joined: Fri Sep 12, 2014 3:10 pm

Re: cheat lua plugins

Post by mU$!c » Thu Jul 12, 2018 10:02 am

Pugsy wrote:Something like this should work...I used to use a similar method for tetris shape cheats when hotkeys used to work.

Code: Select all

  <cheat desc="P1 Rotate Through Body Move Sets">
    <script state="run">
      <output format="Body Move Set Selected == %02X">
        <argument count="1">temp0</argument>
      </output>
    </script>
    <script state="on">
      <action>temp0=1 + maincpu.pb@01014CF0</action>
      <action condition="temp0==09">temp0=0</action>
      <action>maincpu.pb@01014CF0=temp0</action>
      <action>maincpu.pb@0101ABF0=temp0</action>
      <action>maincpu.pb@0101D910=temp0</action>
      <action>maincpu.pb@0101E030=temp0</action>
      <action>maincpu.pb@0101E4F0=temp0</action>
      <action>maincpu.pb@01020170=temp0</action>
      <action>maincpu.pb@01021210=temp0</action>
      <action>maincpu.pb@01022050=temp0</action>
    </script>
  </cheat>
Alternatively just try what crazyc mentioned but use "on" rather than "run" otherwise you will need to make sure you disable the previous cheat before enabling the next one. Eg press x to change to bodyset 1, press x again to turn it off and then press y to select bodyset 2

^This code gives intended effect and works very well

I'm trying to convert this into a code that will only switch between

____________________________________________________________________________________

This won't work (won't even show the cheat when I change "run" to "on"):

UPDATE: Problem was I had an error 201, parsing. So, I grabbed a fresh 0.187 cheat.7z and all was well. These codes display in cheatlist, but they don't work.

Code: Select all

<cheat desc="P1 Reptile's Scorpion Body Move Set">
<script state="on">
<action>maincpu.pb@0101E030=4</action>
</script>
</cheat>

Code: Select all

<cheat desc="P1 Reptile's Sub-Zero Body Move Set">
<script state="on">
<action>maincpu.pb@0101E4F0=5</action>
</script>
</cheat>

Code: Select all

<cheat desc="P2 Reptile's Scorpion Body Move Set">
<script state="run">
<action>maincpu.pb@0101BA30=4</action>
</script>
</cheat>

Code: Select all

<cheat desc="P2 Reptile's Sub-Zero Body Move Set">
<script state="run">
<action>maincpu.pb@0101BEF0=5</action>
</script>
</cheat>
These ones no funciona correctamente for me.

no joy :(

UPDATE: Tested some more. @Pugsy Your code works, just cycles through all Body Move Sets (intended effect).

@Pugsy BTW...why can you use BBCode for

Code: Select all

 
and we can't?
Last edited by mU$!c on Sat Jul 14, 2018 8:15 am, edited 2 times in total.

User avatar
Pugsy
Posts: 3194
Joined: Fri Aug 17, 2001 12:59 am
Location: North Wales, UK.
Contact:

Re: cheat lua plugins

Post by Pugsy » Thu Jul 12, 2018 10:49 pm

mU$!c wrote:
@Pugsy BTW...why can you use BBCode for

Code: Select all

 [/code ] and we can't?[/quote]

I don't know, you might need to enable bbcode in your User Control Panel?

Quick Link:-

http://www.mamecheat.co.uk/forums/ucp.php?i=ucp_prefs&mode=post
Pugsy

Servicing your cheating needs since 1985 ;-)

Grab the latest cheat collection:
MAME 0.200 XML cheat collection 12 AUGUST 2018) from http://www.mamecheat.co.uk or direct from:-
http://www.mediafire.com/file/39od7hvga ... at0200.zip (ZIP Archive 1894 KB)

crazyc
Posts: 17
Joined: Sat Apr 30, 2016 4:49 pm

Re: Hotkey question

Post by crazyc » Fri Jul 13, 2018 11:33 pm

I could add support for this but I don't really know how the ui would work to set it to rotate the options with presses or to just set the one selected.

User avatar
mU$!c
Posts: 17
Joined: Fri Sep 12, 2014 3:10 pm

Re: cheat lua plugins

Post by mU$!c » Sat Jul 14, 2018 7:59 am

Pugsy wrote:
mU$!c wrote:
@Pugsy BTW...why can you use BBCode for

Code: Select all

 [/code ] and we can't?[/quote]

I don't know, you might need to enable bbcode in your User Control Panel?

Quick Link:-

http://www.mamecheat.co.uk/forums/ucp.php?i=ucp_prefs&mode=post[/quote]


:D LOL BBCode was already enabled, though. But everything's right on time now. Just like a swiss watch  8)

Ruhab21
Posts: 3
Joined: Thu Aug 09, 2018 8:14 pm

Re: Hotkey question

Post by Ruhab21 » Fri Aug 10, 2018 9:11 pm

Is there any way that I can edit a cheat and be able to make my own in a
game. Such as I want to make a cheat code such as select control PL1 in
like street fighter games. I want to do this in mameui fx0122. Is there any
way possible.

User avatar
Pugsy
Posts: 3194
Joined: Fri Aug 17, 2001 12:59 am
Location: North Wales, UK.
Contact:

Re: Hotkey question

Post by Pugsy » Sun Aug 12, 2018 11:10 pm

Ruhab21 wrote:Is there any way that I can edit a cheat and be able to make my own in a
game. Such as I want to make a cheat code such as select control PL1 in
like street fighter games. I want to do this in mameui fx0122. Is there any
way possible.
Don' t really understand the question or what it has to do with hotkeys....this seems a LOT off topic.

You can make any cheat with enough patience and perseverance, but personally I wouldn't use MAME 0.122( that's over 10 years old ). I'd update to a newer MAME version.
Pugsy

Servicing your cheating needs since 1985 ;-)

Grab the latest cheat collection:
MAME 0.200 XML cheat collection 12 AUGUST 2018) from http://www.mamecheat.co.uk or direct from:-
http://www.mediafire.com/file/39od7hvga ... at0200.zip (ZIP Archive 1894 KB)

Ruhab21
Posts: 3
Joined: Thu Aug 09, 2018 8:14 pm

Re: Hotkey question

Post by Ruhab21 » Tue Aug 14, 2018 10:21 pm

How do I post
I am unable to find New Topic Button

Ruhab21
Posts: 3
Joined: Thu Aug 09, 2018 8:14 pm

Re: Hotkey question

Post by Ruhab21 » Tue Aug 14, 2018 10:21 pm

How do I post
I am unable to find New Topic Button

User avatar
Pugsy
Posts: 3194
Joined: Fri Aug 17, 2001 12:59 am
Location: North Wales, UK.
Contact:

Re: Hotkey question

Post by Pugsy » Tue Aug 14, 2018 11:13 pm

Go to the subforum page, eg:-

viewforum.php?f=1

And look under M.A.M.E. "Arcade" Cheat Requests and you will see a New Topic button
Pugsy

Servicing your cheating needs since 1985 ;-)

Grab the latest cheat collection:
MAME 0.200 XML cheat collection 12 AUGUST 2018) from http://www.mamecheat.co.uk or direct from:-
http://www.mediafire.com/file/39od7hvga ... at0200.zip (ZIP Archive 1894 KB)

Post Reply