Volitio Posted August 31, 2014 Share Posted August 31, 2014 I want to create a mod that simply play an audio when a certain hotkey is pressed. How I do this? Link to comment Share on other sites More sharing options...
Mattiewagg Posted August 31, 2014 Share Posted August 31, 2014 Pretty easy. Setting up a hotkey is quite easy. Just create an empty quest (run once, start game enabled), add a quest script, and make it look something like this: Scriptname MyHotkeyScript Extends Quest Int Property MyKey Auto Sound Property MySound Auto Event OnInit() RegisterForSingleUpdate(1.0) EndEvent Event OnUpdate() RegisterForMyKey() EndEvent Event OnKeyDown(Int KeyCode) If KeyCode == MyKey MySound.Play() EndIf EndEvent Function RegisterForMyKey() RegisterForKey(MyKey) EndFunction Be sure to fill those properties. MyKey will be based on a number from this list of DXScanCodes. Then create a reference alias for the player (forced, cell - (any), target (PlayerRef)), and add this script to that alias: Scriptname MyPlayerAliasScript Extends ReferenceAlias Event OnPlayerLoadGame() (GetOwningQuest() as MyHotkeyScript).RegisterForMyKey() EndEvent That's all there is to it. Link to comment Share on other sites More sharing options...
Mattiewagg Posted August 31, 2014 Share Posted August 31, 2014 (edited) Double post. Edited August 31, 2014 by Matthiaswagg Link to comment Share on other sites More sharing options...
Recommended Posts