Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


How to set custom hotkey sounds (6.5.1+)

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Tutorials
View previous topic :: View next topic  
Author Message
Dark Byte
Site Admin
Reputation: 458

Joined: 09 May 2003
Posts: 25284
Location: The netherlands

PostPosted: Fri Jun 10, 2016 5:22 am    Post subject: How to set custom hotkey sounds (6.5.1+) This post has 1 review(s) Reply with quote

You may have noticed that hotkeys can now have individual sounds,
and you may also have noticed that the default sounds suck.

To add new better sounds, your table needs to contain WAV files (RIFF Header).
You can either do that using table->add file, and then add a soundfile
Or
in the hotkey window, just rightclick on the sound selection combobox and choose "Add Sounds". That way you don't have to leave the screen

once your table contains them, the dropdownlists where you can pick the audio will contain the audiofiles in the table.

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
mgr.inz.Player
I post too much
Reputation: 218

Joined: 07 Nov 2008
Posts: 4438
Location: W kraju nad Wisla. UTC+01:00

PostPosted: Fri Jun 10, 2016 6:20 am    Post subject: This post has 1 review(s) Reply with quote

Method to encapsulate MP3 files to appear as .WAV files by adding a RIFF/WAV header to standard MPEG Layer-3 audio files:
(created wav file will still be as small as mp3, so you can embed more sounds like "godmode", "one hit kill", and more)


Code:
ffmpeg -i enable.mp3 -c:a copy enableMP3RIFF.wav


Code:
ffmpeg -i disable.mp3 -c:a copy disableMP3RIFF.wav


Download ffmpeg official builds from https://ffmpeg.zeranoe.com/builds/

I recommend "FFmpeg 32-bit Static Versions" from here
Direct link: https://ffmpeg.zeranoe.com/builds/win32/static/ffmpeg-latest-win32-static.7z




Instructions:
1. take ffmpeg.exe from "bin" folder. And place it inside folder where you have your mp3 files.
2. Select the folder you want to open in the command prompt
3. Right-click on it while holding the Shift key
4. Select Open command window here
4a if your OS is below win7, open command prompt the other way.

5. type in
Code:
ffmpeg -i sound.mp3 -c:a copy soundMP3RIFF.wav


6. press enter

_________________
Back to top
View user's profile Send private message MSN Messenger
++METHOS
I post too much
Reputation: 92

Joined: 29 Oct 2010
Posts: 4197

PostPosted: Fri Jun 10, 2016 11:10 am    Post subject: Reply with quote

This is really awesome, guys! +rep coming for both! Thanks!

EDIT:
I wonder if it would be possible to add multiple sounds to one entry with a random shuffle feature? For example, activating infinite health might say "infinite health activated" or "predictable" or "indeed" etc...randomly generated. Deactivating health might say "infinite health deactivated" or "foolish" or "you will lose" etc... I think it could make the trainers more fun. Very Happy
Back to top
View user's profile Send private message
mgr.inz.Player
I post too much
Reputation: 218

Joined: 07 Nov 2008
Posts: 4438
Location: W kraju nad Wisla. UTC+01:00

PostPosted: Fri Jun 10, 2016 4:35 pm    Post subject: This post has 1 review(s) Reply with quote

For that you can just use {$Lua} block.

Code:
[ENABLE]

{$Lua}
if syntaxcheck then return end
local choice=math.random(1,3)
playSound(findTableFile('enable'..choice..'.wav'))
{$Asm}

[DISABLE]

{$Lua}
if syntaxcheck then return end
local choice=math.random(1,2)
playSound(findTableFile('disable'..choice..'.wav'))
{$Asm}



multiple sounds to one entry.ct
 Description:

Download
 Filename:  multiple sounds to one entry.ct
 Filesize:  343.58 KB
 Downloaded:  1467 Time(s)


_________________
Back to top
View user's profile Send private message MSN Messenger
++METHOS
I post too much
Reputation: 92

Joined: 29 Oct 2010
Posts: 4197

PostPosted: Fri Jun 10, 2016 4:48 pm    Post subject: Reply with quote

So, in this case, we would add all of the audio files that we are going to use for our trainer, then, just define which ones we want to use for each, individual script using the code that you have provided?

EDIT:
Never mind. I looked at your table and figured that out! Very Happy
So cool! Thanks a lot!

So, in this case:
Code:
local choice=math.random(1,3)
playSound(findTableFile('enable'..choice..'.wav'))


This would cycle through all 'enable' files between 1-3? It seems to work that way.

Great! Thanks!
Back to top
View user's profile Send private message
mgr.inz.Player
I post too much
Reputation: 218

Joined: 07 Nov 2008
Posts: 4438
Location: W kraju nad Wisla. UTC+01:00

PostPosted: Fri Jun 10, 2016 4:58 pm    Post subject: This post has 1 review(s) Reply with quote

Yes. If you want randomness and multiple sounds to one memrec (with AA script).



For other memrecs, for example pointer to HP, you can add children memrec (AA script with script similar to script in my previous post), set group config to "activating this entry activates it's children" and "deactivating this entry dectivates it's children"



multiple sounds to one entry (non AA script).ct
 Description:

Download
 Filename:  multiple sounds to one entry (non AA script).ct
 Filesize:  344.25 KB
 Downloaded:  1166 Time(s)


_________________
Back to top
View user's profile Send private message MSN Messenger
++METHOS
I post too much
Reputation: 92

Joined: 29 Oct 2010
Posts: 4197

PostPosted: Fri Jun 10, 2016 5:01 pm    Post subject: Reply with quote

Right! So cool! Thanks! Very Happy
Back to top
View user's profile Send private message
mgr.inz.Player
I post too much
Reputation: 218

Joined: 07 Nov 2008
Posts: 4438
Location: W kraju nad Wisla. UTC+01:00

PostPosted: Fri Jun 10, 2016 5:10 pm    Post subject: Reply with quote

PS: read this topic http://forum.cheatengine.org/viewtopic.php?t=592591

Current CE 6.5.1, second post release, has a bug. It doesn't save custom hotkey sounds for AutoAssembler memrec.
You test it. It works. You save it to CT file, then open that CT file, custom sound settings are gone. Because of copy&paste, DB missed two lines. Patch to fix this issue:
Code:
Index: MemoryRecordUnit.pas
===================================================================
--- MemoryRecordUnit.pas   (wersja 2416)
+++ MemoryRecordUnit.pas   (kopia robocza)
@@ -1161,10 +1161,10 @@
       if hotkey[i].id>=0 then
         hk.AppendChild(doc.CreateElement('ID')).TextContent:=inttostr(hotkey[i].id);
 
-      if hotkey[i].value<>'' then
+      if hotkey[i].activateSound<>'' then
         hk.AppendChild(doc.CreateElement('ActivateSound')).TextContent:=hotkey[i].activateSound;
 
-      if hotkey[i].value<>'' then
+      if hotkey[i].deactivateSound<>'' then
         hk.AppendChild(doc.CreateElement('DeactivateSound')).TextContent:=hotkey[i].deactivateSound;
 
     end;



You can try my build or wait for "third post release" CE installer.



I think this whole topic should be moved to "Cheat Engine Beta" subforum. Then create new topic after CE6.5.1.3 arrives.


 

_________________
Back to top
View user's profile Send private message MSN Messenger
++METHOS
I post too much
Reputation: 92

Joined: 29 Oct 2010
Posts: 4197

PostPosted: Fri Jun 10, 2016 5:21 pm    Post subject: Reply with quote

Yeah...I saw that. I'll probably just wait for the fixed release since I'm not currently working on anything at the moment since I'm too busy with work-related stuff. I am excited to try out the new features, though. Very Happy
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

Joined: 09 May 2003
Posts: 25284
Location: The netherlands

PostPosted: Fri Jun 10, 2016 5:50 pm    Post subject: Reply with quote

You can also add the sounds back with a text editor (just don't save again, like most cheat tables)
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Tutorials All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites